about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/liboqs
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/liboqs')
-rw-r--r--nixpkgs/pkgs/development/libraries/liboqs/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/liboqs/default.nix b/nixpkgs/pkgs/development/libraries/liboqs/default.nix
new file mode 100644
index 000000000000..c2a0216a34e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liboqs/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, openssl
+, enableStatic ? stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation rec {
+  pname = "liboqs";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "open-quantum-safe";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-h3mXoGRYgPg0wKQ1u6uFP7wlEUMQd5uIBt4Hr7vjNtA=";
+  };
+
+  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;
+    maintainers = [];
+  };
+}