Merge pull request #267055 from marsam/fix-postgresql-jit

postgresql_jit: fix build

authored by Weijia Wang and committed by GitHub cbede4e9 74d102ce

+3 -33
+3 -33
pkgs/servers/sql/postgresql/default.nix
··· 37 37 pname = "postgresql"; 38 38 39 39 stdenv' = if jitSupport then llvmPackages.stdenv else stdenv; 40 - 41 - majorVersion = lib.versions.major version; 42 40 in stdenv'.mkDerivation (finalAttrs: { 43 41 inherit pname version; 44 42 ··· 112 110 src = ./locale-binary-path.patch; 113 111 locale = "${if stdenv.isDarwin then darwin.adv_cmds else lib.getBin stdenv.cc.libc}/bin/locale"; 114 112 }) 115 - ] ++ (let 116 - llvmJITPatches = { 117 - "12" = { 118 - rev = "15ddc9725eb73d97a16652c7c90d993302773544"; 119 - hash = "sha256-3dsaN/YTmc9JfIO/eXTr6tUqxMXHih58yhhtCW6Cz4E="; 120 - }; 121 - "13" = { 122 - rev = "f28956b239f19858e7c429d3065678ce79c5104b"; 123 - hash = "sha256-C31RF6sPYr0iSmGBjKWIq9oPMpLkZ1FIkPGhGANJecU="; 124 - }; 125 - "14" = { 126 - rev = "82d9a782a29633a7d2c8c0785e4162a46f93d23b"; 127 - hash = "sha256-qDStZ2fQyTnng3sjf502aNLIsqRsa59bpaZLY3cE2BY="; 128 - }; 129 - "15" = { 130 - rev = "eed1feb3fee1a558b67b04cbd709f31142f071d5"; 131 - hash = "sha256-IflqFi93Pyr/VfgS+jMdI/lYu4ISrgVlInWKueYqpZc="; 132 - }; 133 - "16" = { 134 - rev = "74d19ec096dfbda5782e62892de7e86a104f8265"; 135 - hash = "sha256-VB1Uc5waS8u5LjtvjLfeZcrHPSxmP2PyRVpMhK9+Xgc="; 136 - }; 137 - }; 138 - in lib.optional 139 - (jitSupport && llvmJITPatches?${majorVersion}) 140 - (fetchpatch { 141 - url = "https://github.com/postgres/postgres/commit/${llvmJITPatches.${majorVersion}.rev}.patch"; 142 - inherit (llvmJITPatches.${majorVersion}) hash; 143 - }) 144 - ) ++ lib.optionals stdenv'.hostPlatform.isMusl ( 113 + 114 + ] ++ lib.optionals stdenv'.hostPlatform.isMusl ( 145 115 let 146 116 self = { 147 117 "12" = { ··· 181 151 }; 182 152 }; 183 153 184 - patchesForVersion = self.${majorVersion} or (throw "no musl patches for postgresql ${version}"); 154 + patchesForVersion = self.${lib.versions.major version} or (throw "no musl patches for postgresql ${version}"); 185 155 in 186 156 lib.attrValues patchesForVersion 187 157 ) ++ lib.optionals stdenv'.isLinux [