Merge pull request #213765 from wegank/data-mkderivation

treewide: data: convert to stdenvNoCC.mkDerivation

authored by Anderson Torres and committed by GitHub ee2db082 fa5f0d6b

+81 -53
+13 -9
pkgs/data/fonts/freefont-ttf/default.nix
··· 1 - { lib, fetchzip }: 1 + { lib, stdenvNoCC, fetchzip }: 2 2 3 - fetchzip rec { 3 + stdenvNoCC.mkDerivation rec { 4 4 pname = "freefont-ttf"; 5 5 version = "20120503"; 6 6 7 - url = "mirror://gnu/freefont/freefont-ttf-${version}.zip"; 7 + src = fetchzip { 8 + url = "mirror://gnu/freefont/freefont-ttf-${version}.zip"; 9 + hash = "sha256-K3kVHGcDTxQ7N7XqSdwRObriVkBoBYPKHbyYrYvm7VU="; 10 + }; 8 11 9 - postFetch = '' 12 + installPhase = '' 13 + runHook preInstall 14 + 10 15 mkdir -p $out/share/fonts/truetype 11 - mv $out/*.ttf $out/share/fonts/truetype 12 - find $out -maxdepth 1 ! -type d -exec rm {} + 16 + mv *.ttf $out/share/fonts/truetype 17 + 18 + runHook postInstall 13 19 ''; 14 - 15 - sha256 = "sha256-bdMZg/mHYc0N6HiR8uNl0CjeOwBou+OYj3LPkyEUHUA="; 16 20 17 21 meta = { 18 22 description = "GNU Free UCS Outline Fonts"; ··· 24 28 homepage = "https://www.gnu.org/software/freefont/"; 25 29 license = lib.licenses.gpl3Plus; 26 30 platforms = lib.platforms.all; 27 - maintainers = []; 31 + maintainers = [ ]; 28 32 }; 29 33 }
+14 -6
pkgs/data/icons/capitaine-cursors-themed/default.nix
··· 1 - { lib, fetchzip }: 2 - fetchzip rec { 1 + { lib, stdenvNoCC, fetchzip }: 2 + 3 + stdenvNoCC.mkDerivation rec { 3 4 pname = "capitaine-cursors-themed"; 4 5 version = "5"; 5 - stripRoot = false; 6 - url = "https://github.com/sainnhe/capitaine-cursors/releases/download/r${version}/Linux.zip"; 7 - sha256 = "jQNAXuR/OtvohWziGYgb5Ni2/tEIGaY9HIyUUW793EY="; 8 6 9 - postFetch = '' 7 + src = fetchzip { 8 + url = "https://github.com/sainnhe/capitaine-cursors/releases/download/r${version}/Linux.zip"; 9 + stripRoot = false; 10 + hash = "sha256-ipPpmZKU/xLA45fdOvxVbtFDCUsCYIvzeps/DjhFkNg="; 11 + }; 12 + 13 + installPhase = '' 14 + runHook preInstall 15 + 10 16 mkdir -p $out/share/icons 11 17 cp -r ./ $out/share/icons 18 + 19 + runHook postInstall 12 20 ''; 13 21 14 22 meta = with lib; {
+12 -11
pkgs/data/misc/cldr-annotations/default.nix
··· 1 - { lib, fetchzip }: 1 + { lib, stdenvNoCC, fetchzip }: 2 2 3 - fetchzip rec { 3 + stdenvNoCC.mkDerivation rec { 4 4 pname = "cldr-annotations"; 5 5 version = "42.0"; 6 6 7 - url = "https://unicode.org/Public/cldr/${lib.versions.major version}/cldr-common-${version}.zip"; 7 + src = fetchzip { 8 + url = "https://unicode.org/Public/cldr/${lib.versions.major version}/cldr-common-${version}.zip"; 9 + stripRoot = false; 10 + hash = "sha256-paRon3ecGXNp3ZDnN1DU9RVU2NDWTBiKjy0OP3vcPLE="; 11 + }; 12 + 13 + installPhase = '' 14 + runHook preInstall 8 15 9 - stripRoot = false; 10 - postFetch = '' 11 16 mkdir -p $out/share/unicode/cldr/common 12 - mv $out/common/annotations{,Derived} -t $out/share/unicode/cldr/common 17 + mv common/annotations{,Derived} -t $out/share/unicode/cldr/common 13 18 14 - shopt -s extglob dotglob 15 - rm -rf $out/!(share) 16 - shopt -u extglob dotglob 19 + runHook postInstall 17 20 ''; 18 - 19 - hash = "sha256-9OOd69nBaDSt+ilL3PTGpcQgC60PnHqd8/CYa2LgeI0="; 20 21 21 22 meta = with lib; { 22 23 description = "Names and keywords for Unicode characters from the Common Locale Data Repository";
+18 -14
pkgs/data/misc/publicsuffix-list/default.nix
··· 1 - { lib, fetchFromGitHub }: 1 + { lib, stdenvNoCC, fetchFromGitHub }: 2 2 3 - let 3 + stdenvNoCC.mkDerivation { 4 4 pname = "publicsuffix-list"; 5 - version = "2021-09-03"; 6 - in fetchFromGitHub { 7 - name = "${pname}-${version}"; 8 - owner = "publicsuffix"; 9 - repo = "list"; 10 - rev = "2533d032871e1ef1f410fc0754b848d4587c8021"; 11 - sha256 = "sha256-Q8uIXM1CMu8dlWcVoL17M1XRGu3kG7Y7jpx0oHQh+2I="; 5 + version = "unstable-2021-09-03"; 12 6 13 - postFetch = '' 14 - install -Dm0444 $out/public_suffix_list.dat $out/tests/test_psl.txt -t $out/share/publicsuffix 15 - shopt -s extglob dotglob 16 - rm -rf $out/!(share) 17 - shopt -u extglob dotglob 7 + src = fetchFromGitHub { 8 + owner = "publicsuffix"; 9 + repo = "list"; 10 + rev = "2533d032871e1ef1f410fc0754b848d4587c8021"; 11 + hash = "sha256-moibTN9KovABcg+ubKUgMXg4b8sMrTVo6Itmiati/Vk="; 12 + }; 13 + 14 + dontBuild = true; 15 + 16 + installPhase = '' 17 + runHook preInstall 18 + 19 + install -Dm0444 public_suffix_list.dat tests/test_psl.txt -t $out/share/publicsuffix 20 + 21 + runHook postInstall 18 22 ''; 19 23 20 24 meta = with lib; {
+24 -13
pkgs/data/misc/unicode-emoji/default.nix
··· 1 1 { lib 2 + , stdenvNoCC 2 3 , fetchurl 3 4 , symlinkJoin 4 5 }: ··· 6 7 let 7 8 version = "15.0"; 8 9 9 - fetchData = { file, sha256 }: fetchurl { 10 - url = "https://www.unicode.org/Public/emoji/${version}/${file}"; 11 - inherit sha256; 12 - downloadToTemp = true; 13 - recursiveHash = true; 14 - postFetch = '' 10 + fetchData = { suffix, hash }: stdenvNoCC.mkDerivation { 11 + pname = "unicode-emoji-${suffix}"; 12 + inherit version; 13 + 14 + src = fetchurl { 15 + url = "https://www.unicode.org/Public/emoji/${version}/emoji-${suffix}.txt"; 16 + inherit hash; 17 + }; 18 + 19 + dontUnpack = true; 20 + 21 + installPhase = '' 22 + runHook preInstall 23 + 15 24 installDir="$out/share/unicode/emoji" 16 25 mkdir -p "$installDir" 17 - mv "$downloadedFile" "$installDir/${file}" 26 + cp "$src" "$installDir/emoji-${suffix}.txt" 27 + 28 + runHook postInstall 18 29 ''; 19 30 }; 20 31 21 32 srcs = { 22 33 emoji-sequences = fetchData { 23 - file = "emoji-sequences.txt"; 24 - sha256 = "sha256-vRpXHAcdY3arTnFwBH3WUW3DOh8B3L9+sRcecLHZ2lg="; 34 + suffix = "sequences"; 35 + hash = "sha256-XCIi2KQy2JagMaaML1SwT79HsPzi5phT8euKPpRetW0="; 25 36 }; 26 37 emoji-test = fetchData { 27 - file = "emoji-test.txt"; 28 - sha256 = "sha256-3Rega6+ZJ5jXRhLFL/i/12V5IypEo5FaGG6Wf9Bj0UU="; 38 + suffix = "test"; 39 + hash = "sha256-hEXyOsg4jglr4Z0CYuFPzv+Fb/Ugk/I1bciUhfGoU9s="; 29 40 }; 30 41 emoji-zwj-sequences = fetchData { 31 - file = "emoji-zwj-sequences.txt"; 32 - sha256 = "sha256-9AqrpyUCiBcR/fafa4VaH0pT5o1YzEZDVySsX4ja1u8="; 42 + suffix = "zwj-sequences"; 43 + hash = "sha256-/jV/kRe3dGZ2Bjdl1YcTft+bJZA6eSvVSTW/CFZ5EYI="; 33 44 }; 34 45 }; 35 46 in