mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-15 05:59:17 +03:00
postgresql: always create the $out/bin directory
This is needed because some PostgreSQL plugins don't have a bin directory. If only these plugins are listed in cfg.extraPlugins buildEnv will turn $out/bin into a symbolic link to ${pg}/bin. Lateron we try to rm $out/bin/{pg_config,postgres,pg_ctl} which will then fail because $out/bin will be read-only.
This commit is contained in:
parent
74bc006bbb
commit
517c52ec2e
9 changed files with 4 additions and 15 deletions
|
@ -12,10 +12,13 @@ let
|
|||
else pkgs.buildEnv {
|
||||
name = "postgresql-and-plugins-${(builtins.parseDrvName pg.name).version}";
|
||||
paths = [ pg pg.lib ] ++ cfg.extraPlugins;
|
||||
# We include /bin to ensure the $out/bin directory is created which is
|
||||
# needed because we'll be removing files from that directory in postBuild
|
||||
# below. See #22653
|
||||
pathsToLink = [ "/" "/bin" ];
|
||||
buildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild =
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
rm $out/bin/{pg_config,postgres,pg_ctl}
|
||||
cp --target-directory=$out/bin ${pg}/bin/{postgres,pg_config,pg_ctl}
|
||||
wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue