2020-04-24 23:36:52 +00:00
let
generic =
# dependencies
2023-07-15 17:15:38 +00:00
{ stdenv , lib , fetchurl , makeWrapper , fetchpatch
2022-11-27 09:42:12 +00:00
, glibc , zlib , readline , openssl , icu , lz4 , zstd , systemd , libossp_uuid
2023-07-15 17:15:38 +00:00
, pkg-config , libxml2 , tzdata , libkrb5 , substituteAll , darwin
2024-01-13 08:15:51 +00:00
, linux-pam
2020-04-24 23:36:52 +00:00
# This is important to obtain a version of `libpq` that does not depend on systemd.
2023-01-20 10:41:00 +00:00
, enableSystemd ? lib . meta . availableOn stdenv . hostPlatform systemd && ! stdenv . hostPlatform . isStatic
2022-08-12 12:06:08 +00:00
, gssSupport ? with stdenv . hostPlatform ; ! isWindows && ! isStatic
2021-05-20 23:08:51 +00:00
2022-08-12 12:06:08 +00:00
# for postgresql.pkgs
2020-04-24 23:36:52 +00:00
, this , self , newScope , buildEnv
# source specification
2023-03-30 22:05:00 +00:00
, version , hash , psqlSchema
2021-01-15 22:18:51 +00:00
# for tests
2023-10-19 13:55:26 +00:00
, testers , nixosTests , thisAttr
2023-03-30 22:05:00 +00:00
# JIT
, jitSupport ? false
, nukeReferences , patchelf , llvmPackages
2023-05-24 13:37:59 +00:00
, makeRustPlatform , buildPgxExtension , cargo , rustc
2023-03-30 22:05:00 +00:00
2024-01-25 14:12:00 +00:00
# PL/Python
, pythonSupport ? false
, python3
2023-03-30 22:05:00 +00:00
# detection of crypt fails when using llvm stdenv, so we add it manually
# for <13 (where it got removed: https://github.com/postgres/postgres/commit/c45643d618e35ec2fe91438df15abd4f3c0d85ca)
, libxcrypt
2020-04-24 23:36:52 +00:00
} :
let
atLeast = lib . versionAtLeast version ;
2023-03-30 22:05:00 +00:00
olderThan = lib . versionOlder version ;
2021-12-06 16:07:01 +00:00
lz4Enabled = atLeast " 1 4 " ;
2022-11-27 09:42:12 +00:00
zstdEnabled = atLeast " 1 5 " ;
2020-04-24 23:36:52 +00:00
pname = " p o s t g r e s q l " ;
2023-10-19 13:55:26 +00:00
stdenv' = if jitSupport then llvmPackages . stdenv else stdenv ;
in stdenv' . mkDerivation ( finalAttrs : {
inherit pname version ;
2020-04-24 23:36:52 +00:00
src = fetchurl {
url = " m i r r o r : / / p o s t g r e s q l / s o u r c e / v ${ version } / ${ pname } - ${ version } . t a r . b z 2 " ;
2022-09-09 14:08:57 +00:00
inherit hash ;
2020-04-24 23:36:52 +00:00
} ;
2023-03-30 22:05:00 +00:00
hardeningEnable = lib . optionals ( ! stdenv' . cc . isClang ) [ " p i e " ] ;
2021-07-21 07:28:18 +00:00
2020-04-24 23:36:52 +00:00
outputs = [ " o u t " " l i b " " d o c " " m a n " ] ;
setOutputFlags = false ; # $out retains configureFlags :-/
2022-11-21 17:40:18 +00:00
buildInputs = [
zlib
readline
openssl
libxml2
icu
]
2023-03-30 22:05:00 +00:00
++ lib . optionals ( olderThan " 1 3 " ) [ libxcrypt ]
++ lib . optionals jitSupport [ llvmPackages . llvm ]
2021-12-06 16:07:01 +00:00
++ lib . optionals lz4Enabled [ lz4 ]
2022-11-27 09:42:12 +00:00
++ lib . optionals zstdEnabled [ zstd ]
2020-04-24 23:36:52 +00:00
++ lib . optionals enableSystemd [ systemd ]
2024-01-25 14:12:00 +00:00
++ lib . optionals pythonSupport [ python3 ]
2021-05-20 23:08:51 +00:00
++ lib . optionals gssSupport [ libkrb5 ]
2024-01-13 08:15:51 +00:00
++ lib . optionals stdenv' . isLinux [ linux-pam ]
2023-03-30 22:05:00 +00:00
++ lib . optionals ( ! stdenv' . isDarwin ) [ libossp_uuid ] ;
2020-04-24 23:36:52 +00:00
2022-11-21 17:40:18 +00:00
nativeBuildInputs = [
makeWrapper
pkg-config
2023-03-30 22:05:00 +00:00
]
++ lib . optionals jitSupport [ llvmPackages . llvm . dev nukeReferences patchelf ] ;
2020-04-24 23:36:52 +00:00
2023-03-30 22:05:00 +00:00
enableParallelBuilding = ! stdenv' . isDarwin ;
2020-04-24 23:36:52 +00:00
2020-11-30 08:33:03 +00:00
separateDebugInfo = true ;
2020-04-24 23:36:52 +00:00
buildFlags = [ " w o r l d " ] ;
2023-03-04 12:14:45 +00:00
env . NIX_CFLAGS_COMPILE = " - I ${ libxml2 . dev } / i n c l u d e / l i b x m l 2 " ;
2020-04-24 23:36:52 +00:00
# Otherwise it retains a reference to compiler and fails; see #44767. TODO: better.
2023-03-30 22:05:00 +00:00
preConfigure = " C C = ${ stdenv' . cc . targetPrefix } c c " ;
2020-04-24 23:36:52 +00:00
configureFlags = [
" - - w i t h - o p e n s s l "
" - - w i t h - l i b x m l "
2022-10-30 15:09:59 +00:00
" - - w i t h - i c u "
2020-04-24 23:36:52 +00:00
" - - s y s c o n f d i r = / e t c "
" - - l i b d i r = $ ( l i b ) / l i b "
" - - w i t h - s y s t e m - t z d a t a = ${ tzdata } / s h a r e / z o n e i n f o "
2020-11-30 08:33:03 +00:00
" - - e n a b l e - d e b u g "
2020-04-24 23:36:52 +00:00
( lib . optionalString enableSystemd " - - w i t h - s y s t e m d " )
2023-03-30 22:05:00 +00:00
( if stdenv' . isDarwin then " - - w i t h - u u i d = e 2 f s " else " - - w i t h - o s s p - u u i d " )
2022-10-30 15:09:59 +00:00
] ++ lib . optionals lz4Enabled [ " - - w i t h - l z 4 " ]
2022-11-27 09:42:12 +00:00
++ lib . optionals zstdEnabled [ " - - w i t h - z s t d " ]
2021-12-06 16:07:01 +00:00
++ lib . optionals gssSupport [ " - - w i t h - g s s a p i " ]
2024-01-25 14:12:00 +00:00
++ lib . optionals pythonSupport [ " - - w i t h - p y t h o n " ]
2023-03-30 22:05:00 +00:00
++ lib . optionals stdenv' . hostPlatform . isRiscV [ " - - d i s a b l e - s p i n l o c k s " ]
2024-01-13 08:15:51 +00:00
++ lib . optionals jitSupport [ " - - w i t h - l l v m " ]
++ lib . optionals stdenv' . isLinux [ " - - w i t h - p a m " ] ;
2020-04-24 23:36:52 +00:00
2022-11-21 17:40:18 +00:00
patches = [
2023-10-09 19:29:22 +00:00
( if atLeast " 1 6 " then ./patches/disable-normalize_exec_path.patch
else ./patches/disable-resolve_symlinks.patch )
2022-11-21 17:40:18 +00:00
./patches/less-is-more.patch
./patches/hardcode-pgxs-path.patch
./patches/specify_pkglibdir_at_runtime.patch
./patches/findstring.patch
2023-07-15 17:15:38 +00:00
2024-01-13 08:15:51 +00:00
# Fix build with libxml2 2.12.0 and -Wincompatible-function-pointer-types
( if atLeast " 1 6 " then
# https://www.postgresql.org/message-id/CACpMh%2BDMZVHM%2BiDSyqdcpK8sr7jd_HxxLJRNvGTzcLBE0W07QA%40mail.gmail.com
fetchurl {
url = " h t t p s : / / w w w . p o s t g r e s q l . o r g / m e s s a g e - i d / a t t a c h m e n t / 1 5 2 7 6 9 / v 1 - 0 0 0 1 - M a k e - P o s t g r e S Q L - w o r k - w i t h - n e w e r - v e r s i o n - o f - l i b x m l . p a t c h " ;
hash = " s h a 2 5 6 - 1 j 5 m t G + + h F m Y w f S 9 8 P d N 1 S m N I 4 T 8 6 q 4 F X v K L z 2 V e J y g = " ;
}
else
./patches/libxml2.12-15.patch
)
2023-07-15 17:15:38 +00:00
( substituteAll {
src = ./locale-binary-path.patch ;
locale = " ${ if stdenv . isDarwin then darwin . adv_cmds else lib . getBin stdenv . cc . libc } / b i n / l o c a l e " ;
} )
2023-10-19 13:55:26 +00:00
] ++ lib . optionals stdenv' . hostPlatform . isMusl (
let
self = {
" 1 2 " = {
icu-collations-hack = fetchurl {
url = " h t t p s : / / g i t . a l p i n e l i n u x . o r g / a p o r t s / p l a i n / t e s t i n g / p o s t g r e s q l 1 2 / i c u - c o l l a t i o n s - h a c k . p a t c h ? i d = d 5 2 2 7 c 9 1 a d d a 5 9 d 4 e 7 f 5 5 f 1 3 4 6 8 f 0 3 1 4 e 8 8 6 9 1 7 4 " ;
hash = " s h a 2 5 6 - w u w j v G H A r k R N w F o 4 0 g 3 p 4 3 W 3 2 O r J o h r e t l t 6 i S R l J K g = " ;
} ;
} ;
" 1 3 " = {
inherit ( self . " 1 4 " ) icu-collations-hack ;
disable-test-collate-icu-utf8 = fetchurl {
url = " h t t p s : / / g i t . a l p i n e l i n u x . o r g / a p o r t s / p l a i n / m a i n / p o s t g r e s q l 1 3 / d i s a b l e - t e s t - c o l l a t e . i c u . u t f 8 . p a t c h ? i d = 6 9 f a a 1 4 6 e c 9 f f f 3 b 9 8 1 5 1 1 0 6 8 f 1 7 f 9 e 6 2 9 d 4 6 8 8 b " ;
hash = " s h a 2 5 6 - j S / q x e z a i a K h k W e M C X w p z 1 S D J w U W n 9 t z N 0 u K a Z 3 P h 2 Y = " ;
} ;
} ;
" 1 4 " = {
icu-collations-hack = fetchurl {
url = " h t t p s : / / g i t . a l p i n e l i n u x . o r g / a p o r t s / p l a i n / m a i n / p o s t g r e s q l 1 4 / i c u - c o l l a t i o n s - h a c k . p a t c h ? i d = 5 6 9 9 9 e 6 d 0 2 6 5 c e f f 5 c 5 2 3 9 f 8 5 f d d 3 3 e 1 4 6 f 0 6 c b 7 " ;
hash = " s h a 2 5 6 - w u w j v G H A r k R N w F o 4 0 g 3 p 4 3 W 3 2 O r J o h r e t l t 6 i S R l J K g = " ;
} ;
disable-test-collate-icu-utf8 = fetchurl {
url = " h t t p s : / / g i t . a l p i n e l i n u x . o r g / a p o r t s / p l a i n / m a i n / p o s t g r e s q l 1 4 / d i s a b l e - t e s t - c o l l a t e . i c u . u t f 8 . p a t c h ? i d = 5 6 9 9 9 e 6 d 0 2 6 5 c e f f 5 c 5 2 3 9 f 8 5 f d d 3 3 e 1 4 6 f 0 6 c b 7 " ;
hash = " s h a 2 5 6 - j X e 2 3 A x n F j E l + T Z Q m 4 R 7 r S t k 2 L e o 0 8 c t x M N m u 1 x r 5 z M = " ;
} ;
} ;
" 1 5 " = {
icu-collations-hack = fetchurl {
url = " h t t p s : / / g i t . a l p i n e l i n u x . o r g / a p o r t s / p l a i n / m a i n / p o s t g r e s q l 1 5 / i c u - c o l l a t i o n s - h a c k . p a t c h ? i d = f 4 2 4 e 9 3 4 e 6 d 0 7 6 c 4 a e 0 6 5 c e 4 5 e 7 3 4 a a 2 8 3 e e c b 9 c " ;
hash = " s h a 2 5 6 - H g t m h F 4 O J Y U 9 m a c G J b T B 9 P j Q i / y W 7 c 3 A k m 3 U 0 n i W s 8 I = " ;
} ;
} ;
" 1 6 " = {
icu-collations-hack = fetchurl {
url = " h t t p s : / / g i t . a l p i n e l i n u x . o r g / a p o r t s / p l a i n / m a i n / p o s t g r e s q l 1 6 / i c u - c o l l a t i o n s - h a c k . p a t c h ? i d = 0 8 a 2 4 b e 2 6 2 3 3 9 f d 0 9 3 e 6 4 1 8 6 0 6 8 0 9 4 4 c 3 5 9 0 2 3 8 e " ;
hash = " s h a 2 5 6 - + u r Q d V I l A D L d D P e T 6 8 X Y v 5 r l j h b K 8 M / 7 m P Z n / c F + F T 0 = " ;
} ;
} ;
} ;
patchesForVersion = self . ${ lib . versions . major version } or ( throw " n o m u s l p a t c h e s f o r p o s t g r e s q l ${ version } " ) ;
in
lib . attrValues patchesForVersion
) ++ lib . optionals stdenv' . isLinux [
2022-11-21 17:40:18 +00:00
( if atLeast " 1 3 " then ./patches/socketdir-in-run-13.patch else ./patches/socketdir-in-run.patch )
] ;
2020-04-24 23:36:52 +00:00
installTargets = [ " i n s t a l l - w o r l d " ] ;
LC_ALL = " C " ;
2022-11-21 17:40:18 +00:00
postPatch = ''
# Hardcode the path to pgxs so pg_config returns the path in $out
substituteInPlace " s r c / c o m m o n / c o n f i g _ i n f o . c " - - replace HARDCODED_PGXS_PATH " $ o u t / l i b "
2023-03-30 22:05:00 +00:00
'' + l i b . o p t i o n a l S t r i n g j i t S u p p o r t ''
# Force lookup of jit stuff in $out instead of $lib
substituteInPlace src/backend/jit/jit.c - - replace pkglib_path \ " $ o u t / l i b \"
substituteInPlace src/backend/jit/llvm/llvmjit.c - - replace pkglib_path \ " $ o u t / l i b \"
substituteInPlace src/backend/jit/llvm/llvmjit_inline.cpp - - replace pkglib_path \ " $ o u t / l i b \"
2022-11-21 17:40:18 +00:00
'' ;
2020-04-24 23:36:52 +00:00
postInstall =
''
moveToOutput " l i b / p g x s " " $ o u t " # looks strange, but not deleting it
moveToOutput " l i b / l i b p g c o m m o n * . a " " $ o u t "
moveToOutput " l i b / l i b p g p o r t * . a " " $ o u t "
moveToOutput " l i b / l i b e c p g * " " $ o u t "
# Prevent a retained dependency on gcc-wrapper.
2023-03-30 22:05:00 +00:00
substituteInPlace " $ o u t / l i b / p g x s / s r c / M a k e f i l e . g l o b a l " - - replace $ { stdenv' . cc } /bin/ld ld
2020-04-24 23:36:52 +00:00
if [ - z " ' ' ${ dontDisableStatic:- } " ] ; then
# Remove static libraries in case dynamic are available.
for i in $ out/lib /* . a $ l i b / l i b / * . a ; d o
name = " $ ( b a s e n a m e " $ i " ) "
2023-03-30 22:05:00 +00:00
ext = " ${ stdenv' . hostPlatform . extensions . sharedLibrary } "
2020-04-24 23:36:52 +00:00
if [ - e " $ l i b / l i b / ' ' ${ name % . a } $ e x t " ] || [ - e " ' ' ${ i % . a } $ e x t " ] ; then
rm " $ i "
fi
done
fi
2023-03-30 22:05:00 +00:00
'' + l i b . o p t i o n a l S t r i n g j i t S u p p o r t ''
# Move the bitcode and libllvmjit.so library out of $lib; otherwise, every client that
# depends on libpq.so will also have libLLVM.so in its closure too, bloating it
moveToOutput " l i b / b i t c o d e " " $ o u t "
moveToOutput " l i b / l l v m j i t * " " $ o u t "
# In the case of JIT support, prevent a retained dependency on clang-wrapper
substituteInPlace " $ o u t / l i b / p g x s / s r c / M a k e f i l e . g l o b a l " - - replace $ { self . llvmPackages . stdenv . cc } /bin/clang clang
nuke-refs $ out/lib/llvmjit_types.bc $ ( find $ out/lib/bitcode - type f )
# Stop out depending on the default output of llvm
substituteInPlace $ out/lib/pgxs/src/Makefile.global \
- - replace $ { self . llvmPackages . llvm . out } /bin " " \
- - replace ' $ ( LLVM_BINPATH ) / ' " "
# Stop out depending on the -dev output of llvm
substituteInPlace $ out/lib/pgxs/src/Makefile.global \
- - replace $ { self . llvmPackages . llvm . dev } /bin/llvm-config llvm-config \
- - replace - I $ { self . llvmPackages . llvm . dev } /include " "
$ { lib . optionalString ( ! stdenv' . isDarwin ) ''
# Stop lib depending on the -dev output of llvm
rpath = $ ( patchelf - - print-rpath $ out/lib/llvmjit.so )
nuke-refs - e $ out $ out/lib/llvmjit.so
# Restore the correct rpath
patchelf $ out/lib/llvmjit.so - - set-rpath " $ r p a t h "
'' }
2020-04-24 23:36:52 +00:00
'' ;
2023-03-30 22:05:00 +00:00
postFixup = lib . optionalString ( ! stdenv' . isDarwin && stdenv' . hostPlatform . libc == " g l i b c " )
2020-04-24 23:36:52 +00:00
''
# initdb needs access to "locale" command from glibc.
wrapProgram $ out/bin/initdb - - prefix PATH " : " $ { glibc . bin } /bin
'' ;
2023-03-30 22:05:00 +00:00
doCheck = ! stdenv' . isDarwin ;
2020-04-24 23:36:52 +00:00
# autodetection doesn't seem to able to find this, but it's there.
checkTarget = " c h e c k " ;
preCheck =
# On musl, comment skip the following tests, because they break due to
# ! ERROR: could not load library "/build/postgresql-11.5/tmp_install/nix/store/...-postgresql-11.5-lib/lib/libpqwalreceiver.so": Error loading shared library libpq.so.5: No such file or directory (needed by /build/postgresql-11.5/tmp_install/nix/store/...-postgresql-11.5-lib/lib/libpqwalreceiver.so)
# See also here:
# https://git.alpinelinux.org/aports/tree/main/postgresql/disable-broken-tests.patch?id=6d7d32c12e073a57a9e5946e55f4c1fbb68bd442
2023-03-30 22:05:00 +00:00
if stdenv' . hostPlatform . isMusl then ''
2020-04-24 23:36:52 +00:00
substituteInPlace src/test/regress/parallel_schedule \
- - replace " s u b s c r i p t i o n " " " \
- - replace " o b j e c t _ a d d r e s s " " "
'' e l s e n u l l ;
doInstallCheck = false ; # needs a running daemon?
2023-03-30 22:05:00 +00:00
disallowedReferences = [ stdenv' . cc ] ;
2020-04-24 23:36:52 +00:00
2023-03-30 22:05:00 +00:00
passthru = let
jitToggle = this . override {
jitSupport = ! jitSupport ;
this = jitToggle ;
} ;
in
{
inherit readline psqlSchema jitSupport ;
withJIT = if jitSupport then this else jitToggle ;
withoutJIT = if jitSupport then jitToggle else this ;
2020-04-24 23:36:52 +00:00
2023-10-19 13:55:26 +00:00
dlSuffix = if olderThan " 1 6 " then " . s o " else stdenv . hostPlatform . extensions . sharedLibrary ;
2020-04-24 23:36:52 +00:00
pkgs = let
2023-03-30 22:05:00 +00:00
scope = {
postgresql = this ;
stdenv = stdenv' ;
buildPgxExtension = buildPgxExtension . override {
stdenv = stdenv' ;
rustPlatform = makeRustPlatform {
stdenv = stdenv' ;
2023-05-24 13:37:59 +00:00
inherit rustc cargo ;
2023-03-30 22:05:00 +00:00
} ;
} ;
} ;
2020-04-24 23:36:52 +00:00
newSelf = self // scope ;
newSuper = { callPackage = newScope ( scope // this . pkgs ) ; } ;
in import ./packages.nix newSelf newSuper ;
withPackages = postgresqlWithPackages {
inherit makeWrapper buildEnv ;
postgresql = this ;
}
this . pkgs ;
2021-01-15 22:18:51 +00:00
2023-03-30 22:05:00 +00:00
tests = {
postgresql = nixosTests . postgresql-wal-receiver . ${ thisAttr } ;
2023-10-19 13:55:26 +00:00
pkg-config = testers . testMetaPkgConfig finalAttrs . finalPackage ;
2023-03-30 22:05:00 +00:00
} // lib . optionalAttrs jitSupport {
postgresql-jit = nixosTests . postgresql-jit . ${ thisAttr } ;
} ;
} // lib . optionalAttrs jitSupport {
inherit ( llvmPackages ) llvm ;
2020-04-24 23:36:52 +00:00
} ;
meta = with lib ; {
homepage = " h t t p s : / / w w w . p o s t g r e s q l . o r g " ;
description = " A p o w e r f u l , o p e n s o u r c e o b j e c t - r e l a t i o n a l d a t a b a s e s y s t e m " ;
license = licenses . postgresql ;
2023-11-16 04:20:00 +00:00
changelog = " h t t p s : / / w w w . p o s t g r e s q l . o r g / d o c s / r e l e a s e / ${ finalAttrs . version } / " ;
2023-03-30 22:05:00 +00:00
maintainers = with maintainers ; [ thoughtpolice danbst globin marsam ivan ma27 ] ;
2023-10-19 13:55:26 +00:00
pkgConfigModules = [ " l i b e c p g " " l i b e c p g _ c o m p a t " " l i b p g t y p e s " " l i b p q " ] ;
2020-04-24 23:36:52 +00:00
platforms = platforms . unix ;
2023-03-30 22:05:00 +00:00
# JIT support doesn't work with cross-compilation. It is attempted to build LLVM-bytecode
# (`%.bc` is the corresponding `make(1)`-rule) for each sub-directory in `backend/` for
# the JIT apparently, but with a $(CLANG) that can produce binaries for the build, not the
# host-platform.
#
# I managed to get a cross-build with JIT support working with
# `depsBuildBuild = [ llvmPackages.clang ] ++ buildInputs`, but considering that the
# resulting LLVM IR isn't platform-independent this doesn't give you much.
# In fact, I tried to test the result in a VM-test, but as soon as JIT was used to optimize
# a query, postgres would coredump with `Illegal instruction`.
broken = jitSupport && ( stdenv . hostPlatform != stdenv . buildPlatform ) ;
2020-04-24 23:36:52 +00:00
} ;
2023-10-19 13:55:26 +00:00
} ) ;
2020-04-24 23:36:52 +00:00
postgresqlWithPackages = { postgresql , makeWrapper , buildEnv }: pkgs : f : buildEnv {
name = " p o s t g r e s q l - a n d - p l u g i n s - ${ postgresql . version } " ;
paths = f pkgs ++ [
postgresql
postgresql . lib
postgresql . man # in case user installs this into environment
] ;
2022-09-09 14:08:57 +00:00
nativeBuildInputs = [ makeWrapper ] ;
2020-04-24 23:36:52 +00:00
2020-11-30 08:33:03 +00:00
2020-04-24 23:36:52 +00:00
# We include /bin to ensure the $out/bin directory is created, which is
# needed because we'll be removing the files from that directory in postBuild
# below. See #22653
pathsToLink = [ " / " " / b i n " ] ;
# Note: the duplication of executables is about 4MB size.
# So a nicer solution was patching postgresql to allow setting the
2022-12-28 21:21:41 +00:00
# libdir explicitly.
2020-04-24 23:36:52 +00:00
postBuild = ''
mkdir - p $ out/bin
rm $ out/bin / { pg_config , postgres , pg_ctl }
cp - - target-directory = $ out/bin $ { postgresql } /bin / { postgres , pg_config , pg_ctl }
wrapProgram $ out/bin/postgres - - set NIX_PGLIBDIR $ out/lib
'' ;
passthru . version = postgresql . version ;
passthru . psqlSchema = postgresql . psqlSchema ;
} ;
2023-03-30 22:05:00 +00:00
mkPackages = self : {
postgresql_12 = self . callPackage generic {
2023-11-16 04:20:00 +00:00
version = " 1 2 . 1 7 " ;
2023-03-30 22:05:00 +00:00
psqlSchema = " 1 2 " ;
2023-11-16 04:20:00 +00:00
hash = " s h a 2 5 6 - k + j h s j m B 1 f A 8 b F d j 9 3 s o G E w c 5 N t x l P p G b i 7 b Z d n B x f Y = " ;
2023-03-30 22:05:00 +00:00
this = self . postgresql_12 ;
thisAttr = " p o s t g r e s q l _ 1 2 " ;
inherit self ;
} ;
2020-04-24 23:36:52 +00:00
2023-03-30 22:05:00 +00:00
postgresql_13 = self . callPackage generic {
2023-11-16 04:20:00 +00:00
version = " 1 3 . 1 3 " ;
2023-03-30 22:05:00 +00:00
psqlSchema = " 1 3 " ;
2023-11-16 04:20:00 +00:00
hash = " s h a 2 5 6 - i v a c J Z k E e i r S R l Z 9 a O x B M a 7 x F p V N j D 5 G n p e J C A s 3 p H Q = " ;
2023-03-30 22:05:00 +00:00
this = self . postgresql_13 ;
thisAttr = " p o s t g r e s q l _ 1 3 " ;
inherit self ;
} ;
2020-04-24 23:36:52 +00:00
2023-03-30 22:05:00 +00:00
postgresql_14 = self . callPackage generic {
2023-11-16 04:20:00 +00:00
version = " 1 4 . 1 0 " ;
2023-03-30 22:05:00 +00:00
psqlSchema = " 1 4 " ;
2023-11-16 04:20:00 +00:00
hash = " s h a 2 5 6 - y Z Q x x I 6 d R w s N C r l G 6 y F B o 8 0 Z E w w v t N x L M o S n d 0 7 M g 5 k = " ;
2023-03-30 22:05:00 +00:00
this = self . postgresql_14 ;
thisAttr = " p o s t g r e s q l _ 1 4 " ;
inherit self ;
} ;
2021-06-28 23:13:55 +00:00
2023-03-30 22:05:00 +00:00
postgresql_15 = self . callPackage generic {
2023-11-16 04:20:00 +00:00
version = " 1 5 . 5 " ;
2023-03-30 22:05:00 +00:00
psqlSchema = " 1 5 " ;
2023-11-16 04:20:00 +00:00
hash = " s h a 2 5 6 - j 1 O q l d e O u O g l N u p G t o G H e T t C u 6 O 0 9 l q j Q v V A s j y b E K Y = " ;
2023-03-30 22:05:00 +00:00
this = self . postgresql_15 ;
thisAttr = " p o s t g r e s q l _ 1 5 " ;
inherit self ;
} ;
2023-10-09 19:29:22 +00:00
postgresql_16 = self . callPackage generic {
2023-11-16 04:20:00 +00:00
version = " 1 6 . 1 " ;
2023-10-09 19:29:22 +00:00
psqlSchema = " 1 6 " ;
2023-11-16 04:20:00 +00:00
hash = " s h a 2 5 6 - z j x N h d G b A S H + D T + O 8 f p g H 3 G Y n o b 4 p m 9 9 w 6 1 U b d V W T + w = " ;
2023-10-09 19:29:22 +00:00
this = self . postgresql_16 ;
thisAttr = " p o s t g r e s q l _ 1 6 " ;
inherit self ;
} ;
2021-06-28 23:13:55 +00:00
} ;
2022-10-21 18:38:19 +00:00
2023-03-30 22:05:00 +00:00
in self :
let packages = mkPackages self ; in
packages
// self . lib . mapAttrs'
( attrName : postgres : self . lib . nameValuePair " ${ attrName } _ j i t " ( postgres . override rec {
jitSupport = true ;
thisAttr = " ${ attrName } _ j i t " ;
this = self . ${ thisAttr } ;
} ) )
packages