diff --git a/pkgs/development/ada-modules/gprbuild/boot.nix b/pkgs/development/ada-modules/gprbuild/boot.nix index 3ba3c4e52daa..0f8227d50d35 100644 --- a/pkgs/development/ada-modules/gprbuild/boot.nix +++ b/pkgs/development/ada-modules/gprbuild/boot.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitHub, + fetchpatch2, gnat, which, xmlada, # for src @@ -36,6 +37,20 @@ stdenv.mkDerivation { which ]; + # Fix compilation with GNAT 16 + patches = lib.optionals (lib.versionAtLeast gnat.version "16") [ + # gpr-compilation-process.adb:44:29: error: operator for type "String" is not declared in "Env_Maps" + (fetchpatch2 { + url = "https://github.com/AdaCore/gprbuild/commit/6421e350274b3018a26bd058b1c90d033b053f71.patch?full_index=1"; + hash = "sha256-u9bmr8abmthlyHoeqW5nS2CnaxXmbx6WVwhemxVtw+0="; + }) + # gpr-compilation-protocol.adb:981:13: error: "time_t" is undefined + (fetchpatch2 { + url = "https://github.com/AdaCore/gprbuild/commit/6b6be939d69d534beb7faca17664d7a1ffa9c81e.patch?full_index=1"; + hash = "sha256-YUjBvA4bBsrCB46o5WVHOZR6qOf2bkMg+A9qlystDbc="; + }) + ]; + postPatch = '' # The Makefile uses gprbuild to build gprbuild which # we can't do at this point, delete it to prevent the diff --git a/pkgs/development/ada-modules/gprbuild/default.nix b/pkgs/development/ada-modules/gprbuild/default.nix index c8d530466ca7..b722f012d431 100644 --- a/pkgs/development/ada-modules/gprbuild/default.nix +++ b/pkgs/development/ada-modules/gprbuild/default.nix @@ -47,11 +47,13 @@ stdenv.mkDerivation { NIX_LDFLAGS = "-headerpad_max_install_names"; }; - # Fixes gprbuild being linked statically always. Based on the AUR's patch: - # https://aur.archlinux.org/cgit/aur.git/plain/0001-Makefile-build-relocatable-instead-of-static-binary.patch?h=gprbuild&id=bac524c76cd59c68fb91ef4dfcbe427357b9f850 - patches = lib.optionals (!stdenv.hostPlatform.isStatic) [ - ./gprbuild-relocatable-build.patch - ]; + patches = + gprbuild-boot.patches + # Fixes gprbuild being linked statically always. Based on the AUR's patch: + # https://aur.archlinux.org/cgit/aur.git/plain/0001-Makefile-build-relocatable-instead-of-static-binary.patch?h=gprbuild&id=bac524c76cd59c68fb91ef4dfcbe427357b9f850 + ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ + ./gprbuild-relocatable-build.patch + ]; buildFlags = [ "all"