package An official xmake package repository
https://xrepo.xmake.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
2.1 KiB
56 lines
2.1 KiB
4 months ago
|
package("liba52")
|
||
|
set_homepage("https://liba52.sourceforge.io")
|
||
|
set_description("Library for decoding ATSC A/52 (AC-3) audio streams")
|
||
|
set_license("GPL-2.0-or-later")
|
||
|
|
||
|
add_urls("https://git.adelielinux.org/community/a52dec/-/archive/$(version)/a52dec-$(version).tar.bz2",
|
||
|
"https://git.adelielinux.org/community/a52dec.git",
|
||
|
"https://code.videolan.org/videolan/liba52.git",
|
||
|
"https://github.com/Distrotech/a52dec.git")
|
||
|
|
||
|
add_versions("v0.8.0", "d4f26685d32a8c85f86a5cb800554160fb85400298a0a27151c3d1e63a170943")
|
||
|
|
||
|
add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
|
||
|
|
||
|
if is_plat("mingw") and is_subhost("msys") then
|
||
|
add_extsources("pacman::a52dec")
|
||
|
elseif is_plat("linux") then
|
||
|
add_extsources("pacman::a52dec", "apt::liba52-dev")
|
||
|
elseif is_plat("macosx") then
|
||
|
add_extsources("brew::a52dec")
|
||
|
end
|
||
|
|
||
|
if is_plat("windows", "mingw") then
|
||
|
add_syslinks("winmm")
|
||
|
elseif is_plat("linux", "bsd") then
|
||
|
add_syslinks("m")
|
||
|
end
|
||
|
|
||
|
if not is_host("windows") then
|
||
|
add_deps("autoconf", "automake", "libtool", "m4")
|
||
|
end
|
||
|
|
||
|
on_load("windows", function (package)
|
||
|
if package:config("tools") then
|
||
|
package:add("deps", "strings_h", {private = true})
|
||
|
end
|
||
|
end)
|
||
|
|
||
|
on_install("!iphoneos and (!android or android@!windows)", function (package)
|
||
|
if not is_host("windows")then
|
||
|
-- Generate config.h by autotools
|
||
|
local configs = {}
|
||
|
if package:is_plat("android", "bsd", "wasm") then
|
||
|
table.insert(configs, "--disable-oss")
|
||
|
table.insert(configs, "--disable-djbfft")
|
||
|
end
|
||
|
import("package.tools.autoconf").configure(package, configs)
|
||
|
end
|
||
|
os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
|
||
|
import("package.tools.xmake").install(package, {tools = package:config("tools")})
|
||
|
end)
|
||
|
|
||
|
on_test(function (package)
|
||
|
assert(package:has_cfuncs("a52_init", {includes = {"inttypes.h", "a52dec/a52.h"}}))
|
||
|
end)
|