Merge pull request #316655 from raboof/grub2-deterministic-locales

grub2: make localization resources deterministic

authored by K900 and committed by GitHub 0b2a0905 4a4ecb0a

+10 -18
+10 -18
pkgs/tools/misc/grub/default.nix
··· 1 1 { lib, stdenv, runCommand, fetchFromSavannah, fetchpatch, flex, bison, python3, autoconf, automake, libtool, bash 2 - , rsync, gettext, ncurses, libusb-compat-0_1, freetype, qemu, lvm2, unifont, pkg-config 2 + , gettext, ncurses, libusb-compat-0_1, freetype, qemu, lvm2, unifont, pkg-config 3 + , fetchzip 3 4 , buildPackages 4 5 , nixosTests 5 6 , fuse # only needed for grub-mount ··· 53 54 hash = "sha256-lathsBb2f7urh8R86ihpTdwo3h1hAHnRiHd5gCLVpBc="; 54 55 }; 55 56 56 - # HACK: the translations are stored on a different server, 57 - # not versioned and not included in the git repo, so fetch them 58 - # and hope they don't change often 59 - locales = runCommand "grub-locales" { 60 - nativeBuildInputs = [rsync]; 61 - 62 - outputHashAlgo = "sha256"; 63 - outputHashMode = "recursive"; 64 - outputHash = "sha256-XzW2e7Xe7Pi297eV/fD2B/6uONEz9UjL2EHDCY0huTA="; 65 - } 66 - '' 67 - mkdir -p po 68 - ${src}/linguas.sh 69 - 70 - mv po $out 71 - ''; 57 + # The locales are fetched from translationproject.org at build time, 58 + # but those translations are not versioned/stable. For that reason 59 + # we take them from the nearest release tarball instead: 60 + locales = fetchzip { 61 + url = "https://ftp.gnu.org/gnu/grub/grub-2.12.tar.gz"; 62 + hash = "sha256-IoRiJHNQ58y0UhCAD0CrpFiI8Mz1upzAtyh5K4Njh/w="; 63 + }; 72 64 in ( 73 65 74 66 assert efiSupport -> canEfi; ··· 134 126 exit 1 135 127 fi 136 128 137 - cp -f --no-preserve=mode ${locales}/* po 129 + cp -f --no-preserve=mode ${locales}/po/LINGUAS ${locales}/po/*.po po 138 130 139 131 ./bootstrap --no-git --gnulib-srcdir=${gnulib} 140 132