pkgs/development/compilers/llvm/common/default.nix: move patches into… (#389658)

pkgs/development/compilers/llvm/common/default.nix: move patches into patches.nix

authored by Tristan Ross and committed by GitHub 3cbbfb17 e7fa733d

+230 -226
+2 -226
pkgs/development/compilers/llvm/common/default.nix
··· 27 27 officialRelease ? null, 28 28 monorepoSrc ? null, 29 29 version ? null, 30 + patchesFn ? lib.id, 30 31 # Allows passthrough to packages via newScope. This makes it possible to 31 32 # do `(llvmPackages.override { <someLlvmDependency> = bar; }).clang` and get 32 33 # an llvmPackages whose packages are overridden in an internally consistent way. ··· 80 81 name = builtins.baseNameOf p; 81 82 path = 82 83 let 83 - patches = { 84 - "clang/gnu-install-dirs.patch" = [ 85 - { 86 - before = "14"; 87 - path = ../12; 88 - } 89 - { 90 - after = "19"; 91 - path = ../19; 92 - } 93 - ]; 94 - "clang/purity.patch" = [ 95 - { 96 - after = "18"; 97 - path = ../18; 98 - } 99 - { 100 - before = "17"; 101 - after = "15"; 102 - path = ../15; 103 - } 104 - { 105 - before = "16"; 106 - path = ../12; 107 - } 108 - ]; 109 - "clang/aarch64-tblgen.patch" = [ 110 - { 111 - after = "17"; 112 - before = "18"; 113 - path = ../17; 114 - } 115 - ]; 116 - "lld/add-table-base.patch" = [ 117 - { 118 - after = "16"; 119 - path = ../16; 120 - } 121 - ]; 122 - "lld/gnu-install-dirs.patch" = [ 123 - { 124 - after = "18"; 125 - path = ../18; 126 - } 127 - { 128 - before = "14"; 129 - path = ../12; 130 - } 131 - ]; 132 - "llvm/gnu-install-dirs.patch" = [ 133 - { 134 - after = "20"; 135 - path = ../20; 136 - } 137 - { 138 - after = "18"; 139 - before = "20"; 140 - path = ../18; 141 - } 142 - ]; 143 - "llvm/gnu-install-dirs-polly.patch" = [ 144 - { 145 - after = "20"; 146 - path = ../20; 147 - } 148 - { 149 - before = "20"; 150 - after = "18"; 151 - path = ../18; 152 - } 153 - { 154 - before = "18"; 155 - after = "14"; 156 - path = ../14; 157 - } 158 - ]; 159 - "llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch" = [ 160 - { 161 - before = "17"; 162 - after = "15"; 163 - path = ../15; 164 - } 165 - { 166 - after = "17"; 167 - path = ../17; 168 - } 169 - ]; 170 - "llvm/lit-shell-script-runner-set-dyld-library-path.patch" = [ 171 - { 172 - after = "18"; 173 - path = ../18; 174 - } 175 - { 176 - after = "16"; 177 - before = "18"; 178 - path = ../16; 179 - } 180 - ]; 181 - "llvm/polly-lit-cfg-add-libs-to-dylib-path.patch" = [ 182 - { 183 - after = "15"; 184 - path = ../15; 185 - } 186 - ]; 187 - "libunwind/gnu-install-dirs.patch" = [ 188 - { 189 - before = "17"; 190 - after = "15"; 191 - path = ../15; 192 - } 193 - ]; 194 - "compiler-rt/X86-support-extension.patch" = [ 195 - { 196 - after = "15"; 197 - path = ../15; 198 - } 199 - { 200 - before = "15"; 201 - path = ../12; 202 - } 203 - ]; 204 - "compiler-rt/armv6-scudo-libatomic.patch" = [ 205 - { 206 - after = "19"; 207 - path = ../19; 208 - } 209 - { 210 - after = "15"; 211 - before = "19"; 212 - path = ../15; 213 - } 214 - { 215 - before = "15"; 216 - path = ../14; 217 - } 218 - ]; 219 - "compiler-rt/armv7l.patch" = [ 220 - { 221 - before = "15"; 222 - after = "13"; 223 - path = ../13; 224 - } 225 - ]; 226 - "compiler-rt/gnu-install-dirs.patch" = [ 227 - { 228 - before = "14"; 229 - path = ../12; 230 - } 231 - { 232 - after = "13"; 233 - before = "15"; 234 - path = ../14; 235 - } 236 - { 237 - after = "15"; 238 - before = "17"; 239 - path = ../15; 240 - } 241 - { 242 - after = "16"; 243 - path = ../17; 244 - } 245 - ]; 246 - "compiler-rt/darwin-targetconditionals.patch" = [ 247 - { 248 - after = "13"; 249 - path = ../13; 250 - } 251 - ]; 252 - "compiler-rt/codesign.patch" = [ 253 - { 254 - after = "13"; 255 - path = ../13; 256 - } 257 - ]; 258 - "compiler-rt/normalize-var.patch" = [ 259 - { 260 - after = "16"; 261 - path = ../16; 262 - } 263 - { 264 - before = "16"; 265 - path = ../12; 266 - } 267 - ]; 268 - "lldb/procfs.patch" = [ 269 - { 270 - after = "15"; 271 - path = ../15; 272 - } 273 - { 274 - before = "15"; 275 - path = ../12; 276 - } 277 - ]; 278 - "lldb/resource-dir.patch" = [ 279 - { 280 - before = "16"; 281 - path = ../12; 282 - } 283 - ]; 284 - "openmp/fix-find-tool.patch" = [ 285 - { 286 - after = "17"; 287 - before = "19"; 288 - path = ../17; 289 - } 290 - ]; 291 - "openmp/run-lit-directly.patch" = [ 292 - { 293 - after = "16"; 294 - path = ../16; 295 - } 296 - { 297 - after = "14"; 298 - before = "16"; 299 - path = ../14; 300 - } 301 - ]; 302 - "libclc/use-default-paths.patch" = [ 303 - { 304 - after = "19"; 305 - path = ../19; 306 - } 307 - ]; 308 - }; 84 + patches = args.patchesFn (import ./patches.nix); 309 85 310 86 constraints = patches."${p}" or null; 311 87 matchConstraint =
+226
pkgs/development/compilers/llvm/common/patches.nix
··· 1 + { 2 + "clang/gnu-install-dirs.patch" = [ 3 + { 4 + before = "14"; 5 + path = ../12; 6 + } 7 + { 8 + after = "19"; 9 + path = ../19; 10 + } 11 + ]; 12 + "clang/purity.patch" = [ 13 + { 14 + after = "18"; 15 + path = ../18; 16 + } 17 + { 18 + before = "17"; 19 + after = "15"; 20 + path = ../15; 21 + } 22 + { 23 + before = "16"; 24 + path = ../12; 25 + } 26 + ]; 27 + "clang/aarch64-tblgen.patch" = [ 28 + { 29 + after = "17"; 30 + before = "18"; 31 + path = ../17; 32 + } 33 + ]; 34 + "lld/add-table-base.patch" = [ 35 + { 36 + after = "16"; 37 + path = ../16; 38 + } 39 + ]; 40 + "lld/gnu-install-dirs.patch" = [ 41 + { 42 + after = "18"; 43 + path = ../18; 44 + } 45 + { 46 + before = "14"; 47 + path = ../12; 48 + } 49 + ]; 50 + "llvm/gnu-install-dirs.patch" = [ 51 + { 52 + after = "20"; 53 + path = ../20; 54 + } 55 + { 56 + after = "18"; 57 + before = "20"; 58 + path = ../18; 59 + } 60 + ]; 61 + "llvm/gnu-install-dirs-polly.patch" = [ 62 + { 63 + after = "20"; 64 + path = ../20; 65 + } 66 + { 67 + before = "20"; 68 + after = "18"; 69 + path = ../18; 70 + } 71 + { 72 + before = "18"; 73 + after = "14"; 74 + path = ../14; 75 + } 76 + ]; 77 + "llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch" = [ 78 + { 79 + before = "17"; 80 + after = "15"; 81 + path = ../15; 82 + } 83 + { 84 + after = "17"; 85 + path = ../17; 86 + } 87 + ]; 88 + "llvm/lit-shell-script-runner-set-dyld-library-path.patch" = [ 89 + { 90 + after = "18"; 91 + path = ../18; 92 + } 93 + { 94 + after = "16"; 95 + before = "18"; 96 + path = ../16; 97 + } 98 + ]; 99 + "llvm/polly-lit-cfg-add-libs-to-dylib-path.patch" = [ 100 + { 101 + after = "15"; 102 + path = ../15; 103 + } 104 + ]; 105 + "libunwind/gnu-install-dirs.patch" = [ 106 + { 107 + before = "17"; 108 + after = "15"; 109 + path = ../15; 110 + } 111 + ]; 112 + "compiler-rt/X86-support-extension.patch" = [ 113 + { 114 + after = "15"; 115 + path = ../15; 116 + } 117 + { 118 + before = "15"; 119 + path = ../12; 120 + } 121 + ]; 122 + "compiler-rt/armv6-scudo-libatomic.patch" = [ 123 + { 124 + after = "19"; 125 + path = ../19; 126 + } 127 + { 128 + after = "15"; 129 + before = "19"; 130 + path = ../15; 131 + } 132 + { 133 + before = "15"; 134 + path = ../14; 135 + } 136 + ]; 137 + "compiler-rt/armv7l.patch" = [ 138 + { 139 + before = "15"; 140 + after = "13"; 141 + path = ../13; 142 + } 143 + ]; 144 + "compiler-rt/gnu-install-dirs.patch" = [ 145 + { 146 + before = "14"; 147 + path = ../12; 148 + } 149 + { 150 + after = "13"; 151 + before = "15"; 152 + path = ../14; 153 + } 154 + { 155 + after = "15"; 156 + before = "17"; 157 + path = ../15; 158 + } 159 + { 160 + after = "16"; 161 + path = ../17; 162 + } 163 + ]; 164 + "compiler-rt/darwin-targetconditionals.patch" = [ 165 + { 166 + after = "13"; 167 + path = ../13; 168 + } 169 + ]; 170 + "compiler-rt/codesign.patch" = [ 171 + { 172 + after = "13"; 173 + path = ../13; 174 + } 175 + ]; 176 + "compiler-rt/normalize-var.patch" = [ 177 + { 178 + after = "16"; 179 + path = ../16; 180 + } 181 + { 182 + before = "16"; 183 + path = ../12; 184 + } 185 + ]; 186 + "lldb/procfs.patch" = [ 187 + { 188 + after = "15"; 189 + path = ../15; 190 + } 191 + { 192 + before = "15"; 193 + path = ../12; 194 + } 195 + ]; 196 + "lldb/resource-dir.patch" = [ 197 + { 198 + before = "16"; 199 + path = ../12; 200 + } 201 + ]; 202 + "openmp/fix-find-tool.patch" = [ 203 + { 204 + after = "17"; 205 + before = "19"; 206 + path = ../17; 207 + } 208 + ]; 209 + "openmp/run-lit-directly.patch" = [ 210 + { 211 + after = "16"; 212 + path = ../16; 213 + } 214 + { 215 + after = "14"; 216 + before = "16"; 217 + path = ../14; 218 + } 219 + ]; 220 + "libclc/use-default-paths.patch" = [ 221 + { 222 + after = "19"; 223 + path = ../19; 224 + } 225 + ]; 226 + }
+2
pkgs/development/compilers/llvm/default.nix
··· 14 14 bootBintoolsNoLibc ? if stdenv.targetPlatform.linker == "lld" then null else pkgs.bintoolsNoLibc, 15 15 bootBintools ? if stdenv.targetPlatform.linker == "lld" then null else pkgs.bintools, 16 16 llvmVersions ? { }, 17 + patchesFn ? lib.id, 17 18 # Allows passthrough to packages via newScope in ./common/default.nix. 18 19 # This makes it possible to do 19 20 # `(llvmPackages.override { <someLlvmDependency> = bar; }).clang` and get ··· 74 75 gitRelease 75 76 monorepoSrc 76 77 version 78 + patchesFn 77 79 ; 78 80 } 79 81 // packageSetArgs # Allow overrides.