nixpkgs/pkgs/servers/sql/postgresql/default.nix

140 lines
4.2 KiB
Nix
Raw Normal View History

2018-07-27 07:19:05 +01:00
{ lib, stdenv, glibc, fetchurl, zlib, readline, libossp_uuid, openssl, libxml2, makeWrapper, tzdata }:
2015-07-28 20:37:27 +01:00
let
common = { version, sha256, psqlSchema }:
2016-11-22 21:48:18 +00:00
let atLeast = lib.versionAtLeast version; in stdenv.mkDerivation (rec {
2015-07-28 20:37:27 +01:00
name = "postgresql-${version}";
src = fetchurl {
url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
inherit sha256;
};
Revert "postgresql: Add dev output" Firstly this creates a cycle in 9.6 .out <-> .dev after fixing the PGXS path. Secondly this breaks extension handling and the pg_config as it resolves a lot of paths relatively resulting in the following bogus output: BINDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/bin DOCDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/doc HTMLDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/doc INCLUDEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include PKGINCLUDEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include INCLUDEDIR-SERVER = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include/server LIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib PKGLIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib LOCALEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/locale MANDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/man SHAREDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share SYSCONFDIR = /etc/postgresql PGXS = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--prefix=/nix/store/irqqq4g173g9xrk1mh12kxv0s1d8dbyh-postgresql-9.5.9' '--with-openssl' '--with-libxml' '--sysconfdir=/etc' '--libdir=/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib' '--with-ossp-uuid' 'CC=gcc' CC = gcc CPPFLAGS = -D_GNU_SOURCE -I/nix/store/z6r0j2b4bcdfw3pck2x6ay0vvx0qzb92-libxml2-2.9.5-dev/include/libxml2 CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 CFLAGS_SL = -fPIC LDFLAGS = -L../../../src/common -L/nix/store/ighspl5sa3qi1zy7nkih0c9p73xjfqa6-libxml2-2.9.5/lib -Wl,--as-needed -Wl,-rpath,'/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib',--enable-new-dtags LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lxml2 -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm VERSION = PostgreSQL 9.5.9 This can probably only be properly fixed by rewriting pg_config in large parts as it does not in any way respect splitting the postgres tree and assumes it can simply resolve paths relative to its location. This does not even handle symlinks: $ result-dev/bin/pg_config BINDIR = /home/robin/dev/nixpkgs-upstream/result-dev/bin DOCDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/doc HTMLDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/doc INCLUDEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/include PKGINCLUDEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/include INCLUDEDIR-SERVER = /home/robin/dev/nixpkgs-upstream/result-dev/include/server LIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib PKGLIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib LOCALEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/locale MANDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/man SHAREDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share SYSCONFDIR = /etc/postgresql PGXS = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--prefix=/nix/store/irqqq4g173g9xrk1mh12kxv0s1d8dbyh-postgresql-9.5.9' '--with-openssl' '--with-libxml' '--sysconfdir=/etc' '--libdir=/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib' '--with-ossp-uuid' 'CC=gcc' CC = gcc CPPFLAGS = -D_GNU_SOURCE -I/nix/store/z6r0j2b4bcdfw3pck2x6ay0vvx0qzb92-libxml2-2.9.5-dev/include/libxml2 CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 CFLAGS_SL = -fPIC LDFLAGS = -L../../../src/common -L/nix/store/ighspl5sa3qi1zy7nkih0c9p73xjfqa6-libxml2-2.9.5/lib -Wl,--as-needed -Wl,-rpath,'/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib',--enable-new-dtags LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lxml2 -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm VERSION = PostgreSQL 9.5.9 cc @edolstra Revert "bacula: fix after postgresql output splitting" This reverts commit 13c9cbacdded00558084fda7037ca80849208e99. Revert "postgresql: fix pgxs dir in pg_config" This reverts commit 21998d597bd257c1a769e2be4b7a52b5b7e482a6. Revert "rubyGems.pg: fix postgresql path" This reverts commit e253ae7d3a4ab992d2432c87514e3333a3cf744d. Revert "kea: fix path to pg_config" This reverts commit 086c636eb7f894a55f752b6164dac4a87d8bcee9. Revert "php: fix build wrt. new postgres.dev build output" This reverts commit 2f23a83920107678ca1792a11d19e1cb37df3ace. Revert "gdal: fix path to pg_config" This reverts commit 032c50d45b3fd1ebb4af592b83e776ed7004b4c0. Revert "postgresql: Add dev output" This reverts commit b0280f598e4b3f6ebf33ad2115734e4735df443a.
2017-09-27 20:48:39 +01:00
outputs = [ "out" "lib" "doc" "man" ];
setOutputFlags = false; # $out retains configureFlags :-/
2015-07-28 20:37:27 +01:00
buildInputs =
2018-07-27 07:19:05 +01:00
[ zlib readline openssl libxml2 makeWrapper ]
2015-07-28 20:37:27 +01:00
++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];
enableParallelBuilding = true;
makeFlags = [ "world" ];
NIX_CFLAGS_COMPILE = [ "-I${libxml2.dev}/include/libxml2" ];
# Otherwise it retains a reference to compiler and fails; see #44767. TODO: better.
preConfigure = "CC=${stdenv.cc.targetPrefix}cc";
configureFlags = [
"--with-openssl"
"--with-libxml"
"--sysconfdir=/etc"
"--libdir=$(lib)/lib"
"--with-system-tzdata=${tzdata}/share/zoneinfo"
2018-08-02 21:22:42 +01:00
(if stdenv.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid")
];
2015-07-28 20:37:27 +01:00
patches =
2016-11-22 21:48:18 +00:00
[ (if atLeast "9.4" then ./disable-resolve_symlinks-94.patch else ./disable-resolve_symlinks.patch)
(if atLeast "9.6" then ./less-is-more-96.patch else ./less-is-more.patch)
(if atLeast "9.6" then ./hardcode-pgxs-path-96.patch else ./hardcode-pgxs-path.patch)
./specify_pkglibdir_at_runtime.patch
2015-07-28 20:37:27 +01:00
];
installTargets = [ "install-world" ];
LC_ALL = "C";
postConfigure =
2016-11-22 21:48:18 +00:00
let path = if atLeast "9.6" then "src/common/config_info.c" else "src/bin/pg_config/pg_config.c"; in
''
# Hardcode the path to pgxs so pg_config returns the path in $out
Revert "postgresql: Add dev output" Firstly this creates a cycle in 9.6 .out <-> .dev after fixing the PGXS path. Secondly this breaks extension handling and the pg_config as it resolves a lot of paths relatively resulting in the following bogus output: BINDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/bin DOCDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/doc HTMLDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/doc INCLUDEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include PKGINCLUDEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include INCLUDEDIR-SERVER = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include/server LIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib PKGLIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib LOCALEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/locale MANDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/man SHAREDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share SYSCONFDIR = /etc/postgresql PGXS = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--prefix=/nix/store/irqqq4g173g9xrk1mh12kxv0s1d8dbyh-postgresql-9.5.9' '--with-openssl' '--with-libxml' '--sysconfdir=/etc' '--libdir=/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib' '--with-ossp-uuid' 'CC=gcc' CC = gcc CPPFLAGS = -D_GNU_SOURCE -I/nix/store/z6r0j2b4bcdfw3pck2x6ay0vvx0qzb92-libxml2-2.9.5-dev/include/libxml2 CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 CFLAGS_SL = -fPIC LDFLAGS = -L../../../src/common -L/nix/store/ighspl5sa3qi1zy7nkih0c9p73xjfqa6-libxml2-2.9.5/lib -Wl,--as-needed -Wl,-rpath,'/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib',--enable-new-dtags LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lxml2 -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm VERSION = PostgreSQL 9.5.9 This can probably only be properly fixed by rewriting pg_config in large parts as it does not in any way respect splitting the postgres tree and assumes it can simply resolve paths relative to its location. This does not even handle symlinks: $ result-dev/bin/pg_config BINDIR = /home/robin/dev/nixpkgs-upstream/result-dev/bin DOCDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/doc HTMLDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/doc INCLUDEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/include PKGINCLUDEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/include INCLUDEDIR-SERVER = /home/robin/dev/nixpkgs-upstream/result-dev/include/server LIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib PKGLIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib LOCALEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/locale MANDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/man SHAREDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share SYSCONFDIR = /etc/postgresql PGXS = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--prefix=/nix/store/irqqq4g173g9xrk1mh12kxv0s1d8dbyh-postgresql-9.5.9' '--with-openssl' '--with-libxml' '--sysconfdir=/etc' '--libdir=/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib' '--with-ossp-uuid' 'CC=gcc' CC = gcc CPPFLAGS = -D_GNU_SOURCE -I/nix/store/z6r0j2b4bcdfw3pck2x6ay0vvx0qzb92-libxml2-2.9.5-dev/include/libxml2 CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 CFLAGS_SL = -fPIC LDFLAGS = -L../../../src/common -L/nix/store/ighspl5sa3qi1zy7nkih0c9p73xjfqa6-libxml2-2.9.5/lib -Wl,--as-needed -Wl,-rpath,'/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib',--enable-new-dtags LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lxml2 -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm VERSION = PostgreSQL 9.5.9 cc @edolstra Revert "bacula: fix after postgresql output splitting" This reverts commit 13c9cbacdded00558084fda7037ca80849208e99. Revert "postgresql: fix pgxs dir in pg_config" This reverts commit 21998d597bd257c1a769e2be4b7a52b5b7e482a6. Revert "rubyGems.pg: fix postgresql path" This reverts commit e253ae7d3a4ab992d2432c87514e3333a3cf744d. Revert "kea: fix path to pg_config" This reverts commit 086c636eb7f894a55f752b6164dac4a87d8bcee9. Revert "php: fix build wrt. new postgres.dev build output" This reverts commit 2f23a83920107678ca1792a11d19e1cb37df3ace. Revert "gdal: fix path to pg_config" This reverts commit 032c50d45b3fd1ebb4af592b83e776ed7004b4c0. Revert "postgresql: Add dev output" This reverts commit b0280f598e4b3f6ebf33ad2115734e4735df443a.
2017-09-27 20:48:39 +01:00
substituteInPlace "${path}" --replace HARDCODED_PGXS_PATH $out/lib
2016-11-22 21:48:18 +00:00
'';
2015-07-28 20:37:27 +01:00
postInstall =
''
Revert "postgresql: Add dev output" Firstly this creates a cycle in 9.6 .out <-> .dev after fixing the PGXS path. Secondly this breaks extension handling and the pg_config as it resolves a lot of paths relatively resulting in the following bogus output: BINDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/bin DOCDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/doc HTMLDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/doc INCLUDEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include PKGINCLUDEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include INCLUDEDIR-SERVER = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include/server LIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib PKGLIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib LOCALEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/locale MANDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/man SHAREDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share SYSCONFDIR = /etc/postgresql PGXS = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--prefix=/nix/store/irqqq4g173g9xrk1mh12kxv0s1d8dbyh-postgresql-9.5.9' '--with-openssl' '--with-libxml' '--sysconfdir=/etc' '--libdir=/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib' '--with-ossp-uuid' 'CC=gcc' CC = gcc CPPFLAGS = -D_GNU_SOURCE -I/nix/store/z6r0j2b4bcdfw3pck2x6ay0vvx0qzb92-libxml2-2.9.5-dev/include/libxml2 CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 CFLAGS_SL = -fPIC LDFLAGS = -L../../../src/common -L/nix/store/ighspl5sa3qi1zy7nkih0c9p73xjfqa6-libxml2-2.9.5/lib -Wl,--as-needed -Wl,-rpath,'/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib',--enable-new-dtags LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lxml2 -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm VERSION = PostgreSQL 9.5.9 This can probably only be properly fixed by rewriting pg_config in large parts as it does not in any way respect splitting the postgres tree and assumes it can simply resolve paths relative to its location. This does not even handle symlinks: $ result-dev/bin/pg_config BINDIR = /home/robin/dev/nixpkgs-upstream/result-dev/bin DOCDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/doc HTMLDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/doc INCLUDEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/include PKGINCLUDEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/include INCLUDEDIR-SERVER = /home/robin/dev/nixpkgs-upstream/result-dev/include/server LIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib PKGLIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib LOCALEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/locale MANDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/man SHAREDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share SYSCONFDIR = /etc/postgresql PGXS = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--prefix=/nix/store/irqqq4g173g9xrk1mh12kxv0s1d8dbyh-postgresql-9.5.9' '--with-openssl' '--with-libxml' '--sysconfdir=/etc' '--libdir=/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib' '--with-ossp-uuid' 'CC=gcc' CC = gcc CPPFLAGS = -D_GNU_SOURCE -I/nix/store/z6r0j2b4bcdfw3pck2x6ay0vvx0qzb92-libxml2-2.9.5-dev/include/libxml2 CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 CFLAGS_SL = -fPIC LDFLAGS = -L../../../src/common -L/nix/store/ighspl5sa3qi1zy7nkih0c9p73xjfqa6-libxml2-2.9.5/lib -Wl,--as-needed -Wl,-rpath,'/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib',--enable-new-dtags LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lxml2 -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm VERSION = PostgreSQL 9.5.9 cc @edolstra Revert "bacula: fix after postgresql output splitting" This reverts commit 13c9cbacdded00558084fda7037ca80849208e99. Revert "postgresql: fix pgxs dir in pg_config" This reverts commit 21998d597bd257c1a769e2be4b7a52b5b7e482a6. Revert "rubyGems.pg: fix postgresql path" This reverts commit e253ae7d3a4ab992d2432c87514e3333a3cf744d. Revert "kea: fix path to pg_config" This reverts commit 086c636eb7f894a55f752b6164dac4a87d8bcee9. Revert "php: fix build wrt. new postgres.dev build output" This reverts commit 2f23a83920107678ca1792a11d19e1cb37df3ace. Revert "gdal: fix path to pg_config" This reverts commit 032c50d45b3fd1ebb4af592b83e776ed7004b4c0. Revert "postgresql: Add dev output" This reverts commit b0280f598e4b3f6ebf33ad2115734e4735df443a.
2017-09-27 20:48:39 +01:00
moveToOutput "lib/pgxs" "$out" # looks strange, but not deleting it
moveToOutput "lib/*.a" "$out"
moveToOutput "lib/libecpg*" "$out"
Revert "postgresql: Add dev output" Firstly this creates a cycle in 9.6 .out <-> .dev after fixing the PGXS path. Secondly this breaks extension handling and the pg_config as it resolves a lot of paths relatively resulting in the following bogus output: BINDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/bin DOCDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/doc HTMLDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/doc INCLUDEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include PKGINCLUDEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include INCLUDEDIR-SERVER = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/include/server LIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib PKGLIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib LOCALEDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/locale MANDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share/man SHAREDIR = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/share SYSCONFDIR = /etc/postgresql PGXS = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--prefix=/nix/store/irqqq4g173g9xrk1mh12kxv0s1d8dbyh-postgresql-9.5.9' '--with-openssl' '--with-libxml' '--sysconfdir=/etc' '--libdir=/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib' '--with-ossp-uuid' 'CC=gcc' CC = gcc CPPFLAGS = -D_GNU_SOURCE -I/nix/store/z6r0j2b4bcdfw3pck2x6ay0vvx0qzb92-libxml2-2.9.5-dev/include/libxml2 CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 CFLAGS_SL = -fPIC LDFLAGS = -L../../../src/common -L/nix/store/ighspl5sa3qi1zy7nkih0c9p73xjfqa6-libxml2-2.9.5/lib -Wl,--as-needed -Wl,-rpath,'/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib',--enable-new-dtags LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lxml2 -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm VERSION = PostgreSQL 9.5.9 This can probably only be properly fixed by rewriting pg_config in large parts as it does not in any way respect splitting the postgres tree and assumes it can simply resolve paths relative to its location. This does not even handle symlinks: $ result-dev/bin/pg_config BINDIR = /home/robin/dev/nixpkgs-upstream/result-dev/bin DOCDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/doc HTMLDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/doc INCLUDEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/include PKGINCLUDEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/include INCLUDEDIR-SERVER = /home/robin/dev/nixpkgs-upstream/result-dev/include/server LIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib PKGLIBDIR = /nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib LOCALEDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/locale MANDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share/man SHAREDIR = /home/robin/dev/nixpkgs-upstream/result-dev/share SYSCONFDIR = /etc/postgresql PGXS = /nix/store/csiq6zkn2c994kkdjln461jvgbka4yb1-postgresql-9.5.9-dev/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--prefix=/nix/store/irqqq4g173g9xrk1mh12kxv0s1d8dbyh-postgresql-9.5.9' '--with-openssl' '--with-libxml' '--sysconfdir=/etc' '--libdir=/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib' '--with-ossp-uuid' 'CC=gcc' CC = gcc CPPFLAGS = -D_GNU_SOURCE -I/nix/store/z6r0j2b4bcdfw3pck2x6ay0vvx0qzb92-libxml2-2.9.5-dev/include/libxml2 CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 CFLAGS_SL = -fPIC LDFLAGS = -L../../../src/common -L/nix/store/ighspl5sa3qi1zy7nkih0c9p73xjfqa6-libxml2-2.9.5/lib -Wl,--as-needed -Wl,-rpath,'/nix/store/85s9m7hpfzsl93wcb5gr6ii2km9mpx3z-postgresql-9.5.9-lib/lib',--enable-new-dtags LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lxml2 -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm VERSION = PostgreSQL 9.5.9 cc @edolstra Revert "bacula: fix after postgresql output splitting" This reverts commit 13c9cbacdded00558084fda7037ca80849208e99. Revert "postgresql: fix pgxs dir in pg_config" This reverts commit 21998d597bd257c1a769e2be4b7a52b5b7e482a6. Revert "rubyGems.pg: fix postgresql path" This reverts commit e253ae7d3a4ab992d2432c87514e3333a3cf744d. Revert "kea: fix path to pg_config" This reverts commit 086c636eb7f894a55f752b6164dac4a87d8bcee9. Revert "php: fix build wrt. new postgres.dev build output" This reverts commit 2f23a83920107678ca1792a11d19e1cb37df3ace. Revert "gdal: fix path to pg_config" This reverts commit 032c50d45b3fd1ebb4af592b83e776ed7004b4c0. Revert "postgresql: Add dev output" This reverts commit b0280f598e4b3f6ebf33ad2115734e4735df443a.
2017-09-27 20:48:39 +01:00
# Prevent a retained dependency on gcc-wrapper.
substituteInPlace "$out/lib/pgxs/src/Makefile.global" --replace ${stdenv.cc}/bin/ld ld
2018-01-11 14:19:46 +00:00
if [ -z "''${dontDisableStatic:-}" ]; then
# Remove static libraries in case dynamic are available.
for i in $out/lib/*.a; do
name="$(basename "$i")"
ext="${stdenv.hostPlatform.extensions.sharedLibrary}"
if [ -e "$lib/lib/''${name%.a}$ext" ] || [ -e "''${i%.a}$ext" ]; then
2018-01-11 14:19:46 +00:00
rm "$i"
fi
done
fi
2015-07-28 20:37:27 +01:00
'';
postFixup = lib.optionalString (!stdenv.isDarwin && stdenv.hostPlatform.libc == "glibc")
2016-11-22 21:48:18 +00:00
''
# initdb needs access to "locale" command from glibc.
wrapProgram $out/bin/initdb --prefix PATH ":" ${glibc.bin}/bin
'';
doInstallCheck = false; # needs a running daemon?
2015-07-28 20:37:27 +01:00
disallowedReferences = [ stdenv.cc ];
passthru = {
inherit readline psqlSchema;
};
meta = with lib; {
homepage = https://www.postgresql.org;
2015-07-28 20:37:27 +01:00
description = "A powerful, open source object-relational database system";
license = licenses.postgresql;
maintainers = with maintainers; [ ocharles thoughtpolice ];
platforms = platforms.unix;
2015-07-28 20:37:27 +01:00
};
});
in {
postgresql_9_3 = common {
version = "9.3.25";
2015-07-28 20:37:27 +01:00
psqlSchema = "9.3";
sha256 = "1nxn0hjrg4y5v5n2jgzrbicgv4504r2yfjyk6g6rq0sx8603x5g4";
2015-07-28 20:37:27 +01:00
};
postgresql_9_4 = common {
version = "9.4.20";
2015-07-28 20:37:27 +01:00
psqlSchema = "9.4";
sha256 = "0zzqjz5jrn624hzh04drpj6axh30a9k6bgawid6rwk45nbfxicgf";
2015-07-28 20:37:27 +01:00
};
postgresql_9_5 = common {
version = "9.5.15";
psqlSchema = "9.5";
sha256 = "0i2lylgmsmy2g1ixlvl112fryp7jmrd0i2brk8sxb7vzzpg3znnv";
};
postgresql_9_6 = common {
version = "9.6.11";
2016-11-22 21:48:18 +00:00
psqlSchema = "9.6";
sha256 = "0c55akrkzqd6p6a8hr0338wk246hl76r9j16p4zn3s51d7f0l99q";
2016-11-22 21:48:18 +00:00
};
postgresql_10 = common {
version = "10.6";
2017-10-06 23:50:44 +01:00
psqlSchema = "10.0";
sha256 = "0jv26y3f10svrjxzsgqxg956c86b664azyk2wppzpa5x11pjga38";
2017-10-06 23:50:44 +01:00
};
2018-10-18 14:52:29 +01:00
postgresql_11 = common {
version = "11.1";
2018-10-18 14:52:29 +01:00
psqlSchema = "11.0";
sha256 = "026v0sicsh7avzi45waf8shcbhivyxmi7qgn9fd1x0vl520mx0ch";
2018-10-18 14:52:29 +01:00
};
2015-07-28 20:37:27 +01:00
}