From 0770a49d8ca9f4639a394eb2bfd302b4d5ee981e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 28 Jul 2015 21:37:27 +0200 Subject: [PATCH] Unify the PostgreSQL expressions again --- pkgs/servers/sql/postgresql/9.0.x.nix | 38 ----------- pkgs/servers/sql/postgresql/9.1.x.nix | 45 ------------ pkgs/servers/sql/postgresql/9.2.x.nix | 42 ------------ pkgs/servers/sql/postgresql/9.3.x.nix | 46 ------------- pkgs/servers/sql/postgresql/9.4.x.nix | 55 --------------- pkgs/servers/sql/postgresql/default.nix | 91 +++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 15 ++-- 7 files changed, 97 insertions(+), 235 deletions(-) delete mode 100644 pkgs/servers/sql/postgresql/9.0.x.nix delete mode 100644 pkgs/servers/sql/postgresql/9.1.x.nix delete mode 100644 pkgs/servers/sql/postgresql/9.2.x.nix delete mode 100644 pkgs/servers/sql/postgresql/9.3.x.nix delete mode 100644 pkgs/servers/sql/postgresql/9.4.x.nix create mode 100644 pkgs/servers/sql/postgresql/default.nix diff --git a/pkgs/servers/sql/postgresql/9.0.x.nix b/pkgs/servers/sql/postgresql/9.0.x.nix deleted file mode 100644 index 7b4d7a2e617c..000000000000 --- a/pkgs/servers/sql/postgresql/9.0.x.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ stdenv, fetchurl, zlib, readline, openssl }: - -let version = "9.0.22"; in - -stdenv.mkDerivation rec { - name = "postgresql-${version}"; - - src = fetchurl { - url = "mirror://postgresql/source/v${version}/${name}.tar.bz2"; - sha256 = "19gq6axjhvlr5zlrzwnll1fbrvai4xh0nb1jki6gmmschl6v5m4l"; - }; - - outputs = [ "out" "doc" ]; - - buildInputs = [ zlib readline openssl ]; - - LC_ALL = "C"; - - configureFlags = [ "--with-openssl" ]; - - patches = [ ./less-is-more.patch ]; - - postInstall = ''mkdir -p $doc''; - - passthru = { - inherit readline; - psqlSchema = "9.0"; - }; - - meta = with stdenv.lib; { - homepage = http://www.postgresql.org/; - description = "A powerful, open source object-relational database system"; - license = licenses.postgresql; - maintainers = [ maintainers.ocharles ]; - platforms = platforms.unix; - hydraPlatforms = platforms.linux; - }; -} diff --git a/pkgs/servers/sql/postgresql/9.1.x.nix b/pkgs/servers/sql/postgresql/9.1.x.nix deleted file mode 100644 index df691c9152ac..000000000000 --- a/pkgs/servers/sql/postgresql/9.1.x.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ stdenv, fetchurl, zlib, readline, openssl }: - -let version = "9.1.18"; in - -stdenv.mkDerivation rec { - name = "postgresql-${version}"; - - src = fetchurl { - url = "mirror://postgresql/source/v${version}/${name}.tar.bz2"; - sha256 = "1a44hmcvfaa8j169ladsibmvjakw6maaxqkzz1ab8139cqkda9i7"; - }; - - outputs = [ "out" "doc" ]; - - buildInputs = [ zlib readline openssl ]; - - enableParallelBuilding = true; - - LC_ALL = "C"; - - configureFlags = [ "--with-openssl" ]; - - patches = [ ./less-is-more.patch ]; - - postInstall = - '' - mkdir -p $out/share/man - cp -rvd doc/src/sgml/man1 $out/share/man - mkdir -p $doc - ''; - - passthru = { - inherit readline; - psqlSchema = "9.1"; - }; - - meta = with stdenv.lib; { - homepage = http://www.postgresql.org/; - description = "A powerful, open source object-relational database system"; - license = licenses.postgresql; - maintainers = [ maintainers.ocharles ]; - platforms = platforms.unix; - hydraPlatforms = platforms.linux; - }; -} diff --git a/pkgs/servers/sql/postgresql/9.2.x.nix b/pkgs/servers/sql/postgresql/9.2.x.nix deleted file mode 100644 index 6b0792f50cd3..000000000000 --- a/pkgs/servers/sql/postgresql/9.2.x.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ stdenv, fetchurl, zlib, readline, openssl }: - -let version = "9.2.13"; in - -stdenv.mkDerivation rec { - name = "postgresql-${version}"; - - src = fetchurl { - url = "mirror://postgresql/source/v${version}/${name}.tar.bz2"; - sha256 = "0i3avdr8mnvn6ldkx0hc4jmclhisb2338hzs0j2m03wck8hddjsx"; - }; - - outputs = [ "out" "doc" ]; - - buildInputs = [ zlib readline openssl ]; - - enableParallelBuilding = true; - - makeFlags = [ "world" ]; - - configureFlags = stdenv.lib.optionals (!stdenv.isCygwin) [ "--with-openssl" ]; - - patches = [ ./disable-resolve_symlinks.patch ./less-is-more.patch ]; - - installTargets = [ "install-world" ]; - - LC_ALL = "C"; - - passthru = { - inherit readline; - psqlSchema = "9.2"; - }; - - meta = with stdenv.lib; { - homepage = http://www.postgresql.org/; - description = "A powerful, open source object-relational database system"; - license = licenses.postgresql; - maintainers = [ maintainers.ocharles ]; - platforms = platforms.unix; - hydraPlatforms = platforms.linux; - }; -} diff --git a/pkgs/servers/sql/postgresql/9.3.x.nix b/pkgs/servers/sql/postgresql/9.3.x.nix deleted file mode 100644 index d45cdadf1e9f..000000000000 --- a/pkgs/servers/sql/postgresql/9.3.x.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ stdenv, fetchurl, zlib, readline, libossp_uuid, openssl}: - -with stdenv.lib; - -let version = "9.3.9"; in - -stdenv.mkDerivation rec { - name = "postgresql-${version}"; - - src = fetchurl { - url = "mirror://postgresql/source/v${version}/${name}.tar.bz2"; - sha256 = "0j85j69rf54cwz5yhrhk4ca22b82990j5sqb8cr1fl9843nd0fzp"; - }; - - outputs = [ "out" "doc" ]; - - buildInputs = [ zlib readline openssl ] - ++ optionals (!stdenv.isDarwin) [ libossp_uuid ]; - - enableParallelBuilding = true; - - makeFlags = [ "world" ]; - - configureFlags = [ "--with-openssl" ] - ++ optional (!stdenv.isDarwin) "--with-ossp-uuid"; - - patches = [ ./disable-resolve_symlinks.patch ./less-is-more.patch ]; - - installTargets = [ "install-world" ]; - - LC_ALL = "C"; - - passthru = { - inherit readline; - psqlSchema = "9.3"; - }; - - meta = with stdenv.lib; { - homepage = http://www.postgresql.org/; - description = "A powerful, open source object-relational database system"; - license = licenses.postgresql; - maintainers = [ maintainers.ocharles ]; - platforms = platforms.unix; - hydraPlatforms = platforms.linux; - }; -} diff --git a/pkgs/servers/sql/postgresql/9.4.x.nix b/pkgs/servers/sql/postgresql/9.4.x.nix deleted file mode 100644 index 0309b9b54357..000000000000 --- a/pkgs/servers/sql/postgresql/9.4.x.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ stdenv, fetchurl, zlib, readline, libossp_uuid, openssl }: - -with stdenv.lib; - -let version = "9.4.4"; in - -stdenv.mkDerivation rec { - name = "postgresql-${version}"; - - src = fetchurl { - url = "mirror://postgresql/source/v${version}/${name}.tar.bz2"; - sha256 = "04q07g209y99xzjh88y52qpvz225rxwifv8nzp3bxzfni2bdk3jk"; - }; - - outputs = [ "out" "doc" ]; - - buildInputs = [ zlib readline openssl ] - ++ optionals (!stdenv.isDarwin) [ libossp_uuid ]; - - enableParallelBuilding = true; - - makeFlags = [ "world" ]; - - configureFlags = [ "--with-openssl" ] - ++ optional (stdenv.isDarwin) "--with-uuid=e2fs" - ++ optional (!stdenv.isDarwin) "--with-ossp-uuid"; - - patches = [ ./disable-resolve_symlinks-94.patch ./less-is-more.patch ]; - - installTargets = [ "install-world" ]; - - LC_ALL = "C"; - - postInstall = - '' - # Prevent a retained dependency on gcc-wrapper. - substituteInPlace $out/lib/pgxs/src/Makefile.global --replace ${stdenv.cc}/bin/ld ld - ''; - - disallowedReferences = [ stdenv.cc ]; - - passthru = { - inherit readline; - psqlSchema = "9.4"; - }; - - meta = with stdenv.lib; { - homepage = http://www.postgresql.org/; - description = "A powerful, open source object-relational database system"; - license = licenses.postgresql; - maintainers = [ maintainers.ocharles ]; - platforms = platforms.unix; - hydraPlatforms = platforms.linux; - }; -} diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix new file mode 100644 index 000000000000..cf4519a82327 --- /dev/null +++ b/pkgs/servers/sql/postgresql/default.nix @@ -0,0 +1,91 @@ +{ lib, stdenv, fetchurl, zlib, readline, libossp_uuid, openssl }: + +let + + common = { version, sha256, psqlSchema } @ args: stdenv.mkDerivation (rec { + name = "postgresql-${version}"; + + src = fetchurl { + url = "mirror://postgresql/source/v${version}/${name}.tar.bz2"; + inherit sha256; + }; + + outputs = [ "out" "doc" ]; + + buildInputs = + [ zlib readline openssl ] + ++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ]; + + enableParallelBuilding = true; + + makeFlags = [ "world" ]; + + configureFlags = + [ "--with-openssl" ] + ++ lib.optional (stdenv.isDarwin) "--with-uuid=e2fs" + ++ lib.optional (!stdenv.isDarwin) "--with-ossp-uuid"; + + patches = + [ (if lib.versionAtLeast version "9.4" then ./disable-resolve_symlinks-94.patch else ./disable-resolve_symlinks.patch) + ./less-is-more.patch + ]; + + installTargets = [ "install-world" ]; + + LC_ALL = "C"; + + postInstall = + '' + # Prevent a retained dependency on gcc-wrapper. + substituteInPlace $out/lib/pgxs/src/Makefile.global --replace ${stdenv.cc}/bin/ld ld + ''; + + disallowedReferences = [ stdenv.cc ]; + + passthru = { + inherit readline psqlSchema; + }; + + meta = with lib; { + homepage = http://www.postgresql.org/; + description = "A powerful, open source object-relational database system"; + license = licenses.postgresql; + maintainers = [ maintainers.ocharles ]; + platforms = platforms.unix; + hydraPlatforms = platforms.linux; + }; + }); + +in { + + postgresql90 = common { + version = "9.0.22"; + psqlSchema = "9.0"; + sha256 = "19gq6axjhvlr5zlrzwnll1fbrvai4xh0nb1jki6gmmschl6v5m4l"; + }; + + postgresql91 = common { + version = "9.1.18"; + psqlSchema = "9.1"; + sha256 = "1a44hmcvfaa8j169ladsibmvjakw6maaxqkzz1ab8139cqkda9i7"; + }; + + postgresql92 = common { + version = "9.2.13"; + psqlSchema = "9.2"; + sha256 = "0i3avdr8mnvn6ldkx0hc4jmclhisb2338hzs0j2m03wck8hddjsx"; + }; + + postgresql93 = common { + version = "9.3.9"; + psqlSchema = "9.3"; + sha256 = "0j85j69rf54cwz5yhrhk4ca22b82990j5sqb8cr1fl9843nd0fzp"; + }; + + postgresql94 = common { + version = "9.4.4"; + psqlSchema = "9.4"; + sha256 = "04q07g209y99xzjh88y52qpvz225rxwifv8nzp3bxzfni2bdk3jk"; + }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index db99800a8da4..1072b6f3b30d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9109,15 +9109,12 @@ let postgresql = postgresql94; - postgresql90 = callPackage ../servers/sql/postgresql/9.0.x.nix { }; - - postgresql91 = callPackage ../servers/sql/postgresql/9.1.x.nix { }; - - postgresql92 = callPackage ../servers/sql/postgresql/9.2.x.nix { }; - - postgresql93 = callPackage ../servers/sql/postgresql/9.3.x.nix { }; - - postgresql94 = callPackage ../servers/sql/postgresql/9.4.x.nix { }; + inherit (callPackages ../servers/sql/postgresql { }) + postgresql90 + postgresql91 + postgresql92 + postgresql93 + postgresql94; postgresql_jdbc = callPackage ../servers/sql/postgresql/jdbc { };