Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
2025-04-08 02:57:25 -04:00

89 lines
2.1 KiB
Nix

{
stdenv,
lib,
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 = "25.0.0";
src = fetchFromGitHub {
owner = "AdaCore";
repo = "gnatcoll-core";
rev = "v${version}";
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 = 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";
license = licenses.gpl3Plus;
maintainers = [ maintainers.sternenseemann ];
platforms = platforms.all;
};
}