Browse Source

xor_singleheader: add package. (#7854)

RedbeanW 1 week ago
parent
commit
70d49dec69
2 changed files with 29 additions and 1 deletions
  1. 29 0
      packages/x/xor_singleheader/xmake.lua
  2. 0 1
      scripts/test.lua

+ 29 - 0
packages/x/xor_singleheader/xmake.lua

@@ -0,0 +1,29 @@
+package("xor_singleheader")
+    set_kind("library", {headeronly = true})
+    set_homepage("https://github.com/FastFilter/xor_singleheader")
+    set_description("Header-only binary fuse and xor filter library.")
+    set_license("Apache-2.0")
+
+    add_urls("https://github.com/FastFilter/xor_singleheader/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/FastFilter/xor_singleheader.git")
+
+    add_versions("v2.1.0", "8bd366d0e966e5659b35131669cfff31c7beccf74b9c258ea189b45e6592a9d8")
+
+    if is_plat("linux", "bsd") then
+        add_syslinks("m")
+    end
+
+    add_deps("cmake")
+    on_install(function (package)
+        local configs = {
+            "-DBUILD_TESTING=OFF"
+        }
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
+
+        io.replace("CMakeLists.txt", "add_subdirectory(benchmarks)", "", {plain = true})
+        import("package.tools.cmake").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:has_cfuncs("binary_fuse_cmpfunc", {includes = "binaryfusefilter.h"}))
+    end)

+ 0 - 1
scripts/test.lua

@@ -290,7 +290,6 @@ end
 -- @see https://github.com/xmake-io/xmake-repo/issues/6940
 function _lock_packages(packages)
     local locked_packages = {
-        "xor_singleheader",
         "libsolv",
         "libnfc",
         "flashlight",