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