فهرست منبع

add urdfdom and swig (#616)

* add urdfdom

* improve tinyxml and pcre

* add swig

* fix magnum

* improve corrade

* update log4cplus
Hoildkv 4 سال پیش
والد
کامیت
68f1c58a37

+ 21 - 0
packages/c/console-bridge/xmake.lua

@@ -0,0 +1,21 @@
+package("console-bridge")
+
+    set_homepage("https://github.com/ros/console_bridge")
+    set_description("A ROS-independent package for logging that seamlessly pipes into rosconsole/rosout for ROS-dependent packages.")
+    set_license("BSD-3-Clause")
+
+    add_urls("https://github.com/ros/console_bridge/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/ros/console_bridge.git")
+    add_versions("1.0.1", "2ff175a9bb2b1849f12a6bf972ce7e4313d543a2bbc83b60fdae7db6e0ba353f")
+
+    add_deps("cmake")
+    on_install("windows", "macosx", "linux", function (package)
+        local configs = {"-DCMAKE_INSTALL_LIBDIR=lib", "-DBUILD_TESTING=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_cxxtypes("console_bridge::LogLevel", {includes = "console_bridge/console.h"}))
+    end)

+ 2 - 2
packages/c/corrade/xmake.lua

@@ -4,9 +4,9 @@ package("corrade")
     set_description("Cor­rade is a mul­ti­plat­form util­i­ty li­brary writ­ten in C++11/C++14.")
     set_license("MIT")
 
-    add_urls("https://github.com/mosra/corrade/archive/refs/tags/v2020.06.tar.gz",
+    add_urls("https://github.com/mosra/corrade/archive/refs/tags/$(version).zip",
              "https://github.com/mosra/corrade.git")
-    add_versions("v2020.06", "2a62492ccc717422b72f2596a3e1a6a105b9574aa9467917f12d19ef3aab1341")
+    add_versions("v2020.06", "d89a06128c334920d91fecf23cc1df48fd6be26543dc0ed81b2f819a92d70e72")
 
     if is_plat("windows") then
         add_syslinks("shell32")

+ 2 - 1
packages/l/log4cplus/xmake.lua

@@ -6,10 +6,11 @@ package("log4cplus")
 
     add_urls("https://github.com/log4cplus/log4cplus/releases/download/REL_$(version).tar.gz", {version = function (version) return version:gsub("%.", "_") .. "/log4cplus-" .. version end})
     add_versions("2.0.6", "5fb26433b0f200ebfc2e6effb7e2e5131185862a2ea9a621a8e7f3f725a72b08")
+    add_versions("2.0.7", "086451c7e7c582862cbd6c60d87bb6d9d63c4b65321dba85fa71766382f7ec6d")
 
     add_configs("unicode", {description = "Use unicode charset.", default = true, type = "boolean"})
 
-    add_deps("cmake", {kind = "binary"})
+    add_deps("cmake")
     if is_plat("windows") then
         add_syslinks("advapi32", "ws2_32")
     elseif is_plat("linux") then

+ 2 - 2
packages/m/magnum-extras/xmake.lua

@@ -4,9 +4,9 @@ package("magnum-extras")
     set_description("Extras for magnum, Light­weight and mod­u­lar C++11/C++14 graph­ics mid­dle­ware for games and data visu­al­iz­a­tion.")
     set_license("MIT")
 
-    add_urls("https://github.com/mosra/magnum-extras/archive/refs/tags/$(version).tar.gz",
+    add_urls("https://github.com/mosra/magnum-extras/archive/refs/tags/$(version).zip",
              "https://github.com/mosra/magnum-extras.git")
-    add_versions("v2020.06", "a8d7babc50ac070984d39f6cc15c3ce2af7b41fe980fe81b0405da6f5ba3c36d")
+    add_versions("v2020.06", "9a53b503b45580dbaa54f852f65755330f5ace81be9d2a4c4605091d5f58d9bb")
 
     add_configs("ui",         {description = "Build the ui library.", default = false, type = "boolean"})
     add_configs("player",     {description = "Build the magnum-player executable.", default = false, type = "boolean"})

+ 2 - 2
packages/m/magnum-integration/xmake.lua

@@ -4,9 +4,9 @@ package("magnum-integration")
     set_description("Integration libraries for magnum, Light­weight and mod­u­lar C++11/C++14 graph­ics mid­dle­ware for games and data visu­al­iz­a­tion.")
     set_license("MIT")
 
-    add_urls("https://github.com/mosra/magnum-integration/archive/refs/tags/$(version).tar.gz",
+    add_urls("https://github.com/mosra/magnum-integration/archive/refs/tags/$(version).zip",
              "https://github.com/mosra/magnum-integration.git")
-    add_versions("v2020.06", "4eb461e0a38d7be69a52b8faf7664493da4e4cabc2c4fa86bd672d2e8f0a9311")
+    add_versions("v2020.06", "8e5d7ffc9df300eb9fac9cff24e74d40f9a13f5e952bd3185fb002d4d6ac38ed")
 
     local intergrations = {"bullet", "dart", "eigen", "glm", "imgui", "ovr"}
     for _, integration in ipairs(integrations) do

+ 2 - 2
packages/m/magnum-plugins/xmake.lua

@@ -4,9 +4,9 @@ package("magnum-plugins")
     set_description("Plugins for magnum, C++11/C++14 graph­ics mid­dle­ware for games and data visu­al­iz­a­tion.")
     set_license("MIT")
 
-    add_urls("https://github.com/mosra/magnum-plugins/archive/refs/tags/$(version).tar.gz",
+    add_urls("https://github.com/mosra/magnum-plugins/archive/refs/tags/$(version).zip",
              "https://github.com/mosra/magnum-plugins.git")
-    add_versions("v2020.06", "8650cab43570c826d2557d5b42459150d253316f7f734af8b3e7d0883510b40a")
+    add_versions("v2020.06", "8e1e98674ef3f0276f68abbdfecef1d72ae95b5a812b78c1ff45dba10fc72e3f")
 
     add_configs("plugin_static", {description = "Build plugins as static libraries.", default = false, type = "boolean"})
     add_configs("openddl",       {description = "Build the OpenDdl library.", default = false, type = "boolean"})

+ 5 - 5
packages/m/magnum/xmake.lua

@@ -4,9 +4,9 @@ package("magnum")
     set_description("Light­weight and mod­u­lar C++11/C++14 graph­ics mid­dle­ware for games and data visu­al­iz­a­tion.")
     set_license("MIT")
 
-    add_urls("https://github.com/mosra/magnum/archive/refs/tags/$(version).tar.gz",
+    add_urls("https://github.com/mosra/magnum/archive/refs/tags/$(version).zip",
              "https://github.com/mosra/magnum.git")
-    add_versions("v2020.06", "98dfe802e56614e4e6bf750d9b693de46a5ed0c6eb479b0268f1a20bf34268bf")
+    add_versions("v2020.06", "78c52bc403cec27b98d8d87186622ca57f8d70ffd64342fe4094c720b7d3b0e3")
 
     add_configs("audio",         {description = "Build audio module.", default = false, type = "boolean"})
     add_configs("vulkan",        {description = "Build vulkan module.", default = false, type = "boolean"})
@@ -39,9 +39,9 @@ package("magnum")
     end
 
     add_deps("cmake", "corrade", "opengl")
-    add_links("AnyAudioImporter", "AnyImageConverter", "AnyImageImporter", "AnySceneConverter", "AnySceneImporter", "MagnumFont", "MagnumFontConverter", "ObjImporter", "TgaImageConverter", "TgaImporter", "WavAudioImporter")
-    add_links("CglContext", "EglContext", "GlxContext", "WglContext", "OpenGLTester", "VulkanTester")
-    add_links("AndroidApplication", "EmscriptenApplication", "GlfwApplication", "GlxApplication", "Sdl2Application", "XEglApplication", "WindowlessCglApplication", "WindowlessEglApplication", "WindowlessGlxApplication", "WindowlessIosApplication", "WindowlessWglApplication", "WindowlessWindowsEglApplication")
+    add_links("MagnumAnyAudioImporter", "MagnumAnyImageConverter", "MagnumAnyImageImporter", "MagnumAnySceneConverter", "MagnumAnySceneImporter", "MagnumMagnumFont", "MagnumMagnumFontConverter", "MagnumObjImporter", "MagnumTgaImageConverter", "MagnumTgaImporter", "MagnumWavAudioImporter")
+    add_links("MagnumCglContext", "MagnumEglContext", "MagnumGlxContext", "MagnumWglContext", "MagnumOpenGLTester", "MagnumVulkanTester")
+    add_links("MagnumAndroidApplication", "MagnumEmscriptenApplication", "MagnumGlfwApplication", "MagnumGlxApplication", "MagnumSdl2Application", "MagnumXEglApplication", "MagnumWindowlessCglApplication", "MagnumWindowlessEglApplication", "MagnumWindowlessGlxApplication", "MagnumWindowlessIosApplication", "MagnumWindowlessWglApplication", "MagnumWindowlessWindowsEglApplication")
     add_links("MagnumAudio", "MagnumDebugTools", "MagnumGL", "MagnumMeshTools", "MagnumPrimitives", "MagnumSceneGraph", "MagnumShaders", "MagnumText", "MagnumTextureTools", "MagnumTrade", "MagnumVk", "Magnum")
     on_load("windows", "linux", "macosx", function (package)
         if package:config("audio") then

+ 2 - 2
packages/p/pcre/xmake.lua

@@ -4,13 +4,13 @@ package("pcre")
     set_description("A Perl Compatible Regular Expressions Library")
 
     set_urls("https://ftp.pcre.org/pub/pcre/pcre-$(version).zip",
-             "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$(version).zip")
+             "https://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$(version).zip")
     add_versions("8.45", "5b709aa45ea3b8bb73052947200ad187f651a2049158fb5bbfed329e4322a977")
     add_versions("8.44", "3464cc5effda458e1c80882e53fc710195bf0d6d923c0866cafea43c7f321d25")
     add_versions("8.40", "99e19194fa57d37c38e897d07ecb3366b18e8c395b36c6d555706a7f1df0a5d4")
     add_versions("8.41", "0e914a3a5eb3387cad6ffac591c44b24bc384c4e828643643ebac991b57dfcc5")
 
-    if is_host("windows") and not is_plat("mingw") then
+    if is_plat("windows") then
         add_deps("cmake")
     end
     add_deps("zlib")

+ 36 - 0
packages/s/swig/xmake.lua

@@ -0,0 +1,36 @@
+package("swig")
+
+    set_kind("binary")
+    set_homepage("http://swig.org/")
+    set_description("SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.")
+    set_license("GPL-3.0")
+
+    if is_host("windows") then
+        add_urls("https://sourceforge.net/projects/swig/files/swigwin/swigwin-$(version)/swigwin-$(version).zip")
+        add_versions("4.0.2", "daadb32f19fe818cb9b0015243233fc81584844c11a48436385e87c050346559")
+    else
+        add_urls("https://sourceforge.net/projects/swig/files/swig/swig-$(version)/swig-$(version).tar.gz")
+        add_versions("4.0.2", "d53be9730d8d58a16bf0cbd1f8ac0c0c3e1090573168bfa151b01eb47fa906fc")
+    end
+
+    if is_host("macosx", "linux") then
+        add_deps("pcre", {host = true})
+    end
+
+    on_install("@windows", function (package)
+        os.cp("*|Doc|Examples", package:installdir())
+        package:addenv("PATH", ".")
+    end)
+
+    on_install("@macosx", "@linux", function (package)
+        local configs = {}
+        local pcre = package:dep("pcre")
+        if pcre and not pcre:is_system() then
+            table.insert(configs, "--with-pcre-prefix=" .. pcre:installdir())
+        end
+        import("package.tools.autoconf").install(package, configs)
+    end)
+
+    on_test(function (package)
+        os.vrun("swig -version")
+    end)

+ 5 - 0
packages/t/tinyxml/xmake.lua

@@ -7,7 +7,12 @@ package("tinyxml")
     add_urls("https://sourceforge.net/projects/tinyxml/files/tinyxml/$(version).zip", {version = function (version) return version .. "/tinyxml_" .. version:gsub("%.", "_") end})
     add_versions("2.6.2", "ac6bb9501c6f50cc922d22f26b02fab168db47521be5e845b83d3451a3e1d512")
 
+    add_configs("stl", {description = "Enable STL support.", default = true, type = "boolean"})
+
     on_install(function (package)
+        if package:config("stl") then
+            io.replace("tinyxml.h", "#define TINYXML_INCLUDED", "#define TINYXML_INCLUDED\n#define TIXML_USE_STL", {plain = true})
+        end
         io.writefile("xmake.lua", [[
             add_rules("mode.debug", "mode.release")
             target("tinyxml")

+ 30 - 0
packages/u/urdfdom-headers/patches/1.0.5/export.patch

@@ -0,0 +1,30 @@
+diff --git a/cmake/urdfdom_headers-config.cmake.in b/cmake/urdfdom_headers-config.cmake.in
+--- a/cmake/urdfdom_headers-config.cmake.in
++++ b/cmake/urdfdom_headers-config.cmake.in
+@@ -3,8 +3,8 @@ if (@PACKAGE_NAME@_CONFIG_INCLUDED)
+ endif()
+ set(@PACKAGE_NAME@_CONFIG_INCLUDED TRUE)
+ 
+-set(@PACKAGE_NAME@_INCLUDE_DIRS "${@PROJECT_NAME@_DIR}/@RELATIVE_PATH_CMAKE_DIR_TO_PREFIX@/include")
++set(@PACKAGE_NAME@_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../../include")
+ 
+-include("${@PACKAGE_NAME@_DIR}/@[email protected]")
++include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
+ 
+ list(APPEND @PACKAGE_NAME@_TARGETS @PACKAGE_NAME@::@PACKAGE_NAME@)
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -23,10 +23,10 @@ add_subdirectory(urdf_model_state)
+ add_subdirectory(urdf_world)
+ add_subdirectory(urdf_exception)
+ 
+-if(WIN32 AND NOT CYGWIN)
++if(FALSE)
+   set(CMAKE_CONFIG_INSTALL_DIR CMake)
+ else()
+-  set(CMAKE_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake)
++  set(CMAKE_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
+ endif()
+ string(REGEX REPLACE "[^/]+" ".." RELATIVE_PATH_CMAKE_DIR_TO_PREFIX "${CMAKE_CONFIG_INSTALL_DIR}")
+ 

+ 21 - 0
packages/u/urdfdom-headers/xmake.lua

@@ -0,0 +1,21 @@
+package("urdfdom-headers")
+
+    set_kind("library", {headeronly = true})
+    set_homepage("http://ros.org/wiki/urdf")
+    set_description("Headers for URDF parsers")
+    set_license("BSD-3-Clause")
+
+    add_urls("https://github.com/ros/urdfdom_headers/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/ros/urdfdom_headers.git")
+    add_versions("1.0.5", "76a68657c38e54bb45bddc4bd7d823a3b04edcd08064a56d8e7d46b9912035ac")
+
+    add_patches("1.0.5", path.join(os.scriptdir(), "patches", "1.0.5", "export.patch"), "c7c15c0fba7b618c4ff9207a561caae70374e642a779fb346f2c084d5da6ed8b")
+
+    add_deps("cmake")
+    on_install(function (package)
+        import("package.tools.cmake").install(package)
+    end)
+
+    on_test(function (package)
+        assert(package:has_cxxtypes("urdf::World", {includes = "urdf_world/world.h"}))
+    end)

+ 25 - 0
packages/u/urdfdom/patches/1.0.4/build.patch

@@ -0,0 +1,25 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -41,7 +41,7 @@ if (NOT MSVC)
+   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ endif()
+ 
+-find_package(console_bridge 0.3 REQUIRED)
++find_package(console_bridge REQUIRED)
+ include_directories(SYSTEM ${console_bridge_INCLUDE_DIRS})
+ link_directories(${console_bridge_LIBRARY_DIRS})
+ 
+diff --git a/urdf_parser/CMakeLists.txt b/urdf_parser/CMakeLists.txt
+--- a/urdf_parser/CMakeLists.txt
++++ b/urdf_parser/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ include_directories(include)
+ 
++if(MSVC)
++add_definitions(-D_USE_MATH_DEFINES)
++endif()
++
+ add_library(urdfdom_world SHARED src/pose.cpp src/model.cpp src/link.cpp src/joint.cpp src/world.cpp)
+ target_link_libraries(urdfdom_world ${TinyXML_LIBRARIES} ${console_bridge_LIBRARIES})
+ set_target_properties(urdfdom_world PROPERTIES SOVERSION ${URDF_MAJOR_MINOR_VERSION})

+ 30 - 0
packages/u/urdfdom/xmake.lua

@@ -0,0 +1,30 @@
+package("urdfdom")
+
+    set_homepage("https://wiki.ros.org/urdf")
+    set_description("A C++ parser for the Unified Robot Description Format (URDF)")
+    set_license("BSD-3-Clause")
+
+    add_urls("https://github.com/ros/urdfdom/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/ros/urdfdom.git")
+    add_versions("1.0.4", "8f3d56b0cbc4b84436d8baf4c8346cd2ee7ffb257bba5ddd9892c41bf516edc4")
+
+    add_patches("1.0.4", path.join(os.scriptdir(), "patches", "1.0.4", "build.patch"), "1f51148afccef7b9bf079ef4137c12d578fb7a76f7aed6e282ca2ceaf4a188ba")
+
+    add_deps("cmake")
+    add_deps("urdfdom-headers", "console-bridge", "tinyxml")
+    on_install("windows", "linux", "macosx", function (package)
+        local configs = {"-DCMAKE_INSTALL_LIBDIR=lib"} 
+        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:check_cxxsnippets({test = [[
+            #include <string>
+            void test() {
+                std::string easy{"1.0"};
+                double conv = urdf::strToDouble(easy.c_str());
+            }
+        ]]}, {configs = {languages = "c++11"}, includes = "urdf_model/utils.h"}))
+    end)