-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdwarfs.nix
109 lines (100 loc) · 1.66 KB
/
dwarfs.nix
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{ stdenv
, lib
, fetchFromGitHub
, bison
, cmake
, diffutils
, fmt_8
, gnutar
, pkg-config
, ronn
, boost
, bzip2
, double-conversion
, fuse
, glog
, gtest
, jemalloc
, libaio
, libarchive
, libelf
, libevent
, libiberty
, libsodium
, libunwind
, lz4
, lzma
, openssl
, snappy
, xxHash
, zlib
, zstd
}:
stdenv.mkDerivation rec {
pname = "dwarfs";
version = "0.6.1";
src = fetchFromGitHub {
owner = "mhx";
repo = "dwarfs";
rev = "v${version}";
hash = "sha256-bGJkgcq8JxueRTX08QpJv1A0O5wXbiIgUY7BrY0Ln/M=";
fetchSubmodules = true;
};
buildInputs = [
boost
bzip2
double-conversion
fuse
glog
gtest
libarchive
libelf
libevent
libiberty
libsodium
libunwind
lz4
lzma
openssl
snappy
xxHash
zlib
zstd
] ++ lib.optionals stdenv.isLinux [
jemalloc
libaio
];
nativeBuildInputs = [
bison
cmake
fmt_8
pkg-config
ronn
];
nativeCheckInputs = [
diffutils
gnutar
];
cmakeFlags = [
"-DWITH_TESTS=ON"
"-DPREFER_SYSTEM_GTEST=ON"
"-DPREFER_SYSTEM_ZSTD=ON"
"-DPREFER_SYSTEM_XXHASH=ON"
] ++ lib.optionals (!stdenv.isLinux) [
"-DUSE_JEMALLOC=OFF"
];
postPatch = ''
substituteInPlace cmake/version.cmake \
--replace 'git log --pretty=format:%h -n 1' 'echo nix:v${version}' \
--replace 'git describe --tags --match "v*" --dirty' 'echo v${version}' \
--replace 'git rev-parse --abbrev-ref HEAD' 'echo main'
'';
NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [
"-DTARGET_OS_SIMULATOR=0"
"-DTARGET_OS_IPHONE=0"
"-DTARGET_IPHONE_SIMULATOR=0"
];
meta = {
broken = stdenv.isDarwin;
};
}