gnat{13,14}: bootstrap with gnat-bootstrap{13,14} (#361939)

This commit is contained in:
Weijia Wang
2025-02-27 09:27:41 +01:00
committed by GitHub
2 changed files with 53 additions and 5 deletions
@@ -1,4 +1,4 @@
{ stdenv, lib, autoPatchelfHook, fetchzip, xz, ncurses5, readline, gmp, mpfr
{ stdenv, lib, autoPatchelfHook, fetchzip, xz, ncurses5, ncurses, readline, gmp, mpfr
, expat, libipt, zlib, dejagnu, sourceHighlight, python3, elfutils, guile, glibc
, majorVersion
}:
@@ -40,6 +40,36 @@ stdenv.mkDerivation(finalAttrs:
upstreamTriplet = "x86_64-pc-linux-gnu";
};
}.${stdenv.hostPlatform.system} or throwUnsupportedSystem;
"13" = {
gccVersion = "13.2.0";
alireRevision = "2";
} // {
x86_64-darwin = {
inherit url;
hash = "sha256-DNHcHTIi7pw0rsVtpyGTyLVElq3IoO2YX/OkDbdeQyo=";
upstreamTriplet = "x86_64-apple-darwin21.6.0";
};
x86_64-linux = {
inherit url;
hash = "sha256-DC95udGSzRDE22ON4UpekxTYWOSBeUdJvILbSFj6MFQ=";
upstreamTriplet = "x86_64-pc-linux-gnu";
};
}.${stdenv.hostPlatform.system} or throwUnsupportedSystem;
"14" = {
gccVersion = "14.2.0";
alireRevision = "1";
} // {
x86_64-darwin = {
inherit url;
hash = "sha256-3YOnvuI6Qq7huQcqgFSz/o+ZgY2wNkKDqHIuzNz1MVY=";
upstreamTriplet = "x86_64-apple-darwin21.6.0";
};
x86_64-linux = {
inherit url;
hash = "sha256-pH3IuOpCM9sY/ppTYcxBmgpsUiMrisIjmAa/rmmZXb4=";
upstreamTriplet = "x86_64-pc-linux-gnu";
};
}.${stdenv.hostPlatform.system} or throwUnsupportedSystem;
};
inherit (versionMap.${majorVersion}) gccVersion alireRevision upstreamTriplet;
in {
@@ -71,12 +101,20 @@ in {
buildInputs = [
expat
] ++ lib.optionals (lib.versionAtLeast majorVersion "13") [
ncurses
] ++ lib.optionals (lib.versionOlder majorVersion "13") [
ncurses5
] ++ [
xz
];
strictDeps = true;
# https://github.com/alire-project/GNAT-FSF-builds/issues/51
autoPatchelfIgnoreMissingDeps =
if (stdenv.buildPlatform.isLinux && majorVersion == "13") then true else null;
postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin) ''
substituteInPlace lib/gcc/${upstreamTriplet}/${gccVersion}/install-tools/mkheaders.conf \
--replace "SYSTEM_HEADER_DIR=\"/usr/include\"" "SYSTEM_HEADER_DIR=\"/include\""
+14 -4
View File
@@ -5940,14 +5940,14 @@ with pkgs;
gnat-bootstrap =
if stdenv.hostPlatform == stdenv.targetPlatform
&& stdenv.buildPlatform == stdenv.hostPlatform
then buildPackages.gnat-bootstrap12
then buildPackages.gnat-bootstrap13
else buildPackages.gnat13;
stdenv =
if stdenv.hostPlatform == stdenv.targetPlatform
&& stdenv.buildPlatform == stdenv.hostPlatform
&& stdenv.buildPlatform.isDarwin
&& stdenv.buildPlatform.isx86_64
then overrideCC stdenv gnat-bootstrap12
then overrideCC stdenv gnat-bootstrap13
else stdenv;
});
@@ -5963,14 +5963,14 @@ with pkgs;
gnat-bootstrap =
if stdenv.hostPlatform == stdenv.targetPlatform
&& stdenv.buildPlatform == stdenv.hostPlatform
then buildPackages.gnat-bootstrap12
then buildPackages.gnat-bootstrap14
else buildPackages.gnat13;
stdenv =
if stdenv.hostPlatform == stdenv.targetPlatform
&& stdenv.buildPlatform == stdenv.hostPlatform
&& stdenv.buildPlatform.isDarwin
&& stdenv.buildPlatform.isx86_64
then overrideCC stdenv gnat-bootstrap12
then overrideCC stdenv gnat-bootstrap14
else stdenv;
});
@@ -5981,6 +5981,16 @@ with pkgs;
} // lib.optionalAttrs (stdenv.hostPlatform.isDarwin) {
bintools = bintoolsDualAs;
});
gnat-bootstrap13 = wrapCCWith ({
cc = callPackage ../development/compilers/gnat-bootstrap { majorVersion = "13"; };
} // lib.optionalAttrs (stdenv.hostPlatform.isDarwin) {
bintools = bintoolsDualAs;
});
gnat-bootstrap14 = wrapCCWith ({
cc = callPackage ../development/compilers/gnat-bootstrap { majorVersion = "14"; };
} // lib.optionalAttrs (stdenv.hostPlatform.isDarwin) {
bintools = bintoolsDualAs;
});
gnat12Packages = recurseIntoAttrs (callPackage ./ada-packages.nix { gnat = buildPackages.gnat12; });
gnat13Packages = recurseIntoAttrs (callPackage ./ada-packages.nix { gnat = buildPackages.gnat13; });