Tom Hunze
2026-05-22 20:42:32 +02:00
parent 40b04f73bb
commit 41b2d01449
2 changed files with 22 additions and 5 deletions
@@ -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
@@ -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"