Merge pull request #68889 from nspin/pr/various-cross-2

Various cross-compilation fixes
This commit is contained in:
Matthew Bauer
2019-09-17 19:35:44 -04:00
committed by GitHub
5 changed files with 51 additions and 11 deletions

View File

@@ -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 {
pname = "dtc";
@@ -10,16 +12,17 @@ stdenv.mkDerivation rec {
sha256 = "1jhhfrg22h53lvm2lqhd66pyk20pil08ry03wcwyx1c3ln27k73z";
};
nativeBuildInputs = [ flex bison pkgconfig swig which ];
buildInputs = [ python2 ];
nativeBuildInputs = [ flex bison pkgconfig which ] ++ lib.optionals pythonSupport [ python2 swig ];
buildInputs = lib.optionals pythonSupport [ python2 ];
postPatch = ''
patchShebangs pylibfdt/
'';
makeFlags = lib.optionals (!pythonSupport) [ "NO_PYTHON=1" ];
installFlags = [ "INSTALL=install" "PREFIX=$(out)" "SETUP_PREFIX=$(out)" ];
meta = with stdenv.lib; {
meta = with lib; {
description = "Device Tree Compiler";
homepage = https://git.kernel.org/cgit/utils/dtc/dtc.git;
license = licenses.gpl2; # dtc itself is GPLv2, libfdt is dual GPL/BSD