1From: Matthew Bauer <mjbauer95@gmail.com>
2Date: Wed, 29 May 2019 22:51:52 -0400
3Subject: [PATCH] Add /postgresql suffix for Nix outputs
4
5Nix outputs put the `name' in each store path like
6/nix/store/...-<name>. This was confusing the Postgres make script
7because it thought its data directory already had postgresql in its
8directory. This lead to Postgres installing all of its fils in
9$out/share. To fix this, we just look for postgres or psql in the part
10after the / using make's notdir.
11
12---
13From: Matthew Bauer <mjbauer95@gmail.com>
14Date: Wed, 29 May 2019 22:51:52 -0400
15Subject: [PATCH] Add /postgresql suffix for Nix outputs
16
17Nix outputs put the `name' in each store path like
18/nix/store/...-<name>. This was confusing the Postgres make script
19because it thought its data directory already had postgresql in its
20directory. This lead to Postgres installing all of its fils in
21$out/share. To fix this, we just look for postgres or psql in the part
22after the / using make's notdir.
23
24---
25diff --git a/src/Makefile.global.in b/src/Makefile.global.in
26index b9d86acaa9..bce05464c3 100644
27--- a/src/Makefile.global.in
28+++ b/src/Makefile.global.in
29@@ -102,15 +102,15 @@ datarootdir := @datarootdir@
30 bindir := @bindir@
31
32 datadir := @datadir@
33-ifeq "$(findstring pgsql, $(datadir))" ""
34-ifeq "$(findstring postgres, $(datadir))" ""
35+ifeq "$(findstring pgsql, $(notdir $(datadir)))" ""
36+ifeq "$(findstring postgres, $(notdir $(datadir)))" ""
37 override datadir := $(datadir)/postgresql
38 endif
39 endif
40
41 sysconfdir := @sysconfdir@
42-ifeq "$(findstring pgsql, $(sysconfdir))" ""
43-ifeq "$(findstring postgres, $(sysconfdir))" ""
44+ifeq "$(findstring pgsql, $(notdir $(sysconfdir)))" ""
45+ifeq "$(findstring postgres, $(notdir $(sysconfdir)))" ""
46 override sysconfdir := $(sysconfdir)/postgresql
47 endif
48 endif
49@@ -136,8 +136,8 @@ endif
50 mandir := @mandir@
51
52 docdir := @docdir@
53-ifeq "$(findstring pgsql, $(docdir))" ""
54-ifeq "$(findstring postgres, $(docdir))" ""
55+ifeq "$(findstring pgsql, $(notdir $(docdir)))" ""
56+ifeq "$(findstring postgres, $(notdir $(docdir)))" ""
57 override docdir := $(docdir)/postgresql
58 endif
59 endif