Skip to content

Commit

Permalink
gnatPackages.gpr2: 24.0.0 -> 25.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sternenseemann committed Nov 1, 2024
1 parent 3d045a5 commit afbef00
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
5 changes: 4 additions & 1 deletion pkgs/development/ada-modules/gnatprove/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ let
gnat_version = lib.versions.major gnat.version;

# gnatprove fsf-14 requires gpr2 from a special branch
gpr2_24_2_next = gpr2.overrideAttrs(old: rec {
gpr2_24_2_next = (gpr2.override {
# pregenerated kb db is not included
gpr2kbdir = "${gprbuild}/share/gprconfig";
}).overrideAttrs(old: rec {
version = "24.2.0-next";
src = fetchFromGitHub {
owner = "AdaCore";
Expand Down
28 changes: 23 additions & 5 deletions pkgs/development/ada-modules/gpr2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@
gprbuild,
which,
gnat,
xmlada,
gnatcoll-core,
gnatcoll-iconv,
gnatcoll-gmp,
enableShared ? !stdenv.hostPlatform.isStatic,
# kb database source, if null assume it is pregenerated
gpr2kbdir ? null,
}:

stdenv.mkDerivation rec {
pname = "gpr2";
version = "24.0.0";
version = "25.0.0";

src = fetchurl {
url = "https://github.com/AdaCore/gpr/releases/download/v${version}/gpr2-with-lkparser-${lib.versions.majorMinor version}.tgz";
sha256 = "1g90689k94q3ma7q76gnjipfblgfvcq6ldwbzcf0l5hx6n8vbly8";
url = "https://github.com/AdaCore/gpr/releases/download/v${version}/gpr2-with-gprconfig_kb-${lib.versions.majorMinor version}.tgz";
sha512 = "70fe0fcf541f6d3d90a34cab1638bbc0283dcd765c000406e0cfb73bae1817b30ddfe73f3672247a97c6b6bfc41900bc96a4440ca0c660f9c2f7b9d3cc8f8dcf";
};

nativeBuildInputs = [
Expand All @@ -28,13 +31,26 @@ stdenv.mkDerivation rec {

makeFlags = [
"prefix=$(out)"
"GPR2KBDIR=${gprbuild}/share/gprconfig"
"PROCESSORS=$(NIX_BUILD_CORES)"
"ENABLE_SHARED=${if enableShared then "yes" else "no"}"
"GPR2_BUILD=release"
] ++ lib.optionals (gpr2kbdir != null) [
"GPR2KBDIR=${gpr2kbdir}"
];

configurePhase = ''
runHook preConfigure
make setup "''${makeFlagsArray[@]}" $makeFlags
runHook postConfigure
'';

# fool make into thinking pregenerated targets are up to date
preBuild = lib.optionalString (gpr2kbdir == null) ''
touch .build/kb/{*.adb,*.ads,collect_kb}
'';

propagatedBuildInputs = [
gprbuild
xmlada
gnatcoll-gmp
gnatcoll-core
gnatcoll-iconv
Expand All @@ -49,5 +65,7 @@ stdenv.mkDerivation rec {
];
maintainers = with maintainers; [ heijligen ];
platforms = platforms.all;
# TODO(@sternenseemann): investigate failure with gnat 13
broken = lib.versionOlder gnat.version "14";
};
}

0 comments on commit afbef00

Please sign in to comment.