Skip to content

Commit

Permalink
treewide: fix pg_config / postgresql headers moved to dev output
Browse files Browse the repository at this point in the history
This was supposed to happen in NixOS#294504, but the commit was accidentally
left out when splitting off some libpq-related changes. Originated in
NixOS#179962, by Sandro.

Co-authored-by: Sandro Jäckel <[email protected]>
Co-authored-by: Wolfgang Walther <[email protected]>
  • Loading branch information
wolfgangwalther and SuperSandro2000 committed Aug 24, 2024
1 parent 379cbc4 commit 050689d
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 27 deletions.
8 changes: 3 additions & 5 deletions doc/languages-frameworks/ruby.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ let
defaultGemConfig = pkgs.defaultGemConfig // {
pg = attrs: {
buildFlags =
[ "--with-pg-config=${pkgs."postgresql_${pg_version}"}/bin/pg_config" ];
[ "--with-pg-config=${lib.getDev pkgs."postgresql_${pg_version}"}/bin/pg_config" ];
};
};
};
Expand All @@ -172,7 +172,7 @@ let
gemConfig = pkgs.defaultGemConfig // {
pg = attrs: {
buildFlags =
[ "--with-pg-config=${pkgs."postgresql_${pg_version}"}/bin/pg_config" ];
[ "--with-pg-config=${lib.getDev pkgs."postgresql_${pg_version}"}/bin/pg_config" ];
};
};
};
Expand All @@ -190,9 +190,7 @@ let
defaultGemConfig = super.defaultGemConfig // {
pg = attrs: {
buildFlags = [
"--with-pg-config=${
pkgs."postgresql_${pg_version}"
}/bin/pg_config"
"--with-pg-config=${lib.getDev pkgs."postgresql_${pg_version}"}/bin/pg_config"
];
};
};
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/misc/pgmodeler/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ pkg-config qmake wrapQtAppsHook ];
qmakeFlags = [ "pgmodeler.pro" "CONFIG+=release" ] ++ lib.optionals stdenv.isDarwin [
"PGSQL_INC=${postgresql}/include"
"PGSQL_LIB=${postgresql.lib}/lib/libpq.dylib"
"PGSQL_INC=${lib.getDev postgresql}/include"
"PGSQL_LIB=${lib.getLib postgresql}/lib/libpq.dylib"
"XML_INC=${libxml2.dev}/include/libxml2"
"XML_LIB=${libxml2.out}/lib/libxml2.dylib"
"PREFIX=${placeholder "out"}/Applications/pgModeler.app/Contents"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/misc/zammad/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ let
];
gemConfig = defaultGemConfig // {
pg = attrs: {
buildFlags = [ "--with-pg-config=${postgresql}/bin/pg_config" ];
buildFlags = [ "--with-pg-config=${lib.getDev postgresql}/bin/pg_config" ];
};
rszr = attrs: {
buildInputs = [ imlib2 imlib2.dev ];
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/compilers/urweb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ stdenv.mkDerivation rec {
configureFlags = [ "--with-openssl=${openssl.dev}" ];

preConfigure = ''
export PGHEADER="${postgresql}/include/libpq-fe.h";
export MSHEADER="${libmysqlclient}/include/mysql/mysql.h";
export SQHEADER="${sqlite.dev}/include/sqlite3.h";
export ICU_INCLUDES="-I${icu.dev}/include";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/libraries/libdbi-drivers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ stdenv.mkDerivation rec {
"--with-sqlite3-libdir=${sqlite.out}/lib/sqlite"
] ++ lib.optionals (postgresql != null) [
"--with-pgsql"
"--with-pgsql_incdir=${postgresql}/include"
"--with-pgsql_libdir=${postgresql.lib}/lib"
];

env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/opendbx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ stdenv.mkDerivation rec {

preConfigure = ''
export CPPFLAGS="-I${getDev libmysqlclient}/include/mysql"
export LDFLAGS="-L${libmysqlclient}/lib/mysql -L${postgresql}/lib"
export LDFLAGS="-L${libmysqlclient}/lib/mysql"
configureFlagsArray=(--with-backends="mysql pgsql sqlite3")
'';

Expand Down
5 changes: 5 additions & 0 deletions pkgs/development/python-modules/psycopg/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ let

nativeBuildInputs = [
cython
# needed to find pg_config with strictDeps
postgresql
setuptools
tomli
];

buildInputs = [
postgresql
];

# tested in psycopg
doCheck = false;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/python-modules/psycopg2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ buildPythonPackage rec {
# some linker flags are added but the linker ignores them because they're incompatible
# https://github.com/psycopg/psycopg2/blob/89005ac5b849c6428c05660b23c5a266c96e677d/setup.py
substituteInPlace setup.py \
--replace "self.pg_config_exe = self.build_ext.pg_config" 'self.pg_config_exe = "${lib.getExe' buildPackages.postgresql "pg_config"}"'
--replace-fail "self.pg_config_exe = self.build_ext.pg_config" 'self.pg_config_exe = "${lib.getDev buildPackages.postgresql}/bin/pg_config"'
'';

nativeBuildInputs = [
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/ruby-modules/gem-config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ in
# Force pkg-config lookup for libpq.
# See https://github.com/ged/ruby-pg/blob/6629dec6656f7ca27619e4675b45225d9e422112/ext/extconf.rb#L34-L55
#
# Note that setting --with-pg-config=${postgresql}/bin/pg_config would add
# Note that setting --with-pg-config=${lib.getDev postgresql}/bin/pg_config would add
# an unnecessary reference to the entire postgresql package.
buildFlags = [ "--with-pg-config=ignore" ];
nativeBuildInputs = [ pkg-config ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ let
preBuildAndTest = ''
export PGRX_HOME=$(mktemp -d)
export PGDATA="$PGRX_HOME/data-${pgrxPostgresMajor}/"
cargo-pgrx pgrx init "--pg${pgrxPostgresMajor}" ${postgresql}/bin/pg_config
cargo-pgrx pgrx init "--pg${pgrxPostgresMajor}" ${lib.getDev postgresql}/bin/pg_config
echo "unix_socket_directories = '$(mktemp -d)'" > "$PGDATA/postgresql.conf"
# This is primarily for Mac or other Nix systems that don't use the nixbld user.
Expand Down Expand Up @@ -120,7 +120,7 @@ let
PGRX_BUILD_FLAGS="--frozen -j $NIX_BUILD_CORES ${builtins.concatStringsSep " " cargoBuildFlags}" \
${lib.optionalString stdenv.isDarwin ''RUSTFLAGS="''${RUSTFLAGS:+''${RUSTFLAGS} }-Clink-args=-Wl,-undefined,dynamic_lookup"''} \
cargo pgrx package \
--pg-config ${postgresql}/bin/pg_config \
--pg-config ${lib.getDev postgresql}/bin/pg_config \
${maybeDebugFlag} \
--features "${builtins.concatStringsSep " " buildFeatures}" \
--out-dir "$out"
Expand Down
1 change: 0 additions & 1 deletion pkgs/servers/mail/exim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ in stdenv.mkDerivation rec {
s:^# \(LOOKUP_PGSQL=yes\)$:\1:
s:^\(LOOKUP_LIBS\)=\(.*\):\1=\2 -lpq -L${postgresql.lib}/lib:
s:^# \(LOOKUP_LIBS\)=.*:\1=-lpq -L${postgresql.lib}/lib:
s:^# \(LOOKUP_INCLUDE\)=.*:\1=-I${postgresql}/include:
''}
${lib.optionalString enableSqlite ''
s:^# \(LOOKUP_SQLITE=yes\)$:\1:
Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/sql/postgresql/ext/age.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
echo -e "include Makefile\nfiles:\n\t@echo \$(REGRESS)" > Makefile.regress
REGRESS_TESTS=$(make -f Makefile.regress files)
${postgresql}/lib/pgxs/src/test/regress/pg_regress \
${lib.getDev postgresql}/lib/pgxs/src/test/regress/pg_regress \
--inputdir=./ \
--bindir='${postgresqlAge}/bin' \
--encoding=UTF-8 \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/sql/postgresql/ext/plv8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ in stdenv.mkDerivation (finalAttrs: {
echo -e "include Makefile\nprint_regress_files:\n\t@echo \$(REGRESS)" > Makefile.regress
REGRESS_TESTS=$(make -f Makefile.regress print_regress_files)
${postgresql}/lib/pgxs/src/test/regress/pg_regress \
${lib.getDev postgresql}/lib/pgxs/src/test/regress/pg_regress \
--bindir='${postgresqlWithSelf}/bin' \
--temp-instance=regress-instance \
--dbname=contrib_regression \
Expand Down
8 changes: 4 additions & 4 deletions pkgs/servers/sql/postgresql/ext/tsja.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ stdenv.mkDerivation rec {

postPatch = ''
substituteInPlace Makefile \
--replace /usr/local/pgsql ${postgresql} \
--replace -L/usr/local/lib "" \
--replace -I/usr/local/include ""
substituteInPlace tsja.c --replace /usr/local/lib/mecab ${mecab}/lib/mecab
--replace-fail /usr/local/pgsql ${lib.getDev postgresql} \
--replace-fail -L/usr/local/lib "" \
--replace-fail -I/usr/local/include ""
substituteInPlace tsja.c --replace-fail /usr/local/lib/mecab ${mecab}/lib/mecab
'';

buildInputs = [ mecab postgresql ];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/backup/bacula/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ stdenv.mkDerivation rec {

configureFlags = [
"--with-sqlite3=${sqlite.dev}"
"--with-postgresql=${postgresql}"
"--with-postgresql=${lib.getDev postgresql}"
"--with-logdir=/var/log/bacula"
"--with-working-dir=/var/lib/bacula"
"--mandir=\${out}/share/man"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/networking/kea/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
"--localstatedir=/var"
"--with-openssl=${lib.getDev openssl}"
]
++ lib.optional withPostgres "--with-pgsql=${postgresql}/bin/pg_config"
++ lib.optional withPostgres "--with-pgsql=${lib.getDev postgresql}/bin/pg_config"
++ lib.optional withMysql "--with-mysql=${lib.getDev libmysqlclient}/bin/mysql_config";

postConfigure = ''
Expand Down
4 changes: 2 additions & 2 deletions pkgs/top-level/php-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ in {
{
name = "pdo_pgsql";
internalDeps = [ php.extensions.pdo ];
configureFlags = [ "--with-pdo-pgsql=${postgresql}" ];
configureFlags = [ "--with-pdo-pgsql=${lib.getDev postgresql}" ];
doCheck = false;
}
{
Expand All @@ -599,7 +599,7 @@ in {
{
name = "pgsql";
buildInputs = [ pcre2 ];
configureFlags = [ "--with-pgsql=${postgresql}" ];
configureFlags = [ "--with-pgsql=${lib.getDev postgresql}" ];
doCheck = false;
}
{ name = "posix"; doCheck = false; }
Expand Down

0 comments on commit 050689d

Please sign in to comment.