From ad5eeb5d118fd1f82514f81f0a139c01a240c5d2 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sat, 29 Jun 2024 15:04:27 +0800 Subject: [PATCH] mapbox_polylabel: add package (#4511) --- packages/m/mapbox_geometry/xmake.lua | 10 +++------- packages/m/mapbox_polylabel/xmake.lua | 25 +++++++++++++++++++++++++ packages/m/mapbox_variant/xmake.lua | 5 +++-- 3 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 packages/m/mapbox_polylabel/xmake.lua diff --git a/packages/m/mapbox_geometry/xmake.lua b/packages/m/mapbox_geometry/xmake.lua index aa3c89c7a..1e33d6a6e 100644 --- a/packages/m/mapbox_geometry/xmake.lua +++ b/packages/m/mapbox_geometry/xmake.lua @@ -1,5 +1,4 @@ package("mapbox_geometry") - set_kind("library", {headeronly = true}) set_homepage("https://github.com/mapbox/geometry.hpp") set_description("Provides header-only, generic C++ interfaces for geometry types, geometry collections, and features.") @@ -7,8 +6,10 @@ package("mapbox_geometry") add_urls("https://github.com/mapbox/geometry.hpp/archive/refs/tags/v$(version).zip", "https://github.com/mapbox/geometry.hpp.git") + add_versions("1.1.0", "dc9203db94eda6b5377b96edeb4b53109cbf3d29e714d1d50c5cb598f2b39ab4") add_versions("2.0.3", "64d1005d4ee9931ac162b853cfb4a7c8a8bda9992ba83211386a6b40955bcc49") + add_patches("1.1.0", path.join(os.scriptdir(), "patches", "1.1.0", "pragma.patch"), "235a89eb4d78874bb8e3e49c95317c540511f33a67dec80a41c6984df7ff20c5") add_patches("2.0.3", path.join(os.scriptdir(), "patches", "2.0.3", "pragma.patch"), "235a89eb4d78874bb8e3e49c95317c540511f33a67dec80a41c6984df7ff20c5") @@ -24,12 +25,7 @@ package("mapbox_geometry") add_rules("utils.install.cmake_importfiles") add_rules("utils.install.pkgconfig_importfiles") ]]) - - local configs = {} - if package:config("shared") then - configs.kind = "shared" - end - import("package.tools.xmake").install(package, config) + import("package.tools.xmake").install(package) end) on_test(function (package) diff --git a/packages/m/mapbox_polylabel/xmake.lua b/packages/m/mapbox_polylabel/xmake.lua new file mode 100644 index 000000000..9dbbfe6be --- /dev/null +++ b/packages/m/mapbox_polylabel/xmake.lua @@ -0,0 +1,25 @@ +package("mapbox_polylabel") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/mapbox/polylabel") + set_description("A fast algorithm for finding the pole of inaccessibility of a polygon (in JavaScript and C++)") + set_license("ISC") + + add_urls("https://github.com/mapbox/polylabel/archive/refs/tags/$(version).tar.gz", + "https://github.com/mapbox/polylabel.git") + + add_versions("v2.0.0", "9aba4320c6cb5a8e9a8d44feb0d68b79b3127bdcb759a26aca92ac637668d7b9") + + add_deps("mapbox_geometry") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + mapbox::geometry::polygon polygon; + mapbox::geometry::point p = mapbox::polylabel(polygon, 1.0); + } + ]]}, {configs = {languages = "c++14"}, includes = {"mapbox/polylabel.hpp"}})) + end) diff --git a/packages/m/mapbox_variant/xmake.lua b/packages/m/mapbox_variant/xmake.lua index e663c14ac..1f084a98e 100644 --- a/packages/m/mapbox_variant/xmake.lua +++ b/packages/m/mapbox_variant/xmake.lua @@ -1,13 +1,14 @@ package("mapbox_variant") - set_kind("library", {headeronly = true}) set_homepage("https://github.com/mapbox/variant") set_description("C++11/C++14 Variant") set_license("BSD") - set_urls("https://github.com/mapbox/variant/archive/refs/tags/$(version).tar.gz", + set_urls("https://github.com/mapbox/variant/archive/f87fcbda9daf13fba47a6a889696b0ad23fc098d.tar.gz", + "https://github.com/mapbox/variant/archive/refs/tags/$(version).tar.gz", "https://github.com/mapbox/variant.git") + add_versions("2020.12.02", "1c158fb10da5605060950eb8d2a87a3313d29e558576e35fd445653d863a0103") add_versions("v1.2.0", "7059f4420d504c4bc96f8a462a0f6d029c5be914ba55cc030a0a773366dd7bc8") on_install(function (package)