Kaynağa Gözat

add tinyexr and jansson (#1035)

* add tinyexr

* add jansson

* update drogon

* fix jansson and libfive

* fix tinyexr

* fix libfive

* improve libtins

* update libjpeg-turbo
Hoildkv 3 yıl önce
ebeveyn
işleme
7b6c23bcb0

+ 3 - 2
packages/d/drogon/xmake.lua

@@ -10,6 +10,7 @@ package("drogon")
     add_versions("v1.6.0", "9f8802b579aac29e9eddfb156e432276727a3d3c49fffdf453a2ddcd1cb69093")
     add_versions("v1.7.1", "a0bce1f32b6e1321486bb25c55ca7bd7a577cbd53f1e7be47367d0f9733730f1")
     add_versions("v1.7.3", "36dc5a3acad3b8a32bb1364764b26cf01c687a4f62358de9632e055b156313a6")
+    add_versions("v1.7.5", "e2af7c55dcabafef16f26f5b3242692f5a2b54c19b7b626840bf9132d24766f6")
 
     add_patches("1.4.1", path.join(os.scriptdir(), "patches", "1.4.1", "trantor.patch"), "7f9034a27bb63de8dedb80dd9f246ea7aa7724c87f2c0d0054f4b6097ea2a862")
     add_patches("1.4.1", path.join(os.scriptdir(), "patches", "1.4.1", "resolv.patch"), "a1054822bf91f5f06de8bca9b1bd8859233228159a8ff8014ce6329d6c000f26")
@@ -17,8 +18,8 @@ package("drogon")
     add_patches("1.6.0", path.join(os.scriptdir(), "patches", "1.6.0", "resolv.patch"), "dc144ff1cdcfee413efbcdc568fed587318289e8fa1bb0da9d2ea94a15588b25")
     add_patches("1.7.1", path.join(os.scriptdir(), "patches", "1.7.1", "trantor.patch"), "3f93a1e78ba45c8f1e85c28d4fdbbd3e7961078da8cf417a97d8797a91fa2167")
     add_patches("1.7.1", path.join(os.scriptdir(), "patches", "1.7.1", "resolv.patch"), "75d3618374d15a5ec12681c8659e183f3e620acc43c77ae66e7bea21a25ca546")
-    add_patches("1.7.3", path.join(os.scriptdir(), "patches", "1.7.3", "trantor.patch"), "27e479dd0e3f8adc75c9c21fe895937f727c3102e5bfb21ac3289d6ad2795b7a")
-    add_patches("1.7.3", path.join(os.scriptdir(), "patches", "1.7.3", "resolv.patch"), "49694f090e169a5c0e524726e8b85ad0bac76c05ed633c60e986849c2e5adb85")
+    add_patches(">=1.7.3", path.join(os.scriptdir(), "patches", "1.7.3", "trantor.patch"), "27e479dd0e3f8adc75c9c21fe895937f727c3102e5bfb21ac3289d6ad2795b7a")
+    add_patches(">=1.7.3", path.join(os.scriptdir(), "patches", "1.7.3", "resolv.patch"), "49694f090e169a5c0e524726e8b85ad0bac76c05ed633c60e986849c2e5adb85")
 
     add_configs("c_ares", {description = "Enable async DNS query support.", default = false, type = "boolean"})
     add_configs("mysql", {description = "Enable mysql support.", default = false, type = "boolean"})

+ 23 - 0
packages/j/jansson/xmake.lua

@@ -0,0 +1,23 @@
+package("jansson")
+
+    set_homepage("https://github.com/akheron/jansson")
+    set_description("C library for encoding, decoding and manipulating JSON data")
+    set_license("MIT")
+
+    add_urls("https://github.com/akheron/jansson/releases/download/v$(version)/jansson-$(version).tar.gz")
+    add_versions("2.14", "5798d010e41cf8d76b66236cfb2f2543c8d082181d16bc3085ab49538d4b9929")
+
+    add_deps("cmake")
+    on_install("windows", "macosx", "linux", "mingw", function (package)
+        local configs = {"-DJANSSON_EXAMPLES=OFF", "-DJANSSON_BUILD_DOCS=OFF", "-DJANSSON_WITHOUT_TESTS=ON"}
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
+        table.insert(configs, "-DJANSSON_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
+        if package:is_plat("windows") then
+            table.insert(configs, "-DJANSSON_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
+        end
+        import("package.tools.cmake").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:has_cfuncs("json_loads", {includes = "jansson.h"}))
+    end)

+ 10 - 8
packages/l/libfive/xmake.lua

@@ -4,20 +4,23 @@ package("libfive")
     set_description("libfive is a software library and set of tools for solid modeling, especially suited for parametric and procedural design.")
 
     add_urls("https://github.com/libfive/libfive.git")
-    add_versions("20210408", "e6a6448694f2204b003e29bba45754461261b9b2")
+    add_versions("2021.04.08", "e6a6448694f2204b003e29bba45754461261b9b2")
+    add_versions("2022.02.22", "03b592cfc0fa3d9b3cf8117c191e0836d88a89a3")
 
-    add_deps("cmake", "eigen", "libpng", "boost")
-    if not is_plat("windows") then
-        add_deps("pkg-config")
+    add_deps("cmake", "libpng", "boost")
+    if is_plat("windows") then
+        add_deps("eigen 3.3.x")
+    else
+        add_deps("pkg-config", "eigen")
     end
     on_install("windows", "macosx", "linux", function (package)
         if package:is_plat("windows") then
             io.replace("libfive/src/CMakeLists.txt", "EIGEN_INCLUDE_DIRS", "EIGEN3_INCLUDE_DIRS", {plain = true})
-            io.replace("libfive/src/CMakeLists.txt", "if (UNIX)", "if (true)", {plain = true})
             io.replace("CMakeLists.txt", "%/MD.", "")
         end
-        io.replace("libfive/include/libfive.h", "[[deprecated(\"use libfive_tree_nullary instead\")]]", "", {plain = true})
-        io.replace("libfive/src/CMakeLists.txt", "bash -c \"git diff --quiet --exit-code || echo +\"", "echo +", {plain = true})
+        io.replace("libfive/src/CMakeLists.txt", "bash -c \"git diff --quiet --exit-code || echo +\"", "git diff --quiet --exit-code", {plain = true})
+        io.replace("libfive/src/CMakeLists.txt", "${GIT_REV}${GIT_DIFF}", "${GIT_REV}+${GIT_DIFF}", {plain = true})
+        io.replace("libfive/src/CMakeLists.txt", "if ?%(UNIX%)", "if (TRUE)")
         local configs = {"-DBUILD_GUILE_BINDINGS=OFF", "-DBUILD_PYTHON_BINDINGS=OFF", "-DBUILD_STUDIO_APP=OFF", "-DBUILD_TESTS=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"))
@@ -25,7 +28,6 @@ package("libfive")
             table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
         end
         import("package.tools.cmake").install(package, configs)
-        os.trycp("libfive/include", package:installdir("include"))
     end)
 
     on_test(function (package)

+ 1 - 0
packages/l/libjpeg-turbo/xmake.lua

@@ -12,6 +12,7 @@ package("libjpeg-turbo")
     add_versions("2.1.0",  "d6b7790927d658108dfd3bee2f0c66a2924c51ee7f9dc930f62c452f4a638c52")
     add_versions("2.1.1",  "20e9cd3e5f517950dfb7a300ad344543d88719c254407ffb5ad88d891bf701c4")
     add_versions("2.1.2",  "e7fdc8a255c45bc8fbd9aa11c1a49c23092fcd7379296aeaeb14d3343a3d1bed")
+    add_versions("2.1.3", "dbda0c685942aa3ea908496592491e5ec8160d2cf1ec9d5fd5470e50768e7859")
 
     add_configs("jpeg", {description = "libjpeg API/ABI emulation target version.", default = "6", type = "string", values = {"6", "7", "8"}})
 

+ 10 - 5
packages/l/libtins/xmake.lua

@@ -2,9 +2,11 @@ package("libtins")
 
     set_homepage("http://libtins.github.io/")
     set_description("High-level, multiplatform C++ network packet sniffing and crafting library.")
+    set_license("BSD-2-Clause")
 
-    set_urls("https://github.com/mfontanini/libtins.git")
-    add_versions("2021.6.23", "24ac038c302b2dff1cd47b104893ee60965d108f")
+    set_urls("https://github.com/mfontanini/libtins/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/mfontanini/libtins.git")
+    add_versions("v4.4", "ff0121b4ec070407e29720c801b7e1a972042300d37560a62c57abadc9635634")
 
     add_deps("cmake", "boost")
     if is_plat("windows") then
@@ -18,17 +20,20 @@ package("libtins")
     end)
 
     on_install("linux", "windows", "macosx", function (package)
-        local configs = {"-DLIBTINS_BUILD_EXAMPLES=OFF", "-DLIBTINS_BUILD_TESTS=OFF",
+        local configs = {
+            "-DCMAKE_INSTALL_LIBDIR=lib",
+            "-DLIBTINS_BUILD_EXAMPLES=OFF",
+            "-DLIBTINS_BUILD_TESTS=OFF",
             "-DLIBTINS_ENABLE_PCAP=OFF",
             "-DLIBTINS_ENABLE_DOT11=OFF",
             "-DLIBTINS_ENABLE_WPA2=OFF",
             "-DLIBTINS_ENABLE_TCPIP=OFF",
             "-DLIBTINS_ENABLE_ACK_TRACKER=OFF",
             "-DLIBTINS_ENABLE_TCP_STREAM_CUSTOM_DATA=OFF",
-            "-DLIBTINS_ENABLE_WPA2_CALLBACKS=OFF"}
+            "-DLIBTINS_ENABLE_WPA2_CALLBACKS=OFF"
+        }
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
         table.insert(configs, "-DLIBTINS_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF"))
-        table.insert(configs, "-DCMAKE_INSTALL_LIBDIR=lib")
         import("package.tools.cmake").install(package, configs)
     end)
 

+ 30 - 0
packages/t/tinyexr/xmake.lua

@@ -0,0 +1,30 @@
+package("tinyexr")
+
+    set_homepage("https://github.com/syoyo/tinyexr/")
+    set_description("Tiny OpenEXR image loader/saver library")
+    set_license("BSD-3-Clause")
+
+    add_urls("https://github.com/syoyo/tinyexr/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/syoyo/tinyexr.git")
+    add_versions("v1.0.1", "4dbbd8c7d17597ad557518de5eb923bd02683d26d0de765f9224e8d57d121677")
+
+    add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
+
+    add_deps("cmake", "miniz")
+    on_install(function (package)
+        io.writefile("xmake.lua", [[
+            add_rules("mode.debug", "mode.release")
+            add_requires("miniz")
+            target("tinyexr")
+                set_kind("static")
+                set_languages("c++11")
+                add_files("tinyexr.cc")
+                add_headerfiles("tinyexr.h")
+                add_packages("miniz")
+        ]])
+        import("package.tools.xmake").install(package)
+    end)
+
+    on_test(function (package)
+        assert(package:has_cxxfuncs("IsEXR", {includes = "tinyexr.h"}))
+    end)

+ 1 - 0
packages/t/trantor/xmake.lua

@@ -10,6 +10,7 @@ package("trantor")
     add_versions("v1.4.1", "aa3f4dddfd3fd1a6e04f79744e69f23bb6472c314724eaa3051872a2a03bbda9")
     add_versions("v1.5.0", "8704df75b783089d7e5361174054e0e46a09cc315b851dbc2ab6736e631b090b")
     add_versions("v1.5.2", "6ccd781b3a2703b94689d7da579a38a78bc5c89616cce18ec27fcb6bc0b1620f")
+    add_versions("v1.5.5", "5a549c6efebe7ecba73a944cfba4a9713130704d4ccc82af534a2e108b9a0e71")
 
     add_deps("cmake")
     add_deps("openssl", "c-ares", {optional = true})