From ad28fa29b6a577efe937ed4a524f44725c445f10 Mon Sep 17 00:00:00 2001 From: c8ef Date: Wed, 12 Jun 2024 11:45:02 +0800 Subject: [PATCH] add liboqs package (#4343) * add liboqs package * Update xmake.lua * Update xmake.lua --- packages/l/liboqs/xmake.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 packages/l/liboqs/xmake.lua diff --git a/packages/l/liboqs/xmake.lua b/packages/l/liboqs/xmake.lua new file mode 100644 index 000000000..0fb59541c --- /dev/null +++ b/packages/l/liboqs/xmake.lua @@ -0,0 +1,21 @@ +package("liboqs") + set_homepage("https://openquantumsafe.org") + set_description("C library for prototyping and experimenting with quantum-resistant cryptography") + + add_urls("https://github.com/open-quantum-safe/liboqs/archive/refs/tags/$(version).tar.gz", + "https://github.com/open-quantum-safe/liboqs.git") + + add_versions("0.10.1", "00ca8aba65cd8c8eac00ddf978f4cac9dd23bb039f357448b60b7e3eed8f02da") + + add_deps("cmake") + + on_install("linux", "macosx", function (package) + local configs = {"-DOQS_BUILD_ONLY_LIB=ON", "-DOQS_USE_OPENSSL=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("OQS_SIG_keypair", {includes = "oqs/oqs.h"})) + end)