push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
{
stdenv,
lib,
fetchFromGitHub,
gnat,
gprbuild,
gnatcoll-core,
component,
# component dependencies
gmp,
libiconv,
xz,
readline,
zlib,
python3,
ncurses,
}:
let
# omit python (2.7), no need to introduce a
# dependency on an EOL package for no reason
libsFor = {
iconv = [ libiconv ];
gmp = [ gmp ];
lzma = [ xz ];
readline = [ readline ];
python3 = [
python3
ncurses
];
syslog = [ ];
zlib = [ zlib ];
cpp = [ ];
};
in
stdenv.mkDerivation rec {
pname = "gnatcoll-${component}";
version = "25.0.0";
src = fetchFromGitHub {
owner = "AdaCore";
repo = "gnatcoll-bindings";
rev = "v${version}";
sha256 = "0ayc7zvv8w90v0xzhrjk2x88zrsk62xxcm27ya9crlp6affn5idk";
};
nativeBuildInputs = [
gprbuild
gnat
python3
];
# propagate since gprbuild needs to find referenced .gpr files
# and all dependency C libraries when statically linking a
# downstream executable.
propagatedBuildInputs = [
gnatcoll-core
]
++ libsFor."${component}" or [ ];
# 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") [
"--accept-gpl"
];
buildPhase = ''
runHook preBuild
${python3.interpreter} ${component}/setup.py build --prefix $out $buildFlags
runHook postBuild
'';
installPhase = ''
runHook preInstall
${python3.interpreter} ${component}/setup.py install --prefix $out
runHook postInstall
'';
meta = with lib; {
description = "GNAT Components Collection - Bindings to C libraries";
homepage = "https://github.com/AdaCore/gnatcoll-bindings";
license = licenses.gpl3Plus;
platforms = platforms.all;
maintainers = [ maintainers.sternenseemann ];
};
}

View File

@@ -0,0 +1,88 @@
{
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;
};
}

View File

@@ -0,0 +1,111 @@
{
stdenv,
lib,
fetchFromGitHub,
gnat,
gprbuild,
which,
gnatcoll-core,
component,
# components built by this derivation other components depend on
gnatcoll-sql,
gnatcoll-sqlite,
gnatcoll-xref,
# component specific extra dependencies
gnatcoll-iconv,
gnatcoll-readline,
sqlite,
libpq,
}:
let
libsFor = {
gnatcoll_db2ada = [
gnatcoll-sql
];
gnatinspect = [
gnatcoll-sqlite
gnatcoll-readline
gnatcoll-xref
];
postgres = [
gnatcoll-sql
libpq
];
sqlite = [
gnatcoll-sql
sqlite
];
xref = [
gnatcoll-iconv
gnatcoll-sqlite
];
};
# These components are just tools and don't install a library
onlyExecutable = builtins.elem component [
"gnatcoll_db2ada"
"gnatinspect"
];
in
stdenv.mkDerivation rec {
# executables don't adhere to the string gnatcoll-* scheme
pname =
if onlyExecutable then
builtins.replaceStrings [ "_" ] [ "-" ] component
else
"gnatcoll-${component}";
version = "25.0.0";
src = fetchFromGitHub {
owner = "AdaCore";
repo = "gnatcoll-db";
rev = "v${version}";
sha256 = "0q35ii0aa4hh59v768l5cilg1b30a4ckcvlbfy0lkcbp3rcfnbz3";
};
# Link executables dynamically unless specified by the platform,
# as we usually do in nixpkgs where possible
postPatch = lib.optionalString (!stdenv.hostPlatform.isStatic) ''
for f in gnatcoll_db2ada/Makefile gnatinspect/Makefile; do
substituteInPlace "$f" --replace "=static" "=relocatable"
done
'';
nativeBuildInputs = [
gnat
gprbuild
which
];
# Propagate since GPRbuild needs to find referenced .gpr files
# and other libraries to link against when static linking is used.
# For executables this is of course not relevant and we can reduce
# the closure size dramatically
${if onlyExecutable then "buildInputs" else "propagatedBuildInputs"} = [
gnatcoll-core
]
++ libsFor."${component}" or [ ];
makeFlags = [
"-C"
component
"PROCESSORS=$(NIX_BUILD_CORES)"
# confusingly, for gprbuild --target is autoconf --host
"TARGET=${stdenv.hostPlatform.config}"
"prefix=${placeholder "out"}"
]
++ lib.optionals (component == "sqlite") [
# link against packaged, not vendored libsqlite3
"GNATCOLL_SQLITE=external"
];
meta = with lib; {
description = "GNAT Components Collection - Database packages";
homepage = "https://github.com/AdaCore/gnatcoll-db";
license = licenses.gpl3Plus;
maintainers = [ maintainers.sternenseemann ];
platforms = platforms.all;
};
}