add libavif and libimagequant (#433)
* update wayland * add libimagequant * add libavif * fix libavif * update freetype * update glibpull/435/head
parent
fbacf573f4
commit
d54dda9fe8
5 changed files with 91 additions and 21 deletions
@ -0,0 +1,32 @@ |
||||
package("libavif") |
||||
|
||||
set_homepage("https://github.com/AOMediaCodec/libavif") |
||||
set_description("libavif - Library for encoding and decoding .avif files") |
||||
set_license("BSD-2-Clause") |
||||
|
||||
add_urls("https://github.com/AOMediaCodec/libavif/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/AOMediaCodec/libavif.git") |
||||
add_versions("v0.9.1", "8526f3fff34a05a51d7c703cdcf1d0d38c939b5b6dd4bb7d3a3405ddad88186c") |
||||
|
||||
add_configs("dav1d", {description = "Use the dav1d codec for decoding.", default = false, type = "boolean"}) |
||||
|
||||
add_deps("cmake") |
||||
on_load(function (package) |
||||
if package:config("dav1d") then |
||||
package:add("deps", "dav1d") |
||||
end |
||||
end) |
||||
|
||||
on_install("windows", "linux", "macosx", function (package) |
||||
local configs = {"-DAVIF_ENABLE_WERROR=OFF", "-DAVIF_BUILD_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")) |
||||
if package:config("dav1d") then |
||||
table.insert(configs, "-DAVIF_CODEC_DAV1D=ON") |
||||
end |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("avifImageCreate", {includes = "avif/avif.h"})) |
||||
end) |
@ -0,0 +1,36 @@ |
||||
package("libimagequant") |
||||
|
||||
set_homepage("https://pngquant.org/lib/") |
||||
set_description("Small, portable C library for high-quality conversion of RGBA images to 8-bit indexed-color (palette) images.") |
||||
set_license("GPL-3.0") |
||||
|
||||
add_urls("https://github.com/ImageOptim/libimagequant/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/ImageOptim/libimagequant.git") |
||||
add_versions("2.15.1", "3a9548f99be8c3b20a5d9407d0ca95bae8b0fb424a2735a87cb6cf3fdd028225") |
||||
|
||||
add_configs("sse", {description = "Use SSE.", default = true, type = "boolean"}) |
||||
|
||||
on_install("windows", "macosx", "linux", function (package) |
||||
io.writefile("xmake.lua", [[ |
||||
add_rules("mode.debug", "mode.release") |
||||
option("sse") |
||||
set_showmenu(true) |
||||
add_defines("USE_SSE") |
||||
target("imagequant") |
||||
set_kind("$(kind)") |
||||
if is_plat("windows") and is_kind("shared") then |
||||
add_rules("utils.symbols.export_all") |
||||
end |
||||
add_files("libimagequant.c", "blur.c", "mediancut.c", "mempool.c", "nearest.c", "pam.c", "kmeans.c") |
||||
add_headerfiles("libimagequant.h") |
||||
add_options("sse") |
||||
]]) |
||||
local configs = {} |
||||
configs.kind = package:config("shared") and "shared" or "static" |
||||
configs.sse = package:config("sse") and true or false |
||||
import("package.tools.xmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("liq_attr_create", {includes = "libimagequant.h"})) |
||||
end) |
Loading…
Reference in new issue