@@ -35,11 +35,6 @@ stdenv.mkDerivation rec {
35
35
nativeBuildInputs = [ perl pkg-config ] ;
36
36
dontDisableStatic = true ;
37
37
38
- # Copy our SQL file into the source
39
- postUnpack = ''
40
- cp ${ ./tiger_search_path.sql } $sourceRoot/tiger_search_path.sql
41
- '' ;
42
-
43
38
env . NIX_LDFLAGS = "-L${ lib . getLib json_c } /lib" ;
44
39
45
40
preConfigure = ''
@@ -63,25 +58,17 @@ stdenv.mkDerivation rec {
63
58
64
59
postInstall = ''
65
60
rm $out/bin/postgres
66
-
67
61
for prog in $out/bin/*; do # */
68
62
ln -s $prog $prog-${ version }
69
63
done
70
-
71
- # Add AddToSearchPath function to tiger_geocoder files
64
+ # Add function definition and usage to tiger geocoder files
72
65
for file in $out/share/postgresql/extension/postgis_tiger_geocoder*--${ version } .sql; do
73
- # Insert the function near the start of the file
74
- sed -i '/Copyright (C) 2010, 2011-2015 Regina Obe and Leo Hsu/r tiger_search_path.sql' "$file"
75
-
76
- # Add the call to AddToSearchPath just before the install_geocode_settings function
77
- #sed -i '/CREATE FUNCTION install_geocode_settings()/i SELECT tiger.AddToSearchPath('"'"'extensions'"'"');' "$file"
66
+ sed -i '/SELECT postgis_extension_AddToSearchPath('tiger');/a SELECT postgis_extension_AddToSearchPath('extensions');' "$file"
78
67
done
79
-
80
68
# Original topology patching
81
69
for file in $out/share/postgresql/extension/postgis_topology*--${ version } .sql; do
82
70
sed -i "/SELECT topology.AddToSearchPath('topology');/i SELECT topology.AddToSearchPath('extensions');" "$file"
83
71
done
84
-
85
72
mkdir -p $doc/share/doc/postgis
86
73
mv doc/* $doc/share/doc/postgis/
87
74
'' ;
0 commit comments