summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/sql/postgresql/default.nix65
-rw-r--r--pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks-94.patch12
-rw-r--r--pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks.patch12
-rw-r--r--pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path-96.patch14
-rw-r--r--pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path.patch27
-rw-r--r--pkgs/servers/sql/postgresql/patches/less-is-more-96.patch12
-rw-r--r--pkgs/servers/sql/postgresql/patches/less-is-more.patch10
7 files changed, 57 insertions, 95 deletions
diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix
index 975f486629ad0..1da94ceebd7d6 100644
--- a/pkgs/servers/sql/postgresql/default.nix
+++ b/pkgs/servers/sql/postgresql/default.nix
@@ -7,7 +7,7 @@ let
       , pkg-config, libxml2, tzdata, libkrb5
 
       # This is important to obtain a version of `libpq` that does not depend on systemd.
-      , enableSystemd ? (lib.versionAtLeast version "9.6" && !stdenv.isDarwin && !stdenv.hostPlatform.isStatic)
+      , enableSystemd ? !stdenv.isDarwin && !stdenv.hostPlatform.isStatic
       , gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic
 
       # for postgresql.pkgs
@@ -37,14 +37,22 @@ let
     outputs = [ "out" "lib" "doc" "man" ];
     setOutputFlags = false; # $out retains configureFlags :-/
 
-    buildInputs =
-      [ zlib readline openssl libxml2 icu ]
+    buildInputs = [
+      zlib
+      readline
+      openssl
+      libxml2
+      icu
+    ]
       ++ lib.optionals lz4Enabled [ lz4 ]
       ++ lib.optionals enableSystemd [ systemd ]
       ++ lib.optionals gssSupport [ libkrb5 ]
       ++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];
 
-    nativeBuildInputs = [ makeWrapper pkg-config ];
+    nativeBuildInputs = [
+      makeWrapper
+      pkg-config
+    ];
 
     enableParallelBuilding = !stdenv.isDarwin;
 
@@ -71,25 +79,24 @@ let
       ++ lib.optionals gssSupport [ "--with-gssapi" ]
       ++ lib.optionals stdenv.hostPlatform.isRiscV [ "--disable-spinlocks" ];
 
-    patches =
-      [ (if atLeast "9.4" then ./patches/disable-resolve_symlinks-94.patch else ./patches/disable-resolve_symlinks.patch)
-        (if atLeast "9.6" then ./patches/less-is-more-96.patch             else ./patches/less-is-more.patch)
-        (if atLeast "9.6" then ./patches/hardcode-pgxs-path-96.patch       else ./patches/hardcode-pgxs-path.patch)
-        ./patches/specify_pkglibdir_at_runtime.patch
-        ./patches/findstring.patch
-      ]
-      ++ lib.optional stdenv.isLinux (if atLeast "13" then ./patches/socketdir-in-run-13.patch else ./patches/socketdir-in-run.patch);
+    patches = [
+      ./patches/disable-resolve_symlinks.patch
+      ./patches/less-is-more.patch
+      ./patches/hardcode-pgxs-path.patch
+      ./patches/specify_pkglibdir_at_runtime.patch
+      ./patches/findstring.patch
+    ] ++ lib.optionals stdenv.isLinux [
+      (if atLeast "13" then ./patches/socketdir-in-run-13.patch else ./patches/socketdir-in-run.patch)
+    ];
 
     installTargets = [ "install-world" ];
 
     LC_ALL = "C";
 
-    postConfigure =
-      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
-          substituteInPlace "${path}" --replace HARDCODED_PGXS_PATH $out/lib
-        '';
+    postPatch = ''
+      # Hardcode the path to pgxs so pg_config returns the path in $out
+      substituteInPlace "src/common/config_info.c" --replace HARDCODED_PGXS_PATH "$out/lib"
+    '';
 
     postInstall =
       ''
@@ -162,8 +169,6 @@ let
       license     = licenses.postgresql;
       maintainers = with maintainers; [ thoughtpolice danbst globin marsam ivan ];
       platforms   = platforms.unix;
-      knownVulnerabilities = optional (!atLeast "9.4")
-        "PostgreSQL versions older than 9.4 are not maintained anymore!";
     };
   };
 
@@ -199,45 +204,45 @@ let
 in self: {
 
   postgresql_11 = self.callPackage generic {
-    version = "11.17";
+    version = "11.18";
     psqlSchema = "11.1"; # should be 11, but changing it is invasive
-    hash = "sha256-bphJY64HZeYVd5lRA6fmWU2w8L0BUorBI+DeSmpMtMQ=";
+    hash = "sha256-0k8g78UukYrPvMoh6c6ijg4mO4RqDECPz6w7PEoPdQQ=";
     this = self.postgresql_11;
     thisAttr = "postgresql_11";
     inherit self;
   };
 
   postgresql_12 = self.callPackage generic {
-    version = "12.12";
+    version = "12.13";
     psqlSchema = "12";
-    hash = "sha256-NLPxxpQI4iBowMcbGCdpHxyJFTsK1XbBpE+JIKhYA5w=";
+    hash = "sha256-tsYjBGr0VI8RqEtAeTTWddEe0HDHk9FbBGg79fMi4C0=";
     this = self.postgresql_12;
     thisAttr = "postgresql_12";
     inherit self;
   };
 
   postgresql_13 = self.callPackage generic {
-    version = "13.8";
+    version = "13.9";
     psqlSchema = "13";
-    hash = "sha256-c4dv3TpRcIc0BFjcpM4VuNKk286zNMBEFCRVGubEze0=";
+    hash = "sha256-7xlmwKXkn77TNwrSgkkoy2sRZGF67q4WBtooP38zpBU=";
     this = self.postgresql_13;
     thisAttr = "postgresql_13";
     inherit self;
   };
 
   postgresql_14 = self.callPackage generic {
-    version = "14.5";
+    version = "14.6";
     psqlSchema = "14";
-    hash = "sha256-1PcstfuFfJqfdeyM8JGhdxJygC8hePCy5lt7b/ZPSjA=";
+    hash = "sha256-UIhA/BgJ05q3InTV8Tfau5/X+0+TPaQWiu67IAae3yI=";
     this = self.postgresql_14;
     thisAttr = "postgresql_14";
     inherit self;
   };
 
   postgresql_15 = self.callPackage generic {
-    version = "15.0";
+    version = "15.1";
     psqlSchema = "15";
-    hash = "sha256-cux09KfBbmhPQ+pC4hVJf81MVdAopo+3LpnmH/QNpNY=";
+    hash = "sha256-ZP3yPXNK+tDf5Ad9rKlqxR3NaX5ori09TKbEXLFOIa4=";
     this = self.postgresql_15;
     thisAttr = "postgresql_15";
     inherit self;
diff --git a/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks-94.patch b/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks-94.patch
deleted file mode 100644
index fadeea90ac4b6..0000000000000
--- a/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks-94.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/src/common/exec.c	2014-09-04 20:19:12.236057588 +0200
-+++ b/src/common/exec.c	2014-09-04 20:19:50.550251633 +0200
-@@ -218,6 +218,9 @@
- static int
- resolve_symlinks(char *path)
- {
-+	// On NixOS we *want* stuff relative to symlinks.
-+	return 0;
-+
- #ifdef HAVE_READLINK
- 	struct stat buf;
- 	char		orig_wd[MAXPGPATH],
diff --git a/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks.patch b/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks.patch
index 3e6fd5e838a24..fadeea90ac4b6 100644
--- a/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks.patch
+++ b/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks.patch
@@ -1,13 +1,11 @@
-diff --git a/src/port/exec.c b/src/port/exec.c
-index c79e8ba..42c4091 100644
---- a/src/port/exec.c
-+++ b/src/port/exec.c
-@@ -216,6 +216,9 @@ find_my_exec(const char *argv0, char *retpath)
+--- a/src/common/exec.c	2014-09-04 20:19:12.236057588 +0200
++++ b/src/common/exec.c	2014-09-04 20:19:50.550251633 +0200
+@@ -218,6 +218,9 @@
  static int
  resolve_symlinks(char *path)
  {
-+    // On NixOS we *want* stuff relative to symlinks.
-+    return 0;
++	// On NixOS we *want* stuff relative to symlinks.
++	return 0;
 +
  #ifdef HAVE_READLINK
  	struct stat buf;
diff --git a/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path-96.patch b/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path-96.patch
deleted file mode 100644
index 6cd449769baac..0000000000000
--- a/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path-96.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -Naur postgresql-9.6.1-orig/src/common/config_info.c postgresql-9.6.1/src/common/config_info.c
---- postgresql-9.6.1-orig/src/common/config_info.c	2016-11-22 21:39:29.231929261 +0100
-+++ postgresql-9.6.1/src/common/config_info.c	2016-11-22 23:36:53.685163543 +0100
-@@ -118,7 +118,10 @@
- 	i++;
-
- 	configdata[i].name = pstrdup("PGXS");
-+	strlcpy(path, "HARDCODED_PGXS_PATH", sizeof(path));
-+/* commented out to be able to point to nix $out path
- 	get_pkglib_path(my_exec_path, path);
-+*/
- 	strlcat(path, "/pgxs/src/makefiles/pgxs.mk", sizeof(path));
- 	cleanup_path(path);
- 	configdata[i].setting = pstrdup(path);
diff --git a/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path.patch b/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path.patch
index 355813ffe20e2..6cd449769baac 100644
--- a/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path.patch
+++ b/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path.patch
@@ -1,17 +1,14 @@
---- a/src/bin/pg_config/pg_config.c
-+++ b/src/bin/pg_config/pg_config.c
-@@ -220,11 +220,13 @@ show_sysconfdir(bool all)
- static void
- show_pgxs(bool all)
- {
--	char		path[MAXPGPATH];
-+	char		path[MAXPGPATH] = "HARDCODED_PGXS_PATH";
- 
- 	if (all)
- 		printf("PGXS = ");
-+  /* commented out to be able to point to nix $out path
- 	get_pkglib_path(mypath, path);
-+  */
+diff -Naur postgresql-9.6.1-orig/src/common/config_info.c postgresql-9.6.1/src/common/config_info.c
+--- postgresql-9.6.1-orig/src/common/config_info.c	2016-11-22 21:39:29.231929261 +0100
++++ postgresql-9.6.1/src/common/config_info.c	2016-11-22 23:36:53.685163543 +0100
+@@ -118,7 +118,10 @@
+ 	i++;
+
+ 	configdata[i].name = pstrdup("PGXS");
++	strlcpy(path, "HARDCODED_PGXS_PATH", sizeof(path));
++/* commented out to be able to point to nix $out path
+ 	get_pkglib_path(my_exec_path, path);
++*/
  	strlcat(path, "/pgxs/src/makefiles/pgxs.mk", sizeof(path));
  	cleanup_path(path);
- 	printf("%s\n", path);
+ 	configdata[i].setting = pstrdup(path);
diff --git a/pkgs/servers/sql/postgresql/patches/less-is-more-96.patch b/pkgs/servers/sql/postgresql/patches/less-is-more-96.patch
deleted file mode 100644
index f14af9dc22073..0000000000000
--- a/pkgs/servers/sql/postgresql/patches/less-is-more-96.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur postgresql-9.6.1-orig/src/include/fe_utils/print.h postgresql-9.6.1/src/include/fe_utils/print.h
---- postgresql-9.6.1-orig/src/include/fe_utils/print.h	2016-11-22 21:39:29.148932827 +0100
-+++ postgresql-9.6.1/src/include/fe_utils/print.h	2016-11-22 21:39:36.283626258 +0100
-@@ -18,7 +18,7 @@
- 
- /* This is not a particularly great place for this ... */
- #ifndef __CYGWIN__
--#define DEFAULT_PAGER "more"
-+#define DEFAULT_PAGER "less"
- #else
- #define DEFAULT_PAGER "less"
- #endif
diff --git a/pkgs/servers/sql/postgresql/patches/less-is-more.patch b/pkgs/servers/sql/postgresql/patches/less-is-more.patch
index d640d24bdaad6..f14af9dc22073 100644
--- a/pkgs/servers/sql/postgresql/patches/less-is-more.patch
+++ b/pkgs/servers/sql/postgresql/patches/less-is-more.patch
@@ -1,9 +1,9 @@
-diff -Naur postgresql-9.2.7-orig/src/bin/psql/print.h postgresql-9.2.7/src/bin/psql/print.h
---- postgresql-9.2.7-orig/src/bin/psql/print.h	2014-02-17 14:38:15.000000000 -0500
-+++ postgresql-9.2.7/src/bin/psql/print.h	2014-03-04 14:42:28.874014415 -0500
-@@ -178,7 +178,7 @@
- extern const printTextFormat *get_line_style(const printTableOpt *opt);
+diff -Naur postgresql-9.6.1-orig/src/include/fe_utils/print.h postgresql-9.6.1/src/include/fe_utils/print.h
+--- postgresql-9.6.1-orig/src/include/fe_utils/print.h	2016-11-22 21:39:29.148932827 +0100
++++ postgresql-9.6.1/src/include/fe_utils/print.h	2016-11-22 21:39:36.283626258 +0100
+@@ -18,7 +18,7 @@
  
+ /* This is not a particularly great place for this ... */
  #ifndef __CYGWIN__
 -#define DEFAULT_PAGER "more"
 +#define DEFAULT_PAGER "less"