diff --git a/doc/languages-frameworks/ruby.section.md b/doc/languages-frameworks/ruby.section.md index c5cc122394f5e..31f696bd6427d 100644 --- a/doc/languages-frameworks/ruby.section.md +++ b/doc/languages-frameworks/ruby.section.md @@ -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" ]; }; }; }; @@ -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" ]; }; }; }; @@ -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" ]; }; }; diff --git a/pkgs/applications/misc/pgmodeler/default.nix b/pkgs/applications/misc/pgmodeler/default.nix index c3b5491387cd4..f97827eccafaa 100644 --- a/pkgs/applications/misc/pgmodeler/default.nix +++ b/pkgs/applications/misc/pgmodeler/default.nix @@ -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" diff --git a/pkgs/applications/networking/misc/zammad/default.nix b/pkgs/applications/networking/misc/zammad/default.nix index 065749554ea10..4a37b4737c610 100644 --- a/pkgs/applications/networking/misc/zammad/default.nix +++ b/pkgs/applications/networking/misc/zammad/default.nix @@ -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 ]; diff --git a/pkgs/development/compilers/urweb/default.nix b/pkgs/development/compilers/urweb/default.nix index 2621f4bc8050f..f96cce8c53f1b 100644 --- a/pkgs/development/compilers/urweb/default.nix +++ b/pkgs/development/compilers/urweb/default.nix @@ -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"; diff --git a/pkgs/development/libraries/libdbi-drivers/default.nix b/pkgs/development/libraries/libdbi-drivers/default.nix index bbd9e3898d912..6537e3ae2a3e8 100644 --- a/pkgs/development/libraries/libdbi-drivers/default.nix +++ b/pkgs/development/libraries/libdbi-drivers/default.nix @@ -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 [ diff --git a/pkgs/development/libraries/opendbx/default.nix b/pkgs/development/libraries/opendbx/default.nix index 04ffde29daa02..9fbb8356679cb 100644 --- a/pkgs/development/libraries/opendbx/default.nix +++ b/pkgs/development/libraries/opendbx/default.nix @@ -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") ''; diff --git a/pkgs/development/python-modules/psycopg/default.nix b/pkgs/development/python-modules/psycopg/default.nix index 7d1f8c54f3d04..b1b69bc3526a2 100644 --- a/pkgs/development/python-modules/psycopg/default.nix +++ b/pkgs/development/python-modules/psycopg/default.nix @@ -74,11 +74,16 @@ let nativeBuildInputs = [ cython + # needed to find pg_config with strictDeps postgresql setuptools tomli ]; + buildInputs = [ + postgresql + ]; + # tested in psycopg doCheck = false; diff --git a/pkgs/development/python-modules/psycopg2/default.nix b/pkgs/development/python-modules/psycopg2/default.nix index ec958d7525c94..c8959b948fd72 100644 --- a/pkgs/development/python-modules/psycopg2/default.nix +++ b/pkgs/development/python-modules/psycopg2/default.nix @@ -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 = [ diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix index a541a8ee34bde..eb55255191cf3 100644 --- a/pkgs/development/ruby-modules/gem-config/default.nix +++ b/pkgs/development/ruby-modules/gem-config/default.nix @@ -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 ]; diff --git a/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix b/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix index ab4343462f261..3d41c35ffd363 100644 --- a/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix +++ b/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix @@ -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. @@ -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" diff --git a/pkgs/servers/mail/exim/default.nix b/pkgs/servers/mail/exim/default.nix index 26967b333eb94..bf593354da92f 100644 --- a/pkgs/servers/mail/exim/default.nix +++ b/pkgs/servers/mail/exim/default.nix @@ -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: diff --git a/pkgs/servers/sql/postgresql/ext/age.nix b/pkgs/servers/sql/postgresql/ext/age.nix index 2c68d6dcbbad9..b80d1c203b2c6 100644 --- a/pkgs/servers/sql/postgresql/ext/age.nix +++ b/pkgs/servers/sql/postgresql/ext/age.nix @@ -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 \ diff --git a/pkgs/servers/sql/postgresql/ext/plv8/default.nix b/pkgs/servers/sql/postgresql/ext/plv8/default.nix index af1cee81fa788..e0dbc19e353fa 100644 --- a/pkgs/servers/sql/postgresql/ext/plv8/default.nix +++ b/pkgs/servers/sql/postgresql/ext/plv8/default.nix @@ -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 \ diff --git a/pkgs/servers/sql/postgresql/ext/tsja.nix b/pkgs/servers/sql/postgresql/ext/tsja.nix index f62eae5b6a3e2..f0b9238f59ef2 100644 --- a/pkgs/servers/sql/postgresql/ext/tsja.nix +++ b/pkgs/servers/sql/postgresql/ext/tsja.nix @@ -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 ]; diff --git a/pkgs/tools/backup/bacula/default.nix b/pkgs/tools/backup/bacula/default.nix index f8ec672710f5b..386775960a73d 100644 --- a/pkgs/tools/backup/bacula/default.nix +++ b/pkgs/tools/backup/bacula/default.nix @@ -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" diff --git a/pkgs/tools/networking/kea/default.nix b/pkgs/tools/networking/kea/default.nix index a4831b6ef0ef6..ac068c39591bd 100644 --- a/pkgs/tools/networking/kea/default.nix +++ b/pkgs/tools/networking/kea/default.nix @@ -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 = '' diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index e85ae6dea40ab..f2398b0502c05 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -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; } { @@ -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; }