2023-01-31 09:14:23 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, openssl
|
|
|
|
, enableStatic ? stdenv.hostPlatform.isStatic
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "liboqs";
|
2023-06-09 15:36:45 +00:00
|
|
|
version = "0.8.0";
|
2023-01-31 09:14:23 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "open-quantum-safe";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-06-09 15:36:45 +00:00
|
|
|
sha256 = "sha256-h3mXoGRYgPg0wKQ1u6uFP7wlEUMQd5uIBt4Hr7vjNtA=";
|
2023-01-31 09:14:23 +00:00
|
|
|
};
|
|
|
|
|
2023-12-25 16:21:11 +00:00
|
|
|
patches = [ ./fix-openssl-detection.patch ];
|
|
|
|
|
2023-01-31 09:14:23 +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
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "C library for prototyping and experimenting with quantum-resistant cryptography";
|
|
|
|
homepage = "https://openquantumsafe.org";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
2023-04-05 00:29:57 +00:00
|
|
|
maintainers = [];
|
2023-01-31 09:14:23 +00:00
|
|
|
};
|
|
|
|
}
|