-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathliboqs.nix
49 lines (41 loc) · 1.19 KB
/
liboqs.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
{
lib,
stdenv,
fetchFromGitHub,
cmake,
openssl,
enableStatic ? stdenv.hostPlatform.isStatic,
}:
stdenv.mkDerivation rec {
pname = "liboqs";
version = "0.11.0";
src = fetchFromGitHub {
owner = "open-quantum-safe";
repo = pname;
rev = version;
sha256 = "sha256-+Gx1JPrJoeMix9DIF0rJQTivxN1lgaCIYFvJ1pnYZzM=";
};
# patches = [ ./fix-openssl-detection.patch ];
nativeBuildInputs = [ cmake ];
buildInputs = [ openssl ];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=${if enableStatic then "OFF" else "ON"}"
"-DOQS_DIST_BUILD=ON"
"-DOQS_BUILD_ONLY_LIB=ON"
];
postInstall = ''
echo fixing double slash
if [ -f "$out/lib/pkgconfig/liboqs.pc" ]; then
sed 's|//|/|g' $out/lib/pkgconfig/liboqs.pc > $out/lib/pkgconfig/liboqs.pc.tmp
cp $out/lib/pkgconfig/liboqs.pc.tmp $out/lib/pkgconfig/liboqs.pc
fi
'';
# dontFixCmake = true; # fix CMake file will give an error
meta = with lib; {
description = "C library for prototyping and experimenting with quantum-resistant cryptography";
homepage = "https://openquantumsafe.org";
license = licenses.mit;
platforms = platforms.all;
maintainers = [ maintainers.sigmanificient ];
};
}