about summary refs log tree commit diff
path: root/pkgs/servers/sql/postgresql/patches/findstring.patch
blob: 959bf6a6caa4c1cb6a24133fedffd4f25dd399b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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