From 7a40edc3bce01812a7dd757e2121668cb8d719eb Mon Sep 17 00:00:00 2001 From: Basti Widua Date: Thu, 6 Mar 2025 01:31:36 +0100 Subject: [PATCH] gnat14: add aarch64-linux support alire-project/GNAT-FSF-builds bootstrap binaries only exist since version 14 so I couldn't add support for versions <14 --- .../compilers/gnat-bootstrap/default.nix | 14 ++++++++++++-- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/gnat-bootstrap/default.nix b/pkgs/development/compilers/gnat-bootstrap/default.nix index 35c6b3e57e57..f69a58fdfada 100644 --- a/pkgs/development/compilers/gnat-bootstrap/default.nix +++ b/pkgs/development/compilers/gnat-bootstrap/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, autoPatchelfHook, fetchzip, xz, ncurses5, ncurses, readline, gmp, mpfr -, expat, libipt, zlib, dejagnu, sourceHighlight, python3, elfutils, guile, glibc +, expat, libipt, zlib, dejagnu, sourceHighlight, python3, elfutils, guile, glibc, zstd , majorVersion }: @@ -69,6 +69,11 @@ stdenv.mkDerivation(finalAttrs: hash = "sha256-pH3IuOpCM9sY/ppTYcxBmgpsUiMrisIjmAa/rmmZXb4="; upstreamTriplet = "x86_64-pc-linux-gnu"; }; + aarch64-linux = { + inherit url; + hash = "sha256-SVW/0yyj6ZH1GAjvD+unII+zSLGd3KGFt1bjjQ3SEFU="; + upstreamTriplet = "aarch64-linux-gnu"; + }; }.${stdenv.hostPlatform.system} or throwUnsupportedSystem; }; inherit (versionMap.${majorVersion}) gccVersion alireRevision upstreamTriplet; @@ -107,6 +112,11 @@ in { ncurses5 ] ++ [ xz + ] ++ lib.optionals (lib.versionAtLeast majorVersion "14" + && stdenv.hostPlatform.isAarch64 + && stdenv.hostPlatform.isLinux) [ + # not sure why the bootstrap binaries link to zstd only on this architecture but they do + zstd ]; strictDeps = true; @@ -187,7 +197,7 @@ in { homepage = "https://www.gnu.org/software/gnat"; license = licenses.gpl3; maintainers = with maintainers; [ ethindp ]; - platforms = [ "x86_64-linux" "x86_64-darwin" ]; + platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" ]; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; }; }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 174a802f54fc..ea2ae4480bb7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5779,7 +5779,7 @@ with pkgs; if stdenv.hostPlatform == stdenv.targetPlatform && stdenv.buildPlatform == stdenv.hostPlatform then buildPackages.gnat-bootstrap14 - else buildPackages.gnat13; + else buildPackages.gnat14; stdenv = if stdenv.hostPlatform == stdenv.targetPlatform && stdenv.buildPlatform == stdenv.hostPlatform