allow packages to define nativeBuildInputs
This commit is contained in:
parent
83b84fc0bd
commit
5fc2820dda
|
@ -1,23 +1,29 @@
|
||||||
{ stdenv, nim }:
|
{ stdenv, nim }:
|
||||||
|
|
||||||
{ name, src, nimDeps ? [], buildInputs ? [], patches ? [], patchPhase ? "", ... }:
|
{ name, src, nimDeps ? [], nativeBuildInputs ? [], buildInputs ? [],
|
||||||
|
patches ? [], patchPhase ? "", ... }:
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
getRecursiveBuildInputs = deps: with stdenv.lib.lists;
|
getRecursiveInputs = getInputsFn: deps:
|
||||||
optionals (deps != []) ((head deps).buildInputs ++
|
optionals (deps != []) ((getInputsFn (head deps)) ++
|
||||||
(getRecursiveBuildInputs (head deps).nimDeps) ++
|
(getRecursiveInputs getInputsFn (head deps).nimDeps) ++
|
||||||
(getRecursiveBuildInputs (tail deps)));
|
(getRecursiveInputs getInputsFn (tail deps)));
|
||||||
recursiveBuildInputs = buildInputs ++ (getRecursiveBuildInputs nimDeps);
|
rNativeBuildInputs =
|
||||||
|
nativeBuildInputs ++ (getRecursiveInputs (i: i.nativeBuildInputs) nimDeps);
|
||||||
|
rBuildInputs =
|
||||||
|
buildInputs ++ (getRecursiveInputs (i: i.buildInputs) nimDeps);
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = name;
|
name = name;
|
||||||
src = src;
|
src = src;
|
||||||
patches = patches;
|
patches = patches;
|
||||||
nativeBuildInputs = [ nim ];
|
nativeBuildInputs = [ nim ] ++ (filter (i: i != nim) rNativeBuildInputs);
|
||||||
buildInputs = recursiveBuildInputs;
|
buildInputs = rBuildInputs;
|
||||||
nimDeps = nimDeps;
|
nimDeps = nimDeps;
|
||||||
patchPhase = patchPhase;
|
patchPhase = patchPhase;
|
||||||
LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath recursiveBuildInputs;
|
LD_LIBRARY_PATH = makeLibraryPath (rBuildInputs ++ rNativeBuildInputs);
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
HOME=$TMPDIR
|
HOME=$TMPDIR
|
||||||
mkdir -p $HOME/.nimble/pkgs
|
mkdir -p $HOME/.nimble/pkgs
|
||||||
|
|
|
@ -18,7 +18,9 @@ buildNimblePackage rec {
|
||||||
rm ui/libui/darwin/OLD_table.m
|
rm ui/libui/darwin/OLD_table.m
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [ pkg-config gtk3 ];
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
|
||||||
|
buildInputs = [ gtk3 ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Beginnings of what might become Nim's official UI library";
|
description = "Beginnings of what might become Nim's official UI library";
|
||||||
|
|
Loading…
Reference in New Issue