Add generic helper
This commit is contained in:
parent
7105a5aea4
commit
41665edfed
|
@ -33,6 +33,10 @@
|
||||||
cmakeFlags = [ "-DBUILD_DOC=ON" ] ++ (o.cmakeFlags or []);
|
cmakeFlags = [ "-DBUILD_DOC=ON" ] ++ (o.cmakeFlags or []);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
generic = import ./nix/generic.nix { inherit version meta; };
|
||||||
|
|
||||||
|
# not generic: solstice lefdef equinox knik coloquinte bootstrap
|
||||||
|
|
||||||
components = [
|
components = [
|
||||||
"vlsisapd" "lefdef" "bootstrap" "hurricane" "crlcore"
|
"vlsisapd" "lefdef" "bootstrap" "hurricane" "crlcore"
|
||||||
"cumulus" "flute" "etesian" "anabatic" "coloquinte"
|
"cumulus" "flute" "etesian" "anabatic" "coloquinte"
|
||||||
|
@ -42,6 +46,8 @@
|
||||||
"unittests"
|
"unittests"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
commonArgs = { inherit version meta generic; };
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
@ -49,7 +55,8 @@
|
||||||
builtins.foldl'
|
builtins.foldl'
|
||||||
(acc: elem: acc // {
|
(acc: elem: acc // {
|
||||||
"coriolis-${elem}" = override (final.callPackage (
|
"coriolis-${elem}" = override (final.callPackage (
|
||||||
import "${self}/nix/${elem}.nix" { inherit version meta; }
|
let f = import (./nix + "/${elem}.nix"); in
|
||||||
|
f (builtins.intersectAttrs (builtins.functionArgs f) commonArgs)
|
||||||
) {});
|
) {});
|
||||||
}) {} components;
|
}) {} components;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
{ 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));
|
||||||
|
}
|
|
@ -1,18 +1,11 @@
|
||||||
{ version, meta }:
|
{ version, meta, generic, ... }:
|
||||||
|
let pkg =
|
||||||
{ lib, stdenv, cmake, boost, bison, flex
|
{ libxml2, qt4, bison, flex, doxygen }:
|
||||||
, libxml2, qt4, ninja, coriolis-bootstrap, doxygen
|
{
|
||||||
, python2Packages }:
|
name = "vlsisapd";
|
||||||
|
|
||||||
let boostWithPython = boost.override { enablePython = true; inherit (python2Packages) python; }; in
|
|
||||||
|
|
||||||
python2Packages.toPythonModule (stdenv.mkDerivation {
|
|
||||||
pname = "coriolis-vlsisapd";
|
|
||||||
|
|
||||||
src = ../vlsisapd;
|
src = ../vlsisapd;
|
||||||
|
buildInputs = [ libxml2 qt4 ];
|
||||||
buildInputs = [ python2Packages.python boostWithPython coriolis-bootstrap libxml2 bison flex qt4 ];
|
nativeBuildInputs = [ bison flex doxygen ];
|
||||||
nativeBuildInputs = [ cmake ninja doxygen ];
|
pythonImportsCheck = [ "SPICE" "LIBERTY" "DTR" "Cfg" "CIF" "AGDS" ];
|
||||||
|
};
|
||||||
inherit version meta;
|
in generic pkg
|
||||||
})
|
|
||||||
|
|
Loading…
Reference in New Issue