瀏覽代碼

ppqsort: add package (#7509)

* ppqsort: add package

* Only do tests if C++20 is supported

* Only do tests if we also have syncstream and ranges

* Try to use `on_check`

---------

Co-authored-by: Saikari <[email protected]>
Cappecasper03 1 月之前
父節點
當前提交
a7145b835b
共有 1 個文件被更改,包括 22 次插入0 次删除
  1. 22 0
      packages/p/ppqsort/xmake.lua

+ 22 - 0
packages/p/ppqsort/xmake.lua

@@ -0,0 +1,22 @@
+package("ppqsort")
+    set_kind("library", {headeronly = true})
+    set_homepage("https://github.com/GabTux/PPQSort")
+    set_description("Efficient implementation of parallel quicksort algorithm")
+
+    add_urls("https://github.com/GabTux/PPQSort/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/GabTux/PPQSort.git")
+
+    add_versions("v1.0.5", "39a973a680eb0af3bd0bdd5f4e9fa81d484915f3141e3a4568930647a328ba12")
+
+    on_check(function (package)
+        assert(package:has_cxxincludes("syncstream", {configs = {languages = "c++20"}}), "package(ppqsort): need <syncstream> header.")
+        assert(package:has_cxxincludes("ranges", {configs = {languages = "c++20"}}), "package(ppqsort): need <ranges> header.")
+    end)
+
+    on_install(function (package)
+        os.cp("include", package:installdir())
+    end)
+
+    on_test(function (package)
+        assert(package:has_cxxincludes("ppqsort.h", {configs = {languages = "c++20"}}))
+    end)