diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2019-09-17 19:35:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-17 19:35:44 -0400 |
commit | 1bc7fae62d711ea7e7cfd833437faf6aecb6915c (patch) | |
tree | 40a0f19c0f7d800d34c0f0e3d6fd1adafd02d399 /pkgs/development/compilers/dtc | |
parent | 9566ec034b9515ba2487d3625664109b59ca46f1 (diff) | |
parent | 35f39ac48ce6ed046b7dcce3ee6e8e9162ac12aa (diff) |
Merge pull request #68889 from nspin/pr/various-cross-2
Various cross-compilation fixes
Diffstat (limited to 'pkgs/development/compilers/dtc')
-rw-r--r-- | pkgs/development/compilers/dtc/default.nix | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/development/compilers/dtc/default.nix b/pkgs/development/compilers/dtc/default.nix index 6c47cbcd3a57..d92d712a3ff7 100644 --- a/pkgs/development/compilers/dtc/default.nix +++ b/pkgs/development/compilers/dtc/default.nix @@ -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 |