|
116 | 116 | ./nix/ext/pg_cron.nix |
117 | 117 | ./nix/ext/pgsql-http.nix |
118 | 118 | ./nix/ext/pg_plan_filter.nix |
119 | | - ./nix/ext/pg_net.nix |
| 119 | + #./nix/ext/pg_net.nix |
120 | 120 | ./nix/ext/pg_hashids.nix |
121 | 121 | ./nix/ext/pgsodium.nix |
122 | 122 | ./nix/ext/pg_graphql.nix |
|
141 | 141 | x != ./nix/ext/pgvector.nix && |
142 | 142 | x != ./nix/ext/plv8.nix && |
143 | 143 | x != ./nix/ext/postgis.nix && |
144 | | - x != ./nix/ext/pgrouting.nix |
| 144 | + x != ./nix/ext/pgrouting.nix && |
| 145 | + x != ./nix/ext/pg_net.nix |
145 | 146 | ) ourExtensions; |
146 | 147 |
|
147 | 148 | orioledbExtension = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ]; |
148 | 149 |
|
149 | 150 | #this var is a convenience setting to import the orioledb patched version of postgresql |
150 | | - postgresql_orioledb_16 = oriole_pkgs.postgresql_orioledb_16; |
| 151 | + postgresql_orioledb_16 = oriole_pkgs.postgresql_orioledb; |
151 | 152 | #postgis_override = pkgs.postgis_override; |
152 | 153 | getPostgresqlPackage = version: |
153 | 154 | pkgs.postgresql."postgresql_${version}"; |
|
242 | 243 | paths = [ pgbin (makeReceipt pgbin upstreamExts ourExts) ]; |
243 | 244 | }; |
244 | 245 |
|
245 | | - makeOrioleDbPostgresBin = version: patchedPostgres: |
246 | | - let |
247 | | - postgresql = patchedPostgres; |
248 | | - upstreamExts = map |
249 | | - (ext: { |
250 | | - name = postgresql.pkgs."${ext}".pname; |
251 | | - version = postgresql.pkgs."${ext}".version; |
252 | | - }) |
253 | | - orioledbPsqlExtensions; |
254 | | - ourExts = map (ext: { name = ext.pname; version = ext.version; }) (makeOurOrioleDbPostgresPkgs version postgresql); |
255 | | - |
256 | | - pgbin = postgresql.withPackages (ps: |
257 | | - (map (ext: ps."${ext}") orioledbPsqlExtensions) ++ (makeOurOrioleDbPostgresPkgs version postgresql) |
258 | | - ); |
259 | | - in |
260 | | - pkgs.symlinkJoin { |
261 | | - inherit (pgbin) name version; |
262 | | - paths = [ pgbin (makeReceipt pgbin upstreamExts ourExts) ]; |
263 | | - }; |
264 | | - |
| 246 | + # makeOrioleDbPostgresBin = version: patchedPostgres: |
| 247 | + # let |
| 248 | + # postgresql = patchedPostgres; |
| 249 | + # upstreamExts = map |
| 250 | + # (ext: { |
| 251 | + # name = postgresql.pkgs."${ext}".pname; |
| 252 | + # version = postgresql.pkgs."${ext}".version; |
| 253 | + # }) |
| 254 | + # orioledbPsqlExtensions; |
| 255 | + # ourExts = map (ext: { name = ext.pname; version = ext.version; }) (makeOurOrioleDbPostgresPkgs version postgresql); |
| 256 | + |
| 257 | + # pgbin = postgresql.withPackages (ps: |
| 258 | + # (map (ext: ps."${ext}") orioledbPsqlExtensions) ++ (makeOurOrioleDbPostgresPkgs version postgresql) |
| 259 | + # ); |
| 260 | + # in |
| 261 | + # pkgs.symlinkJoin { |
| 262 | + # inherit (pgbin) name version; |
| 263 | + # paths = [ pgbin (makeReceipt pgbin upstreamExts ourExts) ]; |
| 264 | + # }; |
| 265 | +makeOrioleDbPostgresBin = version: patchedPostgres: |
| 266 | + let |
| 267 | + postgresql = patchedPostgres; |
| 268 | + upstreamExts = map |
| 269 | + (ext: { |
| 270 | + name = patchedPostgres.pkgs."${ext}".pname; |
| 271 | + version = patchedPostgres.pkgs."${ext}".version; |
| 272 | + }) |
| 273 | + orioledbPsqlExtensions; |
| 274 | + ourExts = map (ext: { name = ext.pname; version = ext.version; }) (makeOurOrioleDbPostgresPkgs version patchedPostgres); |
| 275 | + |
| 276 | + # Create the scope and new self/super for package resolution |
| 277 | + scope = { |
| 278 | + inherit (patchedPostgres) jitSupport; |
| 279 | + inherit (oriole_pkgs.llvmPackages) llvm; |
| 280 | + postgresql = patchedPostgres; |
| 281 | + inherit (postgresql) stdenv'; |
| 282 | + }; |
| 283 | + newSelf = self // scope; |
| 284 | + newSuper = { callPackage = oriole_pkgs.newScope (scope // postgresql.pkgs); }; |
| 285 | + |
| 286 | + # Get the packages using the passthru pattern |
| 287 | + selectedPackages = |
| 288 | + (map (ext: postgresql.pkgs."${ext}") orioledbPsqlExtensions) ++ |
| 289 | + (makeOurOrioleDbPostgresPkgs version postgresql); |
| 290 | + |
| 291 | + # Build the environment with the selected packages |
| 292 | + pgbin = oriole_pkgs.buildEnv { |
| 293 | + name = "postgresql-and-plugins-${postgresql.version}"; |
| 294 | + paths = [ postgresql ] ++ selectedPackages; |
| 295 | + buildInputs = [ oriole_pkgs.makeWrapper ]; |
| 296 | + passthru = postgresql.passthru // { |
| 297 | + inherit postgresql; |
| 298 | + args = selectedPackages; |
| 299 | + }; |
| 300 | + |
| 301 | + postBuild = '' |
| 302 | + mkdir -p $out/bin |
| 303 | + for bin in ${postgresql}/bin/*; do |
| 304 | + ln -sf $bin $out/bin/ |
| 305 | + done |
| 306 | + |
| 307 | + rm -f $out/bin/postgres |
| 308 | + makeWrapper ${postgresql}/bin/postgres $out/bin/postgres \ |
| 309 | + --set POSTGRES_MAJOR_VERSION "${postgresql.psqlSchema}" \ |
| 310 | + --prefix PATH : $out/bin \ |
| 311 | + --prefix LD_LIBRARY_PATH : $out/lib |
| 312 | + ''; |
| 313 | + }// { |
| 314 | + version = postgresql.version; |
| 315 | + }; |
| 316 | + in |
| 317 | + pkgs.symlinkJoin { |
| 318 | + inherit (pgbin) name version; |
| 319 | + paths = [ pgbin (makeReceipt pgbin upstreamExts ourExts) ]; |
| 320 | + }; |
265 | 321 |
|
266 | 322 | # Create an attribute set, containing all the relevant packages for a |
267 | 323 | # PostgreSQL install, wrapped up with a bow on top. There are three |
|
299 | 355 | postgresVersions = { |
300 | 356 | psql_15 = makePostgres "15"; |
301 | 357 | psql_16 = makePostgres "16"; |
302 | | - psql_oriole-16 = makeOrioleDbPostgres "16_31" postgresql_orioledb_16; |
| 358 | + psql_oriole-16 = makeOrioleDbPostgres "16" postgresql_orioledb_16; |
303 | 359 | }; |
304 | 360 |
|
305 | 361 | # Find the active PostgreSQL version |
|
0 commit comments