icu: fix cross compilation

Colin dfdf0cea a3047b38

+12 -26
+2 -15
pkgs/development/libraries/icu/default.nix
··· 2 2 3 3 let 4 4 make-icu = (import ./make-icu.nix) { 5 - inherit stdenv lib fetchurl fixDarwinDylibNames testers; 5 + inherit stdenv lib buildPackages fetchurl fixDarwinDylibNames testers; 6 6 }; 7 7 in 8 8 { 9 9 icu74 = make-icu { 10 10 version = "74.2"; 11 11 hash = "sha256-aNsIIhKpbW9T411g9H04uWLp+dIHp0z6x4Apro/14Iw="; 12 - nativeBuildRoot = buildPackages.icu74.override { buildRootOnly = true; }; 13 12 }; 14 13 icu73 = make-icu { 15 14 version = "73.2"; 16 15 hash = "sha256-gYqAcS7TyqzZtlIwXgGvx/oWfm8ulJltpEuQwqtgTOE="; 17 - nativeBuildRoot = buildPackages.icu73.override { buildRootOnly = true; }; 18 16 }; 19 17 icu72 = make-icu { 20 18 version = "72.1"; 21 19 hash = "sha256-otLTghcJKn7VZjXjRGf5L5drNw4gGCrTJe3qZoGnHWg="; 22 - nativeBuildRoot = buildPackages.icu72.override { buildRootOnly = true; }; 23 20 }; 24 21 icu71 = make-icu { 25 22 version = "71.1"; 26 23 hash = "sha256-Z6fm5R9h+vEwa2k1Mz4TssSKvY2m0vRs5q3KJLHiHr8="; 27 - nativeBuildRoot = buildPackages.icu71.override { buildRootOnly = true; }; 28 24 }; 29 25 icu70 = make-icu { 30 26 version = "70.1"; 31 27 hash = "sha256-jSBUKMF78Tu1NTAGae0oszihV7HAGuZtMdDT4tR8P9U="; 32 - nativeBuildRoot = buildPackages.icu70.override { buildRootOnly = true; }; 33 28 }; 34 29 icu69 = make-icu { 35 30 version = "69.1"; 36 31 hash = "sha256-TLp7es0dPELES7DBS+ZjcJjH+vKzMM6Ha8XzuRXQl0U="; 37 - nativeBuildRoot = buildPackages.icu69.override { buildRootOnly = true; }; 38 32 }; 39 33 icu68 = make-icu { 40 34 version = "68.2"; 41 35 hash = "sha256-x5GT3uOQeiGZuClqk7UsXLdDMsJvPRZyaUh2gNR51iU="; 42 - nativeBuildRoot = buildPackages.icu68.override { buildRootOnly = true; }; 43 36 }; 44 37 icu67 = make-icu { 45 38 version = "67.1"; 46 39 hash = "sha256-lKgM1vJRpTvSqZf28bWsZlP+eR36tm4esCJ3QPuG1dw="; 47 - nativeBuildRoot = buildPackages.icu67.override { buildRootOnly = true; }; 48 40 }; 49 41 icu66 = make-icu { 50 42 version = "66.1"; 51 43 hash = "sha256-UqPyIJq5VVnBzwoU8kM4AB84lhW/AOJYXvPbxD7PCi4="; 52 - nativeBuildRoot = buildPackages.icu66.override { buildRootOnly = true; }; 53 44 }; 54 45 icu64 = make-icu { 55 46 version = "64.2"; 56 47 hash = "sha256-Yn1dhHjm2W/IyQ/tSFEjkHmlYaaoueSLCJLyToLTHWw="; 57 - nativeBuildRoot = buildPackages.icu64.override { buildRootOnly = true; }; 58 48 }; 59 49 icu63 = make-icu { 60 50 version = "63.1"; 61 51 hash = "sha256-BcSQtpRU/OWGC36OKCEjFnSvChHX7y/r6poyUSmYy50="; 62 - nativeBuildRoot = buildPackages.icu63.override { buildRootOnly = true; }; 63 52 patches = [ 64 53 # https://bugzilla.mozilla.org/show_bug.cgi?id=1499398 65 54 (fetchpatch { ··· 72 61 icu60 = make-icu { 73 62 version = "60.2"; 74 63 hash = "sha256-8HPqjzW5JtcLsz5ld1CKpkKosxaoA/Eb4grzhIEdtBg="; 75 - nativeBuildRoot = buildPackages.icu60.override { buildRootOnly = true; }; 76 64 }; 77 65 icu58 = make-icu { 78 66 version = "58.2"; 79 67 hash = "sha256-KwpEEBU6myDeDiDH2LZgSacq7yRLU2g9DXUhNxaD2gw="; 80 - nativeBuildRoot = buildPackages.icu58.override { buildRootOnly = true; }; 81 68 patches = [ 82 69 (fetchurl { 83 70 url = "http://bugs.icu-project.org/trac/changeset/39484?format=diff"; ··· 87 74 ]; 88 75 patchFlags = [ "-p4" ]; 89 76 }; 90 - } 77 + }
+10 -11
pkgs/development/libraries/icu/make-icu.nix
··· 1 - { stdenv, lib, fetchurl, fixDarwinDylibNames, testers }: 1 + { stdenv, lib, buildPackages, fetchurl, fixDarwinDylibNames, testers }: 2 2 3 - { version, hash, patches ? [], patchFlags ? [] 4 - # Cross-compiled icu4c requires a build-root of a native compile 5 - , buildRootOnly ? false, nativeBuildRoot 6 - }: 3 + { version, hash, patches ? [], patchFlags ? [] }: 7 4 8 5 let 6 + # Cross-compiled icu4c requires a build-root of a native compile 7 + nativeBuildRoot = buildPackages."icu${lib.versions.major version}".buildRootOnly; 8 + 9 9 pname = "icu4c"; 10 10 11 11 baseAttrs = { ··· 99 99 ''; 100 100 }; 101 101 102 - attrs = if buildRootOnly 103 - then buildRootOnlyAttrs 104 - else realAttrs; 102 + mkWithAttrs = attrs: stdenv.mkDerivation (finalAttrs: attrs // { 103 + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 104 + passthru.buildRootOnly = mkWithAttrs buildRootOnlyAttrs; 105 + }); 105 106 in 106 - stdenv.mkDerivation (finalAttrs: attrs // { 107 - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 108 - }) 107 + mkWithAttrs realAttrs