gnatcoll-*: init gnatcoll-bindings at 21.0.0
gnatcoll-gmp: init at 21.0.0 gnatcoll-iconv: init at 21.0.0 gnatcoll-lzma: init at 21.0.0 gnatcoll-omp: init at 21.0.0 gnatcoll-python3: init at 21.0.0 gnatcoll-readline: init at 21.0.0 gnatcoll-syslog: init at 21.0.0 gnatcoll-zlib: init at 21.0.0 This inits a bunch of gnatcoll-* packages which are managed in the gnatcoll-bindings repository. I have chosen not to include "bindings" in their derivation or attribute names, since the GPR project definitions themselves all don't contain that as well, instead they are name `gnatcoll_${component}.gpr`.
This commit is contained in:
parent
f4e018075e
commit
41f190a360
88
pkgs/development/libraries/ada/gnatcoll/bindings.nix
Normal file
88
pkgs/development/libraries/ada/gnatcoll/bindings.nix
Normal file
|
@ -0,0 +1,88 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, gnat
|
||||
, gprbuild
|
||||
, gnatcoll-core
|
||||
, component
|
||||
# component dependencies
|
||||
, gmp
|
||||
, libiconv
|
||||
, xz
|
||||
, gcc-unwrapped
|
||||
, 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 ];
|
||||
};
|
||||
in
|
||||
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gnatcoll-${component}";
|
||||
version = "21.0.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "AdaCore";
|
||||
repo = "gnatcoll-bindings";
|
||||
rev = "v${version}";
|
||||
sha256 = "1214hf0m8iz289rjpxdiddnixj65l2xjwbcr7mq5ysbddmig5992";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./omp-setup-text-mode.patch
|
||||
];
|
||||
|
||||
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 upstreams
|
||||
# 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 ${component}/setup.py build $buildFlags
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
python3 ${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 ];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
commit 37c815ee660d1bf37256638d23b0346ad7cc19e7
|
||||
Author: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>
|
||||
Date: Wed Jul 21 00:18:30 2021 +0200
|
||||
|
||||
omp/setup.py: open version_information in text mode
|
||||
|
||||
Otherwise saving the config in setup_support.py will fail as a bytes
|
||||
object is not encodeable as JSON. Luckily, version_information is text
|
||||
anyways.
|
||||
|
||||
diff --git a/omp/setup.py b/omp/setup.py
|
||||
index 942ab1f5..5281398e 100755
|
||||
--- a/omp/setup.py
|
||||
+++ b/omp/setup.py
|
||||
@@ -25,7 +25,7 @@ class GNATCollOMP(SetupApp):
|
||||
|
||||
# Set library version
|
||||
with open(os.path.join(config.source_dir, '..',
|
||||
- 'version_information'), 'rb') as fd:
|
||||
+ 'version_information'), 'r') as fd:
|
||||
version = fd.read().strip()
|
||||
config.set_data('GNATCOLL_VERSION', version, sub='gprbuild')
|
||||
|
|
@ -15612,6 +15612,16 @@ in
|
|||
|
||||
gnatcoll-core = callPackage ../development/libraries/ada/gnatcoll/core.nix { };
|
||||
|
||||
# gnatcoll-bindings repository
|
||||
gnatcoll-gmp = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "gmp"; };
|
||||
gnatcoll-iconv = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "iconv"; };
|
||||
gnatcoll-lzma = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "lzma"; };
|
||||
gnatcoll-omp = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "omp"; };
|
||||
gnatcoll-python3 = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "python3"; };
|
||||
gnatcoll-readline = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "readline"; };
|
||||
gnatcoll-syslog = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "syslog"; };
|
||||
gnatcoll-zlib = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "zlib"; };
|
||||
|
||||
gns3Packages = dontRecurseIntoAttrs (callPackage ../applications/networking/gns3 { });
|
||||
gns3-gui = gns3Packages.guiStable;
|
||||
gns3-server = gns3Packages.serverStable;
|
||||
|
|
Loading…
Reference in a new issue