feat: add wavpack (#2312)

* feat: add wavpack

* feat(svt-av1): add license

* fix(wavpack): fix cross compile error

* chore(wavpack): disable cross

* feat(wavpack): some improves

* fix(wavpack): fix wasm build error

* fix(wavpack): fix wasm build error

* fix(wavpack): try to fix windows build error

* feat(wavpack): add options
pull/2324/head
冰雪殇璃陌梦 1 year ago committed by GitHub
parent 7462f0f628
commit 568815bac7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      packages/f/fdk-aac/xmake.lua
  2. 6
      packages/l/libiconv/xmake.lua
  3. 1
      packages/s/svt-av1/xmake.lua
  4. 43
      packages/w/wavpack/xmake.lua

@ -1,6 +1,7 @@
package("fdk-aac")
set_homepage("https://sourceforge.net/projects/opencore-amr/")
set_description("A standalone library of the Fraunhofer FDK AAC code from Android.")
set_license("Apache-2.0")
add_urls("https://github.com/mstorsjo/fdk-aac/archive/refs/tags/v$(version).tar.gz",
"https://github.com/mstorsjo/fdk-aac.git")

@ -15,6 +15,8 @@ package("libiconv")
elseif is_plat("android") then
add_patches("1.x", path.join(os.scriptdir(), "patches", "1.16", "makefile.in.patch"),
"d09e4212040f5adf1faa5cf5a9a18f6f79d4cdce9affb05f2e75df2ea3b3d686")
elseif is_plat("wasm") then
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
end
on_fetch("macosx", "linux", function (package, opt)
@ -46,7 +48,7 @@ package("libiconv")
})
end)
on_install("macosx", "linux", "cross", "android", function (package)
on_install("macosx", "linux", "bsd", "cross", "android", "wasm", function (package)
local configs = {"--disable-dependency-tracking", "--enable-extra-encodings"}
if not package:is_plat("macosx") then
table.insert(configs, "--enable-relocatable")
@ -65,7 +67,7 @@ package("libiconv")
end)
on_test(function (package)
if package:is_plat("macosx", "linux") then
if package:is_plat("macosx", "linux", "bsd") then
os.vrun("iconv --version")
end
assert(package:check_csnippets({test = [[

@ -1,6 +1,7 @@
package("svt-av1")
set_homepage("https://gitlab.com/AOMediaCodec/SVT-AV1")
set_description("Scalable Video Technology for AV1 (SVT-AV1 Encoder and Decoder)")
set_license("BSD-2-clause")
add_urls("https://gitlab.com/AOMediaCodec/SVT-AV1.git",
"https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v$(version)/SVT-AV1-v$(version).tar.gz")

@ -0,0 +1,43 @@
package("wavpack")
set_homepage("https://github.com/dbry/WavPack")
set_description("WavPack encode/decode library, command-line programs, and several plugins")
set_license("BSD-3-Clause")
add_urls("https://github.com/dbry/WavPack//archive/refs/tags/$(version).tar.gz",
"https://github.com/dbry/WavPack.git")
add_versions("4.80.0", "c72cb0bbe6490b84881d61f326611487eedb570d8d2e74f073359578b08322e2")
add_versions("5.4.0", "abbe5ca3fc918fdd64ef216200a5c896243ea803a059a0662cd362d0fa827cd2")
add_versions("5.5.0", "b3d11ba35d12c7d2ed143036478b6f9f4bdac993d84b5ed92615bc6b60697b8a")
add_versions("5.6.0", "44043e8ffe415548d5723e9f4fc6bda5e1f429189491c5fb3df08b8dcf28df72")
add_configs("legacy", {description = "Decode legacy (< 4.0) WavPack files", default = false, type = "boolean"})
add_configs("threads", {description = "Enable support for threading in libwavpack", default = true, type = "boolean"})
add_configs("dsd", {description = "Enable support for WavPack DSD files", default = true, type = "boolean"})
add_deps("cmake")
if not is_plat("windows") then
add_deps("libiconv", "openssl", {optional = true})
end
if is_plat("wasm") then
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
end
on_install("windows", "linux", "bsd", "macosx", "mingw", "android", "wasm", function (package)
local configs = {"-DWAVPACK_INSTALL_CMAKE_MODULE=OFF", "-DWAVPACK_INSTALL_DOCS=OFF", "-DWAVPACK_INSTALL_PKGCONFIG_MODULE=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"))
for name, enabled in pairs(package:configs()) do
if not package:extraconf("configs", name, "builtin") then
table.insert(configs, "-DWAVPACK_ENABLE_" .. name:upper() .. "=" .. (enabled and "ON" or "OFF"))
end
end
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("WavpackOpenRawDecoder", {includes = "wavpack/wavpack.h"}))
end)
Loading…
Cancel
Save