2021-02-05 17:12:51 +00:00
|
|
|
{ stdenv, lib, fetchgit, flex, bison, pkg-config, which
|
2021-08-05 21:33:18 +00:00
|
|
|
, pythonSupport ? false, python ? null, swig, libyaml
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dtc";
|
2020-06-18 07:06:33 +00:00
|
|
|
version = "1.6.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://git.kernel.org/pub/scm/utils/dtc/dtc.git";
|
|
|
|
rev = "refs/tags/v${version}";
|
2020-06-18 07:06:33 +00:00
|
|
|
sha256 = "0li992wwd7kgy71bikanqky49y4hq3p3vx35p2hvyxy1k0wfy7i8";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-12 18:23:04 +00:00
|
|
|
buildInputs = [ libyaml ];
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ flex bison pkg-config which ] ++ lib.optionals pythonSupport [ python swig ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs pylibfdt/
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "PYTHON=python" ];
|
|
|
|
installFlags = [ "INSTALL=install" "PREFIX=$(out)" "SETUP_PREFIX=$(out)" ];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
# Checks are broken on aarch64 darwin
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/118700#issuecomment-885892436
|
|
|
|
doCheck = !stdenv.isDarwin;
|
2021-04-12 18:23:04 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Device Tree Compiler";
|
|
|
|
homepage = "https://git.kernel.org/cgit/utils/dtc/dtc.git";
|
2021-04-12 18:23:04 +00:00
|
|
|
license = licenses.gpl2Plus; # dtc itself is GPLv2, libfdt is dual GPL/BSD
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.dezgeg ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|