9 # components built by this derivation other components depend on
13 # component specific extra dependencies
44 # These components are just tools and don't install a library
45 onlyExecutable = builtins.elem component [
51 stdenv.mkDerivation rec {
52 # executables don't adhere to the string gnatcoll-* scheme
55 then builtins.replaceStrings [ "_" ] [ "-" ] component
56 else "gnatcoll-${component}";
59 src = fetchFromGitHub {
63 sha256 = "0q35ii0aa4hh59v768l5cilg1b30a4ckcvlbfy0lkcbp3rcfnbz3";
66 # Link executables dynamically unless specified by the platform,
67 # as we usually do in nixpkgs where possible
68 postPatch = lib.optionalString (!stdenv.hostPlatform.isStatic) ''
69 for f in gnatcoll_db2ada/Makefile gnatinspect/Makefile; do
70 substituteInPlace "$f" --replace "=static" "=relocatable"
80 # Propagate since GPRbuild needs to find referenced .gpr files
81 # and other libraries to link against when static linking is used.
82 # For executables this is of course not relevant and we can reduce
83 # the closure size dramatically
84 ${if onlyExecutable then "buildInputs" else "propagatedBuildInputs"} = [
86 ] ++ libsFor."${component}" or [];
90 "PROCESSORS=$(NIX_BUILD_CORES)"
91 # confusingly, for gprbuild --target is autoconf --host
92 "TARGET=${stdenv.hostPlatform.config}"
93 "prefix=${placeholder "out"}"
94 ] ++ lib.optionals (component == "sqlite") [
95 # link against packaged, not vendored libsqlite3
96 "GNATCOLL_SQLITE=external"
100 description = "GNAT Components Collection - Database packages";
101 homepage = "https://github.com/AdaCore/gnatcoll-db";
102 license = licenses.gpl3Plus;
103 maintainers = [ maintainers.sternenseemann ];
104 platforms = platforms.all;