dtc: make python bindings optional
dtc's build system does not support cross-compilation of its swig-generated python bindings.
This commit is contained in:
parent
101947774c
commit
35f39ac48c
@ -1,4 +1,6 @@
|
|||||||
{ stdenv, fetchgit, flex, bison, pkgconfig, python2, swig, which }:
|
{ stdenv, lib, fetchgit, flex, bison, pkgconfig, which
|
||||||
|
, pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform, python2, swig
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "dtc";
|
pname = "dtc";
|
||||||
@ -10,16 +12,17 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "075gj8bbahfdb8dlif3d2dpzjrkyf3bwbcmx96zpwhlgs0da8jxh";
|
sha256 = "075gj8bbahfdb8dlif3d2dpzjrkyf3bwbcmx96zpwhlgs0da8jxh";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ flex bison pkgconfig swig which ];
|
nativeBuildInputs = [ flex bison pkgconfig which ] ++ lib.optionals pythonSupport [ python2 swig ];
|
||||||
buildInputs = [ python2 ];
|
buildInputs = lib.optionals pythonSupport [ python2 ];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
patchShebangs pylibfdt/
|
patchShebangs pylibfdt/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
makeFlags = lib.optionals (!pythonSupport) [ "NO_PYTHON=1" ];
|
||||||
installFlags = [ "INSTALL=install" "PREFIX=$(out)" "SETUP_PREFIX=$(out)" ];
|
installFlags = [ "INSTALL=install" "PREFIX=$(out)" "SETUP_PREFIX=$(out)" ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with lib; {
|
||||||
description = "Device Tree Compiler";
|
description = "Device Tree Compiler";
|
||||||
homepage = https://git.kernel.org/cgit/utils/dtc/dtc.git;
|
homepage = https://git.kernel.org/cgit/utils/dtc/dtc.git;
|
||||||
license = licenses.gpl2; # dtc itself is GPLv2, libfdt is dual GPL/BSD
|
license = licenses.gpl2; # dtc itself is GPLv2, libfdt is dual GPL/BSD
|
||||||
|
Loading…
x
Reference in New Issue
Block a user