3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/gaia/default.nix

88 lines
2 KiB
Nix
Raw Normal View History

2019-10-04 08:13:42 +01:00
{ stdenv
, lib
, fetchFromGitHub
, libyaml
, swig
2019-11-29 09:53:15 +00:00
, eigen
2019-10-04 08:13:42 +01:00
, pkgconfig
, wafHook
, makeWrapper
, qt4
, pythonPackages
, pythonSupport ? false
# Default to false since it breaks the build, see https://github.com/MTG/gaia/issues/11
2019-10-04 08:13:42 +01:00
, stlfacadeSupport ? false
, assertsSupport ? true
, cyclopsSupport ? true
}:
assert pythonSupport -> pythonPackages != null;
2019-10-04 08:13:42 +01:00
stdenv.mkDerivation rec {
pname = "gaia";
2019-11-29 09:53:15 +00:00
version = "2.4.6";
2019-10-04 08:13:42 +01:00
src = fetchFromGitHub {
owner = "MTG";
repo = "gaia";
rev = "v${version}";
2019-11-29 09:53:15 +00:00
sha256 = "03vmdq7ca4f7zp2f4sxyqa8sdpdma3mn9fz4z7d93qryl0bhi7z3";
2019-10-04 08:13:42 +01:00
};
# Fix installation error when waf tries to put files in /etc/
prePatch = ''
'' + lib.optionalString cyclopsSupport ''
substituteInPlace src/wscript \
--replace "/etc/cyclops" "$out/etc/cyclops" \
--replace "/etc/init.d" "$out/etc/init.d"
'';
nativeBuildInputs = [
wafHook
pkgconfig
swig
]
# The gaiafusion binary inside $out/bin needs a shebangs patch, and
# wrapping with the appropriate $PYTHONPATH
++ lib.optionals (pythonSupport) [
pythonPackages.wrapPython
]
;
2019-10-04 08:13:42 +01:00
buildInputs = [
libyaml
2019-11-29 09:53:15 +00:00
eigen
2019-10-04 08:13:42 +01:00
qt4
];
propagatedBuildInputs = []
2019-10-04 08:13:42 +01:00
++ lib.optionals (pythonSupport) [
# This is not exactly specified in upstream's README but it's needed by the
# resulting $out/bin/gaiafusion script
pythonPackages.pyyaml
2019-10-04 08:13:42 +01:00
]
;
wafConfigureFlags = []
2019-10-04 08:13:42 +01:00
++ lib.optionals (pythonSupport) [ "--with-python-bindings" ]
++ lib.optionals (stlfacadeSupport) [ "--with-stlfacade" ]
++ lib.optionals (assertsSupport) [ "--with-asserts" ]
++ lib.optionals (cyclopsSupport) [ "--with-cyclops" ]
;
postFixup = ''
''
+ lib.optionalString pythonSupport ''
wrapPythonPrograms
''
;
2019-10-04 08:13:42 +01:00
meta = with lib; {
homepage = "https://github.com/MTG/gaia";
description = "General library to work with points in a semimetric space";
2019-10-04 08:13:42 +01:00
maintainers = with maintainers; [ doronbehar ];
platforms = platforms.x86; # upstream assume SSE2 / fails on ARM
2019-10-04 08:13:42 +01:00
license = licenses.agpl3;
};
}