gnatcoll-*: init gnatcoll-db at 21.0.0
gnatcoll-sql: init at 21.0.0 gnatcoll-sqlite: init at 21.0.0 gnatcoll-xref: init at 21.0.0 gnatcoll-postgres: init at 21.0.0 gnatcoll-db2ada: init at 21.0.0 gnatinspect: init at 21.0.0 Ada database interaction libraries and related tools which are managed in the gnatcoll-db repository. The attribute and derivation names don't include "db" since the GPR project files upstream also don't: They are named `gnatcoll_${component}.gpr` usually, except for the executables.
This commit is contained in:
parent
41f190a360
commit
9bc1e429d0
110
pkgs/development/libraries/ada/gnatcoll/db.nix
Normal file
110
pkgs/development/libraries/ada/gnatcoll/db.nix
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
{ stdenv
|
||||||
|
, lib
|
||||||
|
, fetchFromGitHub
|
||||||
|
, gnat
|
||||||
|
, gprbuild
|
||||||
|
, which
|
||||||
|
, gnatcoll-core
|
||||||
|
, xmlada
|
||||||
|
, 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
|
||||||
|
, postgresql
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
libsFor = {
|
||||||
|
gnatcoll_db2ada = [
|
||||||
|
gnatcoll-sql
|
||||||
|
];
|
||||||
|
gnatinspect = [
|
||||||
|
gnatcoll-sqlite
|
||||||
|
gnatcoll-readline
|
||||||
|
gnatcoll-xref
|
||||||
|
];
|
||||||
|
postgres = [
|
||||||
|
gnatcoll-sql
|
||||||
|
postgresql
|
||||||
|
];
|
||||||
|
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 {
|
||||||
|
pname = "gnatcoll-${component}";
|
||||||
|
version = "21.0.0";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "AdaCore";
|
||||||
|
repo = "gnatcoll-db";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "0fdfng3yfy645nlw8l3c2za0zkn6pdhkvyrw20wnjx4k26glgb6r";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = lib.optionals (component == "sqlite") [
|
||||||
|
# fixes build of the static sqlite component
|
||||||
|
# when building against the system libsqlite3
|
||||||
|
# See https://github.com/AdaCore/gprbuild/issues/27#issuecomment-298444608
|
||||||
|
./gnatcoll-db-sqlite-static-external.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
# 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.optional (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;
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
diff --git a/sqlite/gnatcoll_sqlite.gpr b/sqlite/gnatcoll_sqlite.gpr
|
||||||
|
index 5bd53d35..580739f8 100644
|
||||||
|
--- a/sqlite/gnatcoll_sqlite.gpr
|
||||||
|
+++ b/sqlite/gnatcoll_sqlite.gpr
|
||||||
|
@@ -69,7 +69,12 @@ project GnatColl_Sqlite is
|
||||||
|
for Source_Dirs use (".", "amalgamation");
|
||||||
|
when "external" =>
|
||||||
|
for Source_Dirs use (".");
|
||||||
|
- for Library_Options use ("-lsqlite3") & Thread_Lib;
|
||||||
|
+ case Library_Type is
|
||||||
|
+ when "relocatable" =>
|
||||||
|
+ for Library_Options use ("-lsqlite3") & Thread_Lib;
|
||||||
|
+ when others =>
|
||||||
|
+ null;
|
||||||
|
+ end case;
|
||||||
|
end case;
|
||||||
|
|
||||||
|
package Compiler is
|
|
@ -13732,6 +13732,14 @@ in
|
||||||
|
|
||||||
global = callPackage ../development/tools/misc/global { };
|
global = callPackage ../development/tools/misc/global { };
|
||||||
|
|
||||||
|
gnatcoll-db2ada = callPackage ../development/libraries/ada/gnatcoll/db.nix {
|
||||||
|
component = "gnatcoll_db2ada";
|
||||||
|
};
|
||||||
|
|
||||||
|
gnatinspect = callPackage ../development/libraries/ada/gnatcoll/db.nix {
|
||||||
|
component = "gnatinspect";
|
||||||
|
};
|
||||||
|
|
||||||
gnome-doc-utils = callPackage ../development/tools/documentation/gnome-doc-utils {};
|
gnome-doc-utils = callPackage ../development/tools/documentation/gnome-doc-utils {};
|
||||||
|
|
||||||
gnome-desktop-testing = callPackage ../development/tools/gnome-desktop-testing {};
|
gnome-desktop-testing = callPackage ../development/tools/gnome-desktop-testing {};
|
||||||
|
@ -15622,6 +15630,12 @@ in
|
||||||
gnatcoll-syslog = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "syslog"; };
|
gnatcoll-syslog = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "syslog"; };
|
||||||
gnatcoll-zlib = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "zlib"; };
|
gnatcoll-zlib = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "zlib"; };
|
||||||
|
|
||||||
|
# gnatcoll-db repository
|
||||||
|
gnatcoll-postgres = callPackage ../development/libraries/ada/gnatcoll/db.nix { component = "postgres"; };
|
||||||
|
gnatcoll-sql = callPackage ../development/libraries/ada/gnatcoll/db.nix { component = "sql"; };
|
||||||
|
gnatcoll-sqlite = callPackage ../development/libraries/ada/gnatcoll/db.nix { component = "sqlite"; };
|
||||||
|
gnatcoll-xref = callPackage ../development/libraries/ada/gnatcoll/db.nix { component = "xref"; };
|
||||||
|
|
||||||
gns3Packages = dontRecurseIntoAttrs (callPackage ../applications/networking/gns3 { });
|
gns3Packages = dontRecurseIntoAttrs (callPackage ../applications/networking/gns3 { });
|
||||||
gns3-gui = gns3Packages.guiStable;
|
gns3-gui = gns3Packages.guiStable;
|
||||||
gns3-server = gns3Packages.serverStable;
|
gns3-server = gns3Packages.serverStable;
|
||||||
|
|
Loading…
Reference in a new issue