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 { 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 3 , buildPackages 4 , nixosTests 5 , fuse # only needed for grub-mount ··· 53 hash = "sha256-lathsBb2f7urh8R86ihpTdwo3h1hAHnRiHd5gCLVpBc="; 54 }; 55 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 - ''; 72 in ( 73 74 assert efiSupport -> canEfi; ··· 134 exit 1 135 fi 136 137 - cp -f --no-preserve=mode ${locales}/* po 138 139 ./bootstrap --no-git --gnulib-srcdir=${gnulib} 140
··· 1 { lib, stdenv, runCommand, fetchFromSavannah, fetchpatch, flex, bison, python3, autoconf, automake, libtool, bash 2 + , gettext, ncurses, libusb-compat-0_1, freetype, qemu, lvm2, unifont, pkg-config 3 + , fetchzip 4 , buildPackages 5 , nixosTests 6 , fuse # only needed for grub-mount ··· 54 hash = "sha256-lathsBb2f7urh8R86ihpTdwo3h1hAHnRiHd5gCLVpBc="; 55 }; 56 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 + }; 64 in ( 65 66 assert efiSupport -> canEfi; ··· 126 exit 1 127 fi 128 129 + cp -f --no-preserve=mode ${locales}/po/LINGUAS ${locales}/po/*.po po 130 131 ./bootstrap --no-git --gnulib-srcdir=${gnulib} 132