|
@@ -1,22 +1,42 @@
|
|
|
package("marisa")
|
|
|
-
|
|
|
set_homepage("https://github.com/s-yata/marisa-trie")
|
|
|
set_description("Matching Algorithm with Recursively Implemented StorAge.")
|
|
|
|
|
|
- add_urls("https://github.com/s-yata/marisa-trie/archive/$(version).zip")
|
|
|
- add_urls("https://github.com/s-yata/marisa-trie.git")
|
|
|
- add_versions("v0.2.6", "8dc0b79ff9948be80fd09df6d2cc70134367339ec7d6496857bc47cf421df1af")
|
|
|
+ add_urls("https://github.com/s-yata/marisa-trie/archive/refs/tags/$(version).tar.gz",
|
|
|
+ "https://github.com/s-yata/marisa-trie.git")
|
|
|
+
|
|
|
+ add_versions("v0.2.6", "1063a27c789e75afa2ee6f1716cc6a5486631dcfcb7f4d56d6485d2462e566de")
|
|
|
+ add_versions("v0.3.0", "a3057d0c2da0a9a57f43eb8e07b73715bc5ff053467ee8349844d01da91b5efb")
|
|
|
+
|
|
|
+ add_patches("v0.3.0", "patches/v0.3.0/support-debug-install.diff", "a3d02bf6881d233bf8cfadded33edfcde167bee719d47538b869e0e90d8bf7ce")
|
|
|
+ add_patches("v0.3.0", "https://github.com/s-yata/marisa-trie/pull/119.diff", "f02211699465b55cd2ab93ef20bafcd69aa573da1fd796cb9366697075074093")
|
|
|
|
|
|
add_deps("cmake")
|
|
|
|
|
|
- on_install("windows", "mingw", "linux", "macosx", "bsd", function (package)
|
|
|
- os.cp(path.join(package:scriptdir(), "port", "CMakeLists.txt"), "CMakeLists.txt")
|
|
|
- local configs = {"-DENABLE_TESTS=OFF"}
|
|
|
- table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
|
|
|
+ on_install(function (package)
|
|
|
+ if package:version() and package:version():lt("v0.3.0") then
|
|
|
+ os.cp(path.join(package:scriptdir(), "port", "CMakeLists.txt"), "CMakeLists.txt")
|
|
|
+ end
|
|
|
+ local configs = {
|
|
|
+ "-DCMAKE_POLICY_DEFAULT_CMP0057=NEW",
|
|
|
+ "-DENABLE_TESTS=OFF",
|
|
|
+ "-DBUILD_TESTING=OFF",
|
|
|
+ "-DENABLE_TOOLS=OFF"
|
|
|
+ }
|
|
|
+ if package:config("shared") and package:is_plat("windows") then
|
|
|
+ table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
|
|
|
+ end
|
|
|
+ table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_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_cxxtypes("marisa::Trie", {configs = {languages = "c++11"}, includes = "marisa.h"}))
|
|
|
+ assert(package:check_cxxsnippets({test = [[
|
|
|
+ #include <marisa.h>
|
|
|
+ void test() {
|
|
|
+ int x = 1, y = 2;
|
|
|
+ marisa::swap(x, y);
|
|
|
+ }
|
|
|
+ ]]}, {configs = {languages = "c++17"}}), "package(marisa) require >= c++17")
|
|
|
end)
|