-
Notifications
You must be signed in to change notification settings - Fork 389
Expand file tree
/
Copy pathdefault.nix
More file actions
48 lines (41 loc) · 1.05 KB
/
default.nix
File metadata and controls
48 lines (41 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
pkgs,
stdenv
}:
let
self = stdenv.mkDerivation rec {
pname = "libfdt";
version = "1.7.2";
src = pkgs.fetchzip {
url = "https://mirrors.edge.kernel.org/pub/software/utils/dtc/dtc-${version}.tar.xz";
hash = "sha256-KZCzrvdWd6zfQHppjyp4XzqNCfH2UnuRneu+BNIRVAY=";
};
meta.license = pkgs.lib.licenses.bsd2;
nativeBuildInputs = with pkgs.buildPackages; [
pkg-config flex bison
];
outputs = [ "out" "dev" ];
patches = [
./clang-no-suggest-attr-format.patch # TODO: upstream
];
buildPhase = ''
runHook preBuild
make -j"$NIX_BUILD_CORES" libfdt/libfdt.a
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D -m644 -t "$out/lib/" libfdt/libfdt.a
install -D -m644 -t "$dev/include/fdt" libfdt/*.h
runHook postInstall
'';
};
dev = pkgs.lib.getDev self;
in
self.overrideAttrs (prev: {
passthru = {
include_root = "${dev}/include";
include = "${dev}/include/fdt";
lib = "${self}/lib";
};
})