Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 01390dcef27c
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f5e7e1c24b02
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on May 31, 2019

  1. Copy the full SHA
    376bb51 View commit details

Commits on Jun 1, 2019

  1. Merge pull request #62271 from matthewbauer/cleanup-after-postgresql

    postgresql: install in $out/share/postgresql
    matthewbauer authored Jun 1, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f5e7e1c View commit details
Showing with 61 additions and 1 deletion.
  1. +2 −1 pkgs/servers/sql/postgresql/default.nix
  2. +59 −0 pkgs/servers/sql/postgresql/patches/findstring.patch
3 changes: 2 additions & 1 deletion pkgs/servers/sql/postgresql/default.nix
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ let

enableParallelBuilding = !stdenv.isDarwin;

makeFlags = [ "world" ];
buildFlags = [ "world" ];

NIX_CFLAGS_COMPILE = [ "-I${libxml2.dev}/include/libxml2" ];

@@ -60,6 +60,7 @@ let
(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 ./patches/socketdir-in-run.patch;

installTargets = [ "install-world" ];
59 changes: 59 additions & 0 deletions pkgs/servers/sql/postgresql/patches/findstring.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
From: Matthew Bauer <mjbauer95@gmail.com>
Date: Wed, 29 May 2019 22:51:52 -0400
Subject: [PATCH] Add /postgresql suffix for Nix outputs

Nix outputs put the `name' in each store path like
/nix/store/...-<name>. This was confusing the Postgres make script
because it thought its data directory already had postgresql in its
directory. This lead to Postgres installing all of its fils in
$out/share. To fix this, we just look for postgres or psql in the part
after the / using make's notdir.

---
From: Matthew Bauer <mjbauer95@gmail.com>
Date: Wed, 29 May 2019 22:51:52 -0400
Subject: [PATCH] Add /postgresql suffix for Nix outputs

Nix outputs put the `name' in each store path like
/nix/store/...-<name>. This was confusing the Postgres make script
because it thought its data directory already had postgresql in its
directory. This lead to Postgres installing all of its fils in
$out/share. To fix this, we just look for postgres or psql in the part
after the / using make's notdir.

---
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index b9d86acaa9..bce05464c3 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -102,15 +102,15 @@ datarootdir := @datarootdir@
bindir := @bindir@

datadir := @datadir@
-ifeq "$(findstring pgsql, $(datadir))" ""
-ifeq "$(findstring postgres, $(datadir))" ""
+ifeq "$(findstring pgsql, $(notdir $(datadir)))" ""
+ifeq "$(findstring postgres, $(notdir $(datadir)))" ""
override datadir := $(datadir)/postgresql
endif
endif

sysconfdir := @sysconfdir@
-ifeq "$(findstring pgsql, $(sysconfdir))" ""
-ifeq "$(findstring postgres, $(sysconfdir))" ""
+ifeq "$(findstring pgsql, $(notdir $(sysconfdir)))" ""
+ifeq "$(findstring postgres, $(notdir $(sysconfdir)))" ""
override sysconfdir := $(sysconfdir)/postgresql
endif
endif
@@ -136,8 +136,8 @@ endif
mandir := @mandir@

docdir := @docdir@
-ifeq "$(findstring pgsql, $(docdir))" ""
-ifeq "$(findstring postgres, $(docdir))" ""
+ifeq "$(findstring pgsql, $(notdir $(docdir)))" ""
+ifeq "$(findstring postgres, $(notdir $(docdir)))" ""
override docdir := $(docdir)/postgresql
endif
endif