bento4: add package (#2594)

* bento4: add package

* fix on_test header

* add ndk check
pull/2599/head
star9029 1 year ago committed by GitHub
parent 34b6b199ce
commit f2534f4167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      packages/b/bento4/xmake.lua

@ -0,0 +1,32 @@
package("bento4")
set_homepage("http://www.bento4.com")
set_description("Full-featured MP4 format, MPEG DASH, HLS, CMAF SDK and tools")
add_urls("https://github.com/axiomatic-systems/Bento4.git")
add_versions("2023.08.08", "2e2dc016274764b8eb511a3503aa37e7334be6bf")
add_deps("cmake")
on_install(function (package)
if package:is_plat("android") then
import("core.tool.toolchain")
local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()})
local ndk_sdkver = ndk:config("ndk_sdkver")
assert(ndk_sdkver and tonumber(ndk_sdkver) > 21, "package(bento4): need ndk api level >= 21 for android")
end
local configs = {"-DBUILD_APPS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_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)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <bento4/Ap4.h>
void test() {
AP4_Result x = AP4::Initialize();
}
]]}))
end)
Loading…
Cancel
Save