coriolis/nix/generic.nix

39 lines
1.1 KiB
Nix
Raw Normal View History

2021-08-29 12:36:58 -05:00
{ version, meta }:
let f =
{ lib, stdenv, cmake, ninja, boost
, coriolis-bootstrap, python2Packages }:
{ name
, src
, buildInputs ? []
, nativeBuildInputs ? []
, propagatedBuildInputs ? []
2021-08-29 12:36:58 -05:00
, pythonImportsCheck
}:
let
boostWithPython = boost.override { enablePython = true; inherit (python2Packages) python; };
drv = stdenv.mkDerivation {
pname = "coriolis-${name}";
2021-08-29 13:25:21 -05:00
buildInputs = [ python2Packages.python boostWithPython ] ++ buildInputs;
nativeBuildInputs = [
coriolis-bootstrap cmake ninja
python2Packages.pythonImportsCheckHook
] ++ nativeBuildInputs;
inherit propagatedBuildInputs;
2021-08-29 12:36:58 -05:00
preInstall = ''
export PYTHONPATH="$out/${python2Packages.python.sitePackages}:$PYTHONPATH"
'';
inherit version meta src pythonImportsCheck;
};
in python2Packages.toPythonModule drv;
in
pkg:
{
__functionArgs = builtins.functionArgs f // builtins.functionArgs pkg;
__functor = self: args: f (builtins.intersectAttrs (builtins.functionArgs f) args) (pkg (builtins.intersectAttrs (builtins.functionArgs pkg) args));
}