lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

postgresql: provide pltcl extension as package

This allows us to always build the extension, but still have the user
explicitly enable it without causing rebuilds.

+76 -4
+1 -1
doc/release-notes/rl-2505.section.md
··· 25 25 The `nixLog` function, which logs unconditionally, was also re-introduced and modified to prefix messages with the function name of the caller. 26 26 For more information, [see this PR](https://github.com/NixOS/nixpkgs/pull/370742). 27 27 28 - - `postgresql`'s `pythonSupport` argument has been changed. It is now enabled by default, but to use PL/Python the extension needs to be added explicitly with `postgresql.withPackages`. If you were using `postgresql.override { pythonSupport = true; }` before, change it to `postgresql.withPackages (ps: [ ps.plpython3 ])`. The same applies to `perlSupport`/`plperl` respectively. 28 + - `postgresql`'s `pythonSupport` argument has been changed. It is now enabled by default, but to use PL/Python the extension needs to be added explicitly with `postgresql.withPackages`. If you were using `postgresql.override { pythonSupport = true; }` before, change it to `postgresql.withPackages (ps: [ ps.plpython3 ])`. The same applies to `perlSupport`/`plperl` and `tclSupport`/`pltcl` respectively. 29 29 30 30 - The `rustPlatform.fetchCargoTarball` function is deprecated, because it relied on `cargo vendor` not changing its output format to keep fixed-output derivation hashes the same, which is a Nix invariant, and Cargo 1.84.0 changed `cargo vendor`'s output format. 31 31 It should generally be replaced with `rustPlatform.fetchCargoVendor`, but `rustPlatform.importCargoLock` may also be appropriate in some circumstances.
+3
pkgs/servers/sql/postgresql/ext.nix
··· 15 15 // lib.optionalAttrs (!self.pythonSupport) { 16 16 plpython3 = throw "PostgreSQL extension `plpython3` is not available, because `postgresql` was built without Python support. Override with `pythonSupport = true` to enable the extension."; 17 17 } 18 + // lib.optionalAttrs (!self.tclSupport) { 19 + pltcl = throw "PostgreSQL extension `pltcl` is not available, because `postgresql` was built without Tcl support. Override with `tclSupport = true` to enable the extension."; 20 + } 18 21 // lib.optionalAttrs config.allowAliases { 19 22 pg_embedding = throw "PostgreSQL extension `pg_embedding` has been removed since the project has been abandoned. Upstream's recommendation is to use pgvector instead (https://neon.tech/docs/extensions/pg_embedding#migrate-from-pg_embedding-to-pgvector)"; 20 23 }
+53
pkgs/servers/sql/postgresql/ext/pltcl.nix
··· 1 + { 2 + buildEnv, 3 + lib, 4 + postgresql, 5 + postgresqlTestExtension, 6 + tcl, 7 + tclPackages, 8 + }: 9 + 10 + let 11 + withPackages = 12 + f: 13 + let 14 + pkgs = f tclPackages; 15 + paths = lib.concatMapStringsSep " " (pkg: "${pkg}/lib") pkgs; 16 + finalPackage = buildEnv { 17 + name = "${postgresql.pname}-pltcl-${postgresql.version}"; 18 + paths = [ postgresql.pltcl ]; 19 + passthru = { 20 + inherit withPackages; 21 + wrapperArgs = [ 22 + ''--set TCLLIBPATH "${paths}"'' 23 + ]; 24 + tests.extension = postgresqlTestExtension { 25 + finalPackage = finalPackage.withPackages (ps: [ 26 + ps.mustache-tcl 27 + ps.tcllib 28 + ]); 29 + sql = '' 30 + CREATE EXTENSION pltclu; 31 + CREATE FUNCTION test() RETURNS VOID 32 + LANGUAGE pltclu AS $$ 33 + package require mustache 34 + $$; 35 + SELECT test(); 36 + ''; 37 + }; 38 + }; 39 + meta = { 40 + inherit (postgresql.meta) 41 + homepage 42 + license 43 + changelog 44 + maintainers 45 + platforms 46 + ; 47 + description = "PL/Tcl - Tcl Procedural Language"; 48 + }; 49 + }; 50 + in 51 + finalPackage; 52 + in 53 + withPackages (_: [ ])
+19 -3
pkgs/servers/sql/postgresql/generic.nix
··· 109 109 python3, 110 110 111 111 # PL/Tcl 112 - tclSupport ? false, 112 + tclSupport ? 113 + lib.meta.availableOn stdenv.hostPlatform tcl 114 + # tcl is broken in pkgsStatic 115 + && !stdenv.hostPlatform.isStatic 116 + # configure fails with: 117 + # configure: error: file 'tclConfig.sh' is required for Tcl 118 + && stdenv.buildPlatform.canExecute stdenv.hostPlatform, 113 119 tcl, 114 120 115 121 # SELinux ··· 168 174 "man" 169 175 ] 170 176 ++ lib.optionals perlSupport [ "plperl" ] 171 - ++ lib.optionals pythonSupport [ "plpython3" ]; 177 + ++ lib.optionals pythonSupport [ "plpython3" ] 178 + ++ lib.optionals tclSupport [ "pltcl" ]; 172 179 outputChecks = { 173 180 out = { 174 181 disallowedReferences = [ ··· 422 429 + lib.optionalString pythonSupport '' 423 430 moveToOutput "lib/*plpython3*" "$plpython3" 424 431 moveToOutput "share/postgresql/extension/*plpython3*" "$plpython3" 432 + '' 433 + + lib.optionalString tclSupport '' 434 + moveToOutput "lib/*pltcl*" "$pltcl" 435 + moveToOutput "share/postgresql/extension/*pltcl*" "$pltcl" 425 436 ''; 426 437 427 438 postFixup = lib.optionalString stdenv'.hostPlatform.isGnu '' ··· 462 473 pkgs = 463 474 let 464 475 scope = { 465 - inherit jitSupport pythonSupport perlSupport; 476 + inherit 477 + jitSupport 478 + pythonSupport 479 + perlSupport 480 + tclSupport 481 + ; 466 482 inherit (llvmPackages) llvm; 467 483 postgresql = this; 468 484 stdenv = stdenv';