diff --git a/pkgs/development/ada-modules/gnatprove/default.nix b/pkgs/development/ada-modules/gnatprove/default.nix index 6e0eda57e8dba..e08461a44c41d 100644 --- a/pkgs/development/ada-modules/gnatprove/default.nix +++ b/pkgs/development/ada-modules/gnatprove/default.nix @@ -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"; diff --git a/pkgs/development/ada-modules/gpr2/default.nix b/pkgs/development/ada-modules/gpr2/default.nix index 1ad58b125db42..bc6f0a51e26ba 100644 --- a/pkgs/development/ada-modules/gpr2/default.nix +++ b/pkgs/development/ada-modules/gpr2/default.nix @@ -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 = [ @@ -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 @@ -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"; }; }