blob: bbcaff3a1c6a8199ed2ecf73c1b52d232ecfc7a1 (
plain) (
blame)
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
|
{
lib,
stdenv,
mkDerivation,
compatIfNeeded,
compatIsNeeded,
libmd,
libnetbsd,
libutil,
}:
mkDerivation {
path = "contrib/mtree";
extraPaths = [ "contrib/mknod" ];
buildInputs =
compatIfNeeded
++ [
libmd
libnetbsd
]
++ lib.optional (stdenv.isFreeBSD) libutil;
postPatch = ''
ln -s $BSDSRCDIR/contrib/mknod/*.c $BSDSRCDIR/contrib/mknod/*.h $BSDSRCDIR/contrib/mtree
'';
preBuild = ''
export NIX_LDFLAGS="$NIX_LDFLAGS ${
toString (
[
"-lmd"
"-lnetbsd"
]
++ lib.optional compatIsNeeded "-legacy"
++ lib.optional stdenv.isFreeBSD "-lutil"
)
}"
'';
}
|