blob: 71d0c1e50d5ea9d90026b3656266b375990f1be0 (
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
40
41
42
43
44
45
46
47
48
49
|
{
lib,
stdenv,
mkDerivation,
freebsdSetupHook,
bsdSetupHook,
makeMinimal,
}:
mkDerivation {
path = "lib/libmd";
extraPaths = [
"sys/sys/md5.h"
"sys/crypto/sha2"
"sys/crypto/skein"
];
nativeBuildInputs = [
makeMinimal
bsdSetupHook
freebsdSetupHook
];
makeFlags = [
"STRIP=-s" # flag to install, not command
"RELDIR=."
] ++ lib.optional (!stdenv.hostPlatform.isFreeBSD) "MK_WERROR=no";
preBuild = ''
mkdir sys
'';
installPhase = ''
# libmd is used by install. do it yourself!
mkdir -p $out/include $out/lib $man/share/man
cp libmd.a $out/lib/libmd.a
for f in $(make $makeFlags -V INCS); do
if [ -e "$f" ]; then cp "$f" "$out/include/$f"; fi
if [ -e "$BSDSRCDIR/sys/crypto/sha2/$f" ]; then cp "$BSDSRCDIR/sys/crypto/sha2/$f" "$out/include/$f"; fi
if [ -e "$BSDSRCDIR/sys/crypto/skein/$f" ]; then cp "$BSDSRCDIR/sys/crypto/skein/$f" "$out/include/$f"; fi
done
for f in $(make $makeFlags -V MAN); do
cp "$f" "$man/share/man/$f"
done
'';
outputs = [
"out"
"man"
];
}
|