1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-17 21:11:34 +03:00
mobile-nixos/overlay/dtbtool/default.nix

53 lines
978 B
Nix
Raw Normal View History

2018-06-25 23:26:50 +03:00
{
stdenv
, fetchurl
, python2
, python2Packages
, buildPackages
}:
let
inherit (buildPackages) dtc;
in
2018-06-10 03:57:12 +03:00
stdenv.mkDerivation {
name = "dtbtool";
version = "1.6.0";
src = fetchurl {
url = "https://source.codeaurora.org/quic/kernel/skales/plain/dtbTool?id=1.6.0";
sha256 = "0lbzpqbar0fr9y53v95v0yrrn2pnm8m1wj43h3l83f7awqma68x2";
};
patches = [
./00_fix_version_detection.patch
./01_find_dtb_in_subfolders.patch
];
buildInputs = [
python2
];
nativeBuildInputs = [
python2Packages.wrapPython
dtc
];
pythonPath = [ dtc ];
postPatch = ''
substituteInPlace dtbTool \
--replace "libfdt.so" "${dtc}/lib/libfdt.so"
'';
unpackCmd = "mkdir out; cp $curSrc out/dtbTool";
installPhase = ''
patchShebangs ./
mkdir -p $out/bin
cp -v dtbTool $out/bin/
chmod +x $out/bin/dtbTool
wrapPythonPrograms
'';
# TODO meta url : https://source.codeaurora.org/quic/kernel/skales/plain/dtbTool
}