|
131 | 131 |
|
132 | 132 | installPhase = '' |
133 | 133 | runHook preInstall |
| 134 | + set -eo pipefail |
134 | 135 |
|
135 | 136 | mkdir -p $out/{lib,share/postgresql/extension} |
136 | 137 |
|
@@ -162,23 +163,30 @@ let |
162 | 163 | ''} |
163 | 164 | fi |
164 | 165 |
|
165 | | -
|
166 | 166 | # plv8 3.2.x removed support for coffeejs and livescript |
167 | | - if (builtins.compareVersions "3.1.10" version >= 0) then |
168 | | - EXTENSIONS="plv8 plcoffee plls" |
169 | | - else |
170 | | - EXTENSIONS="plv8" |
171 | | - fi |
172 | | -
|
173 | | - for ext in $EXTENSIONS; do |
| 167 | + EXTENSIONS=(${if (builtins.compareVersions "3.1.10" version >= 0) then "plv8 plcoffee plls" else "plv8"}) |
| 168 | + for ext in "''${EXTENSIONS[@]}" ; do |
174 | 169 | cp $ext--${version}.sql $out/share/postgresql/extension |
175 | 170 | install -Dm644 $ext.control $out/share/postgresql/extension/$ext--${version}.control |
176 | 171 | # Create versioned control file with modified module path |
177 | 172 | sed -e "/^default_version =/d" \ |
178 | | - -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ |
179 | | - ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control |
| 173 | + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}-${version}'|" \ |
| 174 | + $ext.control > $out/share/postgresql/extension/$ext--${version}.control |
180 | 175 | done |
181 | 176 |
|
| 177 | + # For the latest 3.1.x version, also create the default control file |
| 178 | + # for coffeejs and livescript extensions |
| 179 | + if [[ ${version} == "3.1.10" ]]; then |
| 180 | + for ext in "''${EXTENSIONS[@]}" ; do |
| 181 | + if [[ "$ext" != "plv8" ]]; then |
| 182 | + { |
| 183 | + echo "default_version = '${version}'" |
| 184 | + cat $out/share/postgresql/extension/$ext--${version}.control |
| 185 | + } > $out/share/postgresql/extension/$ext.control |
| 186 | + fi |
| 187 | + done |
| 188 | + fi |
| 189 | +
|
182 | 190 | # For the latest version, create default control file and symlink |
183 | 191 | if [[ "${version}" == "${latestVersion}" ]]; then |
184 | 192 | { |
|
0 commit comments