mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
postgresql: replace pg_config with custom script
By replacing upstream's pg_config binary with a shell script, we: - gain the ability to run pg_config easily when cross-compiling, - can remove the fake pg_config in the default output, - can remove the pg_config wrapper script dealing with special cases. Some 20 years ago, pg_config *was* a shell script upstream, too. It was changed to a binary, when it was made "relocatable", so it would return paths depending on the location of the "postgres" binary. However, this is exactly the thing that just hurts us in nixpkgs - we don't want those paths to change, we want them to always point at the right outputs. By writing the script ourselves, this becomes a lot less painful. This approach means more lines of codes, but all of them are dead simple and we have a lot less complexity overall. Additionally, pg_config is now made a separate derivation, only exposed as "postgresql.pg_config". This has the nice side-effect, that all users of postgresql and libpq in nixpkgs must be very *explicit* about their dependency on pg_config. This gives a lot more visibility into the state of affairs regarding pkg-config support for libpq, which ultimately is the much better solution.
This commit is contained in:
parent
4b631f7101
commit
88dfade94b
32 changed files with 221 additions and 93 deletions
|
@ -154,7 +154,7 @@ let
|
|||
defaultGemConfig = pkgs.defaultGemConfig // {
|
||||
pg = attrs: {
|
||||
buildFlags =
|
||||
[ "--with-pg-config=${lib.getDev pkgs."postgresql_${pg_version}"}/bin/pg_config" ];
|
||||
[ "--with-pg-config=${pkgs."postgresql_${pg_version}".pg_config}/bin/pg_config" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -172,7 +172,7 @@ let
|
|||
gemConfig = pkgs.defaultGemConfig // {
|
||||
pg = attrs: {
|
||||
buildFlags =
|
||||
[ "--with-pg-config=${lib.getDev pkgs."postgresql_${pg_version}"}/bin/pg_config" ];
|
||||
[ "--with-pg-config=${pkgs."postgresql_${pg_version}".pg_config}/bin/pg_config" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -190,7 +190,7 @@ let
|
|||
defaultGemConfig = super.defaultGemConfig // {
|
||||
pg = attrs: {
|
||||
buildFlags = [
|
||||
"--with-pg-config=${lib.getDev pkgs."postgresql_${pg_version}"}/bin/pg_config"
|
||||
"--with-pg-config=${pkgs."postgresql_${pg_version}".pg_config}/bin/pg_config"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue