coriolis/nix/generic.nix

34 lines
1.0 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 ? []
, pythonImportsCheck
}:
let
boostWithPython = boost.override { enablePython = true; inherit (python2Packages) python; };
drv = stdenv.mkDerivation {
pname = "coriolis-${name}";
buildInputs = [ python2Packages.python boostWithPython coriolis-bootstrap ] ++ buildInputs;
nativeBuildInputs = [ cmake ninja python2Packages.pythonImportsCheckHook ] ++ nativeBuildInputs;
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));
}