Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnatPackages: AdaCore 2025 updates #352856

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pkgs/development/ada-modules/gnatcoll/bindings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@ let
python3 = [ python3 ncurses ];
syslog = [ ];
zlib = [ zlib ];
cpp = [ ];
};
in


stdenv.mkDerivation rec {
pname = "gnatcoll-${component}";
version = "24.0.0";
version = "25.0.0";

src = fetchFromGitHub {
owner = "AdaCore";
repo = "gnatcoll-bindings";
rev = "v${version}";
sha256 = "00aakpmr67r72l1h3jpkaw83p1a2mjjvfk635yy5c1nss3ji1qjm";
sha256 = "0ayc7zvv8w90v0xzhrjk2x88zrsk62xxcm27ya9crlp6affn5idk";
};

nativeBuildInputs = [
Expand All @@ -59,7 +60,7 @@ stdenv.mkDerivation rec {
gnatcoll-core
] ++ libsFor."${component}" or [];

# explicit flag for GPL acceptance because upstreams
# explicit flag for GPL acceptance because upstream
# allows a gcc runtime exception for all bindings
# except for readline (since it is GPL w/o exceptions)
buildFlags = lib.optionals (component == "readline") [
Expand Down
47 changes: 44 additions & 3 deletions pkgs/development/ada-modules/gnatcoll/core.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,80 @@
, gnat
, gprbuild
, fetchFromGitHub
, fetchpatch2
, which
, python3
, rsync
, enableGnatcollCore ? true
# TODO(@sternenseemann): figure out a way to split this up into three packages
, enableGnatcollProjects ? true
# for tests
, gnatcoll-core
}:

# gnatcoll-projects depends on gnatcoll-core
assert enableGnatcollProjects -> enableGnatcollCore;

stdenv.mkDerivation rec {
pname = "gnatcoll-core";
version = "24.0.0";
version = "25.0.0";

src = fetchFromGitHub {
owner = "AdaCore";
repo = "gnatcoll-core";
rev = "v${version}";
sha256 = "1cks2w0inj9hvamsdxjriwxnx1igmx2khhr6kwxshsl30rs8nzvb";
sha256 = "1srnh7vhs46c2zy4hcy4pg0a0prghfzlpv7c82k0jan384yz1g6g";
};

patches = [
# Fix compilation with GNAT 12 https://github.com/AdaCore/gnatcoll-core/issues/88
(fetchpatch2 {
name = "gnatcoll-core-gnat-12.patch";
url = "https://github.com/AdaCore/gnatcoll-core/commit/515db1c9f1eea8095f2d9ff9570159a78c981ec6.patch";
sha256 = "1ghnkhp5fncb7qcmf59kyqvy0sd0pzf1phnr2z7b4ljwlkbmcp36";
})
];

postPatch = ''
patchShebangs */*.gpr.py
'';

nativeBuildInputs = [
gprbuild
which
gnat
python3
rsync
];

# propagate since gprbuild needs to find
# referenced GPR project definitions
propagatedBuildInputs = [
propagatedBuildInputs = lib.optionals enableGnatcollProjects [
gprbuild # libgpr
];

strictDeps = true;

makeFlags = [
"prefix=${placeholder "out"}"
"PROCESSORS=$(NIX_BUILD_CORES)"
# confusingly, for gprbuild --target is autoconf --host
"TARGET=${stdenv.hostPlatform.config}"
"GNATCOLL_MINIMAL_ONLY=${if !enableGnatcollCore then "yes" else "no"}"
"GNATCOLL_PROJECTS=${if enableGnatcollProjects then "yes" else "no"}"
];

passthru.tests = {
minimalOnly = gnatcoll-core.override {
enableGnatcollProjects = false;
enableGnatcollCore = false;
};
noProjects = gnatcoll-core.override {
enableGnatcollProjects = false;
enableGnatcollCore = true;
};
};

meta = with lib; {
homepage = "https://github.com/AdaCore/gnatcoll-core";
description = "GNAT Components Collection - Core packages";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/ada-modules/gnatcoll/db.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ stdenv.mkDerivation rec {
if onlyExecutable
then builtins.replaceStrings [ "_" ] [ "-" ] component
else "gnatcoll-${component}";
version = "24.0.0";
version = "25.0.0";

src = fetchFromGitHub {
owner = "AdaCore";
repo = "gnatcoll-db";
rev = "v${version}";
sha256 = "0jq76s4s7q2x93jh8la6r0i3jkpvgsfj12vbbaqabh410xccyr3p";
sha256 = "0q35ii0aa4hh59v768l5cilg1b30a4ckcvlbfy0lkcbp3rcfnbz3";
};

# Link executables dynamically unless specified by the platform,
Expand Down
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
40 changes: 30 additions & 10 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 @@ -26,15 +29,30 @@ stdenv.mkDerivation rec {
gprbuild
];

makeFlags = [
"prefix=$(out)"
"GPR2KBDIR=${gprbuild}/share/gprconfig"
"PROCESSORS=$(NIX_BUILD_CORES)"
"ENABLE_SHARED=${if enableShared then "yes" else "no"}"
];
makeFlags =
[
"prefix=$(out)"
"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 +67,7 @@ stdenv.mkDerivation rec {
];
maintainers = with maintainers; [ heijligen ];
platforms = platforms.all;
# TODO(@sternenseemann): investigate failure with gnat 13
broken = lib.versionOlder gnat.version "14";
};
}
6 changes: 3 additions & 3 deletions pkgs/development/ada-modules/gprbuild/boot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
}:

let
version = "24.0.0";
version = "25.0.0";

gprConfigKbSrc = fetchFromGitHub {
name = "gprconfig-kb-${version}-src";
owner = "AdaCore";
repo = "gprconfig_kb";
rev = "v${version}";
sha256 = "1vnjv2q63l8nq2w4wya75m40isvs78j5ss9b5ga3zx3cpdx3xh09";
sha256 = "09x1njq0i0z7fbwg0mg39r5ghy7369avbqvdycfj67lpmw17gb1r";
};
in

Expand All @@ -27,7 +27,7 @@ stdenv.mkDerivation {
owner = "AdaCore";
repo = "gprbuild";
rev = "v${version}";
sha256 = "096a43453z2xknn6x4hyk2ldp2wh0qhfdfmzsrks50zqcvmkq4v7";
sha256 = "1mqsmc0q5bzg8223ls18kbvaz6mhzjz7ik8d3sqhhn24c0j6wjaw";
};

nativeBuildInputs = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/ada-modules/xmlada/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

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

src = fetchFromGitHub {
name = "xmlada-${version}-src";
owner = "AdaCore";
repo = "xmlada";
rev = "v${version}";
sha256 = "sha256-vvM7bdf3dAa3zKgxbGeAGlBT6fvafzmleimJHyRdlvc=";
sha256 = "sha256-UMJiXSHMS8+X5gyV1nmC29gF71BFnz7LNPQnwUMD3Yg=";
};

nativeBuildInputs = [
Expand Down
3 changes: 2 additions & 1 deletion pkgs/top-level/ada-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ makeScopeWithSplicing' {
gnatcoll-core = self.callPackage ../development/ada-modules/gnatcoll/core.nix { };

# gnatcoll-bindings repository
gnatcoll-cpp = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "cpp"; };
gnatcoll-gmp = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "gmp"; };
gnatcoll-iconv = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "iconv"; };
gnatcoll-lzma = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "lzma"; };
gnatcoll-omp = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "omp"; };
gnatcoll-python3 = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "python3"; python3 = pkgs.python39; };
gnatcoll-python3 = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "python3"; python3 = pkgs.python312; };
gnatcoll-readline = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "readline"; };
gnatcoll-syslog = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "syslog"; };
gnatcoll-zlib = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "zlib"; };
Expand Down