use recursive build inputs
This commit is contained in:
parent
9e6e045e88
commit
caf5c5e1cf
|
@ -1,15 +1,23 @@
|
||||||
{ stdenv, nim }:
|
{ stdenv, nim }:
|
||||||
|
|
||||||
{ name, src, nimDeps ? [], buildInputs ? [], nativeBuildInputs ? [],
|
{ name, src, nimDeps ? [], buildInputs ? [], patches ? [], patchPhase ? "", ... }:
|
||||||
patches ? [], ... }:
|
|
||||||
|
|
||||||
|
let
|
||||||
|
getRecursiveBuildInputs = deps: with stdenv.lib.lists;
|
||||||
|
optionals (deps != []) ((head deps).buildInputs ++
|
||||||
|
(getRecursiveBuildInputs (head deps).nimDeps) ++
|
||||||
|
(getRecursiveBuildInputs (tail deps)));
|
||||||
|
recursiveBuildInputs = buildInputs ++ (getRecursiveBuildInputs nimDeps);
|
||||||
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = name;
|
name = name;
|
||||||
src = src;
|
src = src;
|
||||||
patches = patches;
|
patches = patches;
|
||||||
buildInputs = [ nim ] ++ buildInputs;
|
nativeBuildInputs = [ nim ];
|
||||||
nativeBuildInputs = nativeBuildInputs;
|
buildInputs = recursiveBuildInputs;
|
||||||
LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath (buildInputs ++ nativeBuildInputs);
|
nimDeps = nimDeps;
|
||||||
|
patchPhase = patchPhase;
|
||||||
|
LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath recursiveBuildInputs;
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
HOME=$TMPDIR
|
HOME=$TMPDIR
|
||||||
mkdir -p $HOME/.nimble/pkgs
|
mkdir -p $HOME/.nimble/pkgs
|
||||||
|
|
Loading…
Reference in New Issue