2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
openssl,
|
2024-06-05 15:53:02 +00:00
|
|
|
fetchpatch,
|
2024-05-15 15:35:15 +00:00
|
|
|
enableStatic ? stdenv.hostPlatform.isStatic,
|
2023-02-02 18:25:31 +00:00
|
|
|
}:
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2023-02-02 18:25:31 +00:00
|
|
|
pname = "liboqs";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "0.10.0";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "open-quantum-safe";
|
2024-06-05 15:53:02 +00:00
|
|
|
repo = "liboqs";
|
|
|
|
rev = finalAttrs.version;
|
|
|
|
hash = "sha256-BFDa5NUr02lFPcT4Hnb2rjGAi+2cXvh1SHLfqX/zLlI=";
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
patches = [
|
|
|
|
./fix-openssl-detection.patch
|
|
|
|
# liboqs.pc.in path were modified in this commit
|
|
|
|
# causing malformed path with double slashes.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/open-quantum-safe/liboqs/commit/f0e6b8646c5eae0e8052d029079ed3efa498f220.patch";
|
|
|
|
hash = "sha256-tDfWzcDnFGikzq2ADEWiUgcUt1NSLWQ9/HVWA3rKuzc=";
|
|
|
|
revert = true;
|
|
|
|
})
|
|
|
|
];
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=${if enableStatic then "OFF" else "ON"}"
|
|
|
|
"-DOQS_DIST_BUILD=ON"
|
|
|
|
"-DOQS_BUILD_ONLY_LIB=ON"
|
|
|
|
];
|
|
|
|
|
|
|
|
dontFixCmake = true; # fix CMake file will give an error
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "C library for prototyping and experimenting with quantum-resistant cryptography";
|
|
|
|
homepage = "https://openquantumsafe.org";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = [ maintainers.sigmanificient ];
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
2024-06-05 15:53:02 +00:00
|
|
|
})
|