2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl }:
|
2016-03-04 10:46:38 +00:00
|
|
|
|
2023-06-15 19:34:24 +00:00
|
|
|
# Note: this package is used for bootstrapping fetchurl, and thus
|
|
|
|
# cannot use fetchpatch! All mutable patches (generated by GitHub or
|
|
|
|
# cgit) that are needed here should be included directly in Nixpkgs as
|
|
|
|
# files.
|
|
|
|
|
2016-03-04 10:46:38 +00:00
|
|
|
let
|
2024-05-11 07:38:43 +00:00
|
|
|
rev = "948ae97ca5703224bd3eada06b7a69f40dd15a02";
|
2016-03-04 10:46:38 +00:00
|
|
|
|
|
|
|
# Don't use fetchgit as this is needed during Aarch64 bootstrapping
|
|
|
|
configGuess = fetchurl {
|
2023-08-05 11:10:55 +00:00
|
|
|
name = "config.guess-${builtins.substring 0 7 rev}";
|
2018-12-01 17:07:00 +00:00
|
|
|
url = "https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=${rev}";
|
2024-05-11 07:38:43 +00:00
|
|
|
hash = "sha256-ZByuPAx0xJNU0+3gCfP+vYD+vhUBp3wdn6yNQsxFtss=";
|
2016-03-04 10:46:38 +00:00
|
|
|
};
|
|
|
|
configSub = fetchurl {
|
2023-08-05 11:10:55 +00:00
|
|
|
name = "config.sub-${builtins.substring 0 7 rev}";
|
2018-12-01 17:07:00 +00:00
|
|
|
url = "https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=${rev}";
|
2024-05-11 07:38:43 +00:00
|
|
|
hash = "sha256-/jovMvuv9XhIcyVJ9I2YP9ZSYCTsLw9ancdcL0NZo6Y=";
|
2016-03-04 10:46:38 +00:00
|
|
|
};
|
2020-05-07 08:32:14 +00:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "gnu-config";
|
2024-05-11 07:38:43 +00:00
|
|
|
version = "2024-01-01";
|
2016-03-04 10:46:38 +00:00
|
|
|
|
2023-08-14 09:48:55 +00:00
|
|
|
unpackPhase = ''
|
|
|
|
runHook preUnpack
|
|
|
|
cp ${configGuess} ./config.guess
|
|
|
|
cp ${configSub} ./config.sub
|
|
|
|
chmod +w ./config.sub ./config.guess
|
|
|
|
runHook postUnpack
|
|
|
|
'';
|
|
|
|
|
2023-08-16 12:25:37 +00:00
|
|
|
# If this isn't set, `pkgs.gnu-config.overrideAttrs( _: { patches
|
|
|
|
# = ...; })` will behave very counterintuitively: the (unpatched)
|
|
|
|
# gnu-config from the updateAutotoolsGnuConfigScriptsHook stdenv's
|
|
|
|
# defaultNativeBuildInputs will "update" the patched gnu-config by
|
|
|
|
# reverting the patch!
|
|
|
|
dontUpdateAutotoolsGnuConfigScripts = true;
|
|
|
|
|
2023-08-14 09:48:55 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
install -Dm755 ./config.guess $out/config.guess
|
|
|
|
install -Dm755 ./config.sub $out/config.sub
|
|
|
|
runHook postInstall
|
2016-03-04 10:46:38 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2016-03-04 10:46:38 +00:00
|
|
|
description = "Attempt to guess a canonical system name";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://savannah.gnu.org/projects/config";
|
2016-03-04 10:46:38 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
# In addition to GPLv3:
|
|
|
|
# As a special exception to the GNU General Public License, if you
|
|
|
|
# distribute this file as part of a program that contains a
|
|
|
|
# configuration script generated by Autoconf, you may include it under
|
|
|
|
# the same distribution terms that you use for the rest of that
|
|
|
|
# program.
|
2023-04-03 07:09:31 +00:00
|
|
|
maintainers = with maintainers; [ dezgeg emilytrau ];
|
2016-03-04 10:46:38 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|