1 { lib, stdenv, fetchurl }:
3 # Note: this package is used for bootstrapping fetchurl, and thus
4 # cannot use fetchpatch! All mutable patches (generated by GitHub or
5 # cgit) that are needed here should be included directly in Nixpkgs as
9 rev = "948ae97ca5703224bd3eada06b7a69f40dd15a02";
11 # Don't use fetchgit as this is needed during Aarch64 bootstrapping
12 configGuess = fetchurl {
13 name = "config.guess-${builtins.substring 0 7 rev}";
14 url = "https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=${rev}";
15 hash = "sha256-ZByuPAx0xJNU0+3gCfP+vYD+vhUBp3wdn6yNQsxFtss=";
17 configSub = fetchurl {
18 name = "config.sub-${builtins.substring 0 7 rev}";
19 url = "https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=${rev}";
20 hash = "sha256-/jovMvuv9XhIcyVJ9I2YP9ZSYCTsLw9ancdcL0NZo6Y=";
22 in stdenv.mkDerivation {
24 version = "2024-01-01";
28 cp ${configGuess} ./config.guess
29 cp ${configSub} ./config.sub
30 chmod +w ./config.sub ./config.guess
34 # If this isn't set, `pkgs.gnu-config.overrideAttrs( _: { patches
35 # = ...; })` will behave very counterintuitively: the (unpatched)
36 # gnu-config from the updateAutotoolsGnuConfigScriptsHook stdenv's
37 # defaultNativeBuildInputs will "update" the patched gnu-config by
38 # reverting the patch!
39 dontUpdateAutotoolsGnuConfigScripts = true;
46 install -Dm755 ./config.guess $out/config.guess
47 install -Dm755 ./config.sub $out/config.sub
52 description = "Attempt to guess a canonical system name";
53 homepage = "https://savannah.gnu.org/projects/config";
54 license = licenses.gpl3;
55 # In addition to GPLv3:
56 # As a special exception to the GNU General Public License, if you
57 # distribute this file as part of a program that contains a
58 # configuration script generated by Autoconf, you may include it under
59 # the same distribution terms that you use for the rest of that
61 maintainers = with maintainers; [ dezgeg emilytrau ];
62 platforms = platforms.all;