diff --git a/flake.nix b/flake.nix index 63167eef..f168baa2 100644 --- a/flake.nix +++ b/flake.nix @@ -36,8 +36,6 @@ generic = import ./nix/generic.nix { inherit version meta; }; - # not generic: solstice lefdef equinox knik coloquinte bootstrap - pythonComponents = [ "vlsisapd" "hurricane" "crlcore" "flute" "etesian" "anabatic" "katana" "bora" "katabatic" "kite" diff --git a/nix/crlcore.nix b/nix/crlcore.nix index f8a85cc1..57a2cccb 100644 --- a/nix/crlcore.nix +++ b/nix/crlcore.nix @@ -1,20 +1,19 @@ { generic, ... }: let pkg = - { libxml2, qt4, bison, flex, doxygen, coriolis-vlsisapd + { lib, libxml2, qt4, bison, flex, doxygen, coriolis-vlsisapd , coriolis-lefdef, coriolis-hurricane, python2Packages }: { name = "crlcore"; src = ../crlcore; - buildInputs = [ libxml2 qt4 coriolis-lefdef coriolis-vlsisapd coriolis-hurricane python2Packages.pyqt4 python2Packages.sip_4 ]; + buildInputs = [ libxml2 qt4 coriolis-lefdef coriolis-vlsisapd coriolis-hurricane python2Packages.pyqt4 ]; nativeBuildInputs = [ bison flex doxygen python2Packages.pyqt4 ]; pythonImportsCheck = [ "CRL" "Constant" "helpers.io" "helpers.technology" "helpers.utils" "helpers.analogtechno" "helpers" "helpers.overlay" ]; - continuation = drv: drv.overrideAttrs (o: { - postInstall = (o.postInstall or "") + '' - ln -s crlcore/helpers $out/${python2Packages.python.sitePackages}/helpers - ''; - }); + postInstall = '' + ln -s crlcore/helpers $out/${python2Packages.python.sitePackages}/helpers + ''; + meta.license = lib.licenses.gpl2Plus; }; in generic pkg diff --git a/nix/generic.nix b/nix/generic.nix index 24ebe73c..f16a0517 100644 --- a/nix/generic.nix +++ b/nix/generic.nix @@ -1,35 +1,41 @@ { version, meta }: -let f = - { lib, stdenv, cmake, ninja, boost - , coriolis-bootstrap, python2Packages }: - { name - , src - , buildInputs ? [] - , nativeBuildInputs ? [] - , propagatedBuildInputs ? [] - , pythonImportsCheck - , continuation ? (x: x) - }: - let - boostWithPython = boost.override { enablePython = true; inherit (python2Packages) python; }; - drv = stdenv.mkDerivation { - pname = "coriolis-${name}"; +let + meta' = meta; + f = + { lib, stdenv, cmake, ninja, boost + , coriolis-bootstrap, python2Packages }: + let self = + { name + , buildInputs ? [] + , nativeBuildInputs ? [] + , meta ? {} + , pythonImportsCheck + , continuation ? (x: x) + , ... + }@args': + let + args = builtins.removeAttrs args' (builtins.attrNames (builtins.functionArgs self)); + boostWithPython = boost.override { enablePython = true; inherit (python2Packages) python; }; + drv = stdenv.mkDerivation ({ + pname = "coriolis-${name}"; - buildInputs = [ python2Packages.python boostWithPython ] ++ buildInputs; - nativeBuildInputs = [ - coriolis-bootstrap cmake ninja - python2Packages.pythonImportsCheckHook - ] ++ nativeBuildInputs; - inherit propagatedBuildInputs; + buildInputs = [ python2Packages.python boostWithPython ] ++ buildInputs; + nativeBuildInputs = [ + coriolis-bootstrap cmake ninja + python2Packages.pythonImportsCheckHook + ] ++ nativeBuildInputs; - preInstall = '' - export PYTHONPATH="$out/${python2Packages.python.sitePackages}:$PYTHONPATH" - ''; + preInstall = '' + export PYTHONPATH="$out/${python2Packages.python.sitePackages}:$PYTHONPATH" + ''; - inherit version meta src pythonImportsCheck; - }; - in continuation (python2Packages.toPythonModule drv); + meta = meta // meta'; + + inherit version pythonImportsCheck; + } // args); + in continuation (python2Packages.toPythonModule drv); + in self; in pkg: diff --git a/nix/hurricane.nix b/nix/hurricane.nix index 7af6fb9e..9ce5ab67 100644 --- a/nix/hurricane.nix +++ b/nix/hurricane.nix @@ -8,6 +8,6 @@ let pkg = buildInputs = [ libxml2 qt4 bzip2 rapidjson coriolis-vlsisapd ]; nativeBuildInputs = [ bison flex doxygen ]; pythonImportsCheck = [ "Viewer" "Hurricane" "Cfg2" "Analog" ]; - continuation = drv: drv.overrideAttrs (o: { meta = o.meta // { license = lib.licenses.lgpl3Plus; }); + meta.license = lib.licenses.lgpl3Plus; }; in generic pkg