Skip to content

Commit

Permalink
update qoi, utf8proc and libdeflate (#1674)
Browse files Browse the repository at this point in the history
* update qoi

* update utf8proc

* update libdeflate

* add constraint
  • Loading branch information
xq114 authored Dec 12, 2022
1 parent 2a69168 commit 0de894d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 31 deletions.
31 changes: 11 additions & 20 deletions packages/l/libdeflate/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,25 @@ 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")
end
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)
Expand Down
4 changes: 3 additions & 1 deletion packages/q/qoi/xmake.lua
Original file line number Diff line number Diff line change
@@ -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"))
Expand Down
20 changes: 10 additions & 10 deletions packages/u/utf8proc/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0de894d

Please sign in to comment.