From 0de894d4b0c8b3c67e6f1580d8c2867d44c200c0 Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:14:18 +0800 Subject: [PATCH] update qoi, utf8proc and libdeflate (#1674) * update qoi * update utf8proc * update libdeflate * add constraint --- packages/l/libdeflate/xmake.lua | 31 +++++++++++-------------------- packages/q/qoi/xmake.lua | 4 +++- packages/u/utf8proc/xmake.lua | 20 ++++++++++---------- 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/packages/l/libdeflate/xmake.lua b/packages/l/libdeflate/xmake.lua index dee7be4a9a8..0ffb57456c5 100644 --- a/packages/l/libdeflate/xmake.lua +++ b/packages/l/libdeflate/xmake.lua @@ -9,7 +9,9 @@ package("libdeflate") add_versions("v1.8", "50711ad4e9d3862f8dfb11b97eb53631a86ee3ce49c0e68ec2b6d059a9662f61") add_versions("v1.10", "5c1f75c285cd87202226f4de49985dcb75732f527eefba2b3ddd70a8865f2533") add_versions("v1.13", "0d81f197dc31dc4ef7b6198fde570f4e8653c77f4698fcb2163d820a9607c838") + add_versions("v1.15", "58b95040df7383dc0413defb700d9893c194732474283cc4c8f144b00a68154b") + add_deps("cmake") on_load("windows", function (package) if package:config("shared") then package:add("defines", "LIBDEFLATE_DLL") @@ -17,26 +19,15 @@ package("libdeflate") end) on_install("windows", "macosx", "linux", "android", "mingw", "bsd", function (package) - io.writefile("xmake.lua", [[ - add_rules("mode.debug", "mode.release") - target("deflate") - set_kind("$(kind)") - add_files("lib/*.c") - if is_arch("x86", "i386", "x86_64", "x64") then - add_files("lib/x86/*.c") - elseif is_arch("arm.+") then - add_files("lib/arm/*.c") - end - add_includedirs(".") - add_headerfiles("libdeflate.h") - if is_plat("windows") and is_kind("shared") then - add_defines("LIBDEFLATE_DLL", "BUILDING_LIBDEFLATE") - end - if is_plat("linux", "macosx") and is_kind("static") then - add_defines("LIBDEFLATEEXPORT=__attribute__((visibility(\"default\")))") - end - ]]) - import("package.tools.xmake").install(package) + if package:is_plat("windows") and package:is_arch("arm.*") then + local vs = import("core.tool.toolchain").load("msvc"):config("vs") + assert(tonumber(vs) > 2019, "libdeflate requires Visual Studio 2022 and later for arm targets") + end + local configs = {"-DLIBDEFLATE_BUILD_GZIP=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DLIBDEFLATE_BUILD_STATIC_LIB=" .. (package:config("shared") and "OFF" or "ON")) + table.insert(configs, "-DLIBDEFLATE_BUILD_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) end) on_test(function (package) diff --git a/packages/q/qoi/xmake.lua b/packages/q/qoi/xmake.lua index bb7f6e3a013..0e8f1e603bb 100644 --- a/packages/q/qoi/xmake.lua +++ b/packages/q/qoi/xmake.lua @@ -1,11 +1,13 @@ package("qoi") set_kind("library", {headeronly = true}) - set_homepage("https://github.com/phoboslab/qoi") + set_homepage("https://qoiformat.org/") set_description("The Quite OK Image Format for fast, lossless image compression") + set_license("MIT") add_urls("https://github.com/phoboslab/qoi.git") add_versions("2021.12.22", "44fe081388c60e7618f49486865b992e08ce4de4") + add_versions("2022.11.17", "660839cb2c51d6b5f62221f8ef98662fd40e42d2") on_install(function (package) os.cp("qoi.h", package:installdir("include")) diff --git a/packages/u/utf8proc/xmake.lua b/packages/u/utf8proc/xmake.lua index dd417b80cee..8e624c4ee99 100644 --- a/packages/u/utf8proc/xmake.lua +++ b/packages/u/utf8proc/xmake.lua @@ -6,19 +6,19 @@ package("utf8proc") add_urls("https://github.com/JuliaStrings/utf8proc/archive/refs/tags/$(version).tar.gz", "https://github.com/JuliaStrings/utf8proc.git") - add_versions('v2.7.0', '4bb121e297293c0fd55f08f83afab6d35d48f0af4ecc07523ad8ec99aa2b12a1') - - if is_plat("windows", "mingw") then - add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) - add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MD", readonly = true}) - end + add_versions("v2.7.0", "4bb121e297293c0fd55f08f83afab6d35d48f0af4ecc07523ad8ec99aa2b12a1") + add_versions("v2.8.0", "a0a60a79fe6f6d54e7d411facbfcc867a6e198608f2cd992490e46f04b1bcecc") add_deps("cmake") + on_load("windows", "macosx", "linux", "android", "mingw", "bsd", function (package) + if not package:config("shared") then + package:add("defines", "UTF8PROC_STATIC") + end + end) - on_install(function (package) - local configs = { - "-DUTF8PROC_ENABLE_TESTING=OFF", - } + on_install("windows", "macosx", "linux", "android", "mingw", "bsd", function (package) + local configs = {"-DUTF8PROC_ENABLE_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)