Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, fetchFromGitHub 4, cmake 5, openssl 6, enableStatic ? stdenv.hostPlatform.isStatic 7}: 8 9stdenv.mkDerivation rec { 10 pname = "liboqs"; 11 version = "0.7.2"; 12 13 src = fetchFromGitHub { 14 owner = "open-quantum-safe"; 15 repo = pname; 16 rev = version; 17 sha256 = "sha256-cwrTHj/WFDZ9Ez2FhjpRhEx9aC5xBnh7HR/9T+zUpZc="; 18 }; 19 20 nativeBuildInputs = [ cmake ]; 21 buildInputs = [ openssl ]; 22 23 cmakeFlags = [ 24 "-DBUILD_SHARED_LIBS=${if enableStatic then "OFF" else "ON"}" 25 "-DOQS_DIST_BUILD=ON" 26 "-DOQS_BUILD_ONLY_LIB=ON" 27 ]; 28 29 dontFixCmake = true; # fix CMake file will give an error 30 31 meta = with lib; { 32 description = "C library for prototyping and experimenting with quantum-resistant cryptography"; 33 homepage = "https://openquantumsafe.org"; 34 license = licenses.mit; 35 platforms = platforms.all; 36 maintainers = []; 37 }; 38}