diff --git a/pkgs/development/compilers/gnat-bootstrap/default.nix b/pkgs/development/compilers/gnat-bootstrap/default.nix index bbf1173f1b00..35c6b3e57e57 100644 --- a/pkgs/development/compilers/gnat-bootstrap/default.nix +++ b/pkgs/development/compilers/gnat-bootstrap/default.nix @@ -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\"" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3517d548c51d..3cb195549d10 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; });