support ffmpeg for android

pull/39/head
ruki 5 years ago
parent 543364507b
commit 6c35c418db
No known key found for this signature in database
GPG Key ID: 809EF06AD42725BD
  1. 55
      PKGLIST.md
  2. 62
      packages/f/ffmpeg/xmake.lua

@ -7,20 +7,20 @@
|bzip2|cairo|cpp-taskflow|concurrentqueue|boost|concurrentqueue||
|cairo|catch2|doctest|cpp-taskflow|bullet3|cpp-taskflow||
|catch2|concurrentqueue|fmt|doctest|bzip2|doctest||
|cjson|cpp-taskflow|gtest|fmt|cairo|fmt||
|concurrentqueue|doctest|inja|gtest|catch2|gtest||
|cpp-taskflow|expat|libjpeg|inja|cjson|inja||
|doctest|fmt|nlohmann_json|json-c|cmake|json-c||
|expat|freeglut|pcre|libcurl|concurrentqueue|libjpeg||
|ffmpeg|freetype|pcre2|libev|cpp-taskflow|libpng||
|fmt|glew|spdlog|libffi|doctest|libuv||
|fontconfig|go|tbox|libjpeg|expat|libxml2||
|freeglut|gtest|xz|libpng|ffmpeg|lua||
|freetype|inja|zlib|libuv|fmt|nlohmann_json||
|gettext|libcurl||libxml2|fontconfig|spdlog||
|glew|libjpeg||nlohmann_json|freetype|tbox||
|glib|libpng||spdlog|gettext|zlib||
|go|libsdl||tbox|glew|||
|cjson|cpp-taskflow|gtest|fmt|cairo|ffmpeg||
|concurrentqueue|doctest|inja|gtest|catch2|fmt||
|cpp-taskflow|expat|libjpeg|inja|cjson|gtest||
|doctest|fmt|nlohmann_json|json-c|cmake|inja||
|expat|freeglut|pcre|libcurl|concurrentqueue|json-c||
|ffmpeg|freetype|pcre2|libev|cpp-taskflow|libjpeg||
|fmt|glew|spdlog|libffi|doctest|libpng||
|fontconfig|go|tbox|libjpeg|expat|libuv||
|freeglut|gtest|xz|libpng|ffmpeg|libxml2||
|freetype|inja|zlib|libuv|fmt|lua||
|gettext|libcurl||libxml2|fontconfig|nlohmann_json||
|glew|libjpeg||nlohmann_json|freetype|spdlog||
|glib|libpng||spdlog|gettext|tbox||
|go|libsdl||tbox|glew|zlib||
|gperf|libtiff||zlib|glib|||
|gtest|libuv|||go|||
|icu4c|libwebsockets|||gperf|||
@ -38,11 +38,12 @@
|libtiff|spdlog|||libsdl|||
|libusb|sqlite3|||libtask|||
|libuv|tbox|||libtiff|||
|libwebsockets|zlib|||libtool|||
|libxml2||||libusb|||
|lua||||libuv|||
|luajit||||libwebsockets|||
|mbedtls||||libxml2|||
|libwebsockets|unqlite|||libtool|||
|libxml2|zeromq|||libusb|||
|libyaml|zlib|||libuv|||
|lua||||libwebsockets|||
|luajit||||libxml2|||
|mbedtls||||libyaml|||
|mysql||||lua|||
|nana||||luajit|||
|ncurses||||make|||
@ -59,21 +60,23 @@
|spdlog||||patch|||
|sqlite3||||pcre|||
|tbox||||pcre2|||
|util-linux||||pixman|||
|x264||||pkg-config|||
|x265||||protobuf-c|||
|xz||||protobuf-cpp|||
|zlib||||protoc|||
|||||python|||
|||||python2|||
|unqlite||||pixman|||
|util-linux||||pkg-config|||
|x264||||protobuf-c|||
|x265||||protobuf-cpp|||
|xz||||protoc|||
|zeromq||||python|||
|zlib||||python2|||
|||||raylib|||
|||||skia|||
|||||spdlog|||
|||||sqlite3|||
|||||tbox|||
|||||unqlite|||
|||||util-linux|||
|||||x264|||
|||||x265|||
|||||xz|||
|||||yasm|||
|||||zeromq|||
|||||zlib|||

@ -4,11 +4,12 @@ package("ffmpeg")
set_description("A collection of libraries to process multimedia content such as audio, video, subtitles and related metadata.")
add_urls("https://ffmpeg.org/releases/ffmpeg-$(version).tar.bz2", {alias = "home"})
add_urls("https://github.com/FFmpeg/FFmpeg/archive/n$(version).zip", {alias = "github"})
-- add_urls("https://github.com/FFmpeg/FFmpeg/archive/n$(version).zip", {alias = "github"})
add_urls("https://git.ffmpeg.org/ffmpeg.git", "https://github.com/FFmpeg/FFmpeg.git")
add_versions("home:4.0.2", "346c51735f42c37e0712e0b3d2f6476c86ac15863e4445d9e823fe396420d056")
add_versions("github:4.0.2", "4df1ef0bf73b7148caea1270539ef7bd06607e0ea8aa2fbf1bb34062a097f026")
add_configs("ffprobe", { description = "Enable ffprobe program.", default = false, type = "boolean"})
add_configs("ffmpeg", { description = "Enable ffmpeg program.", default = false, type = "boolean"})
add_configs("ffplay", { description = "Enable ffplay program.", default = false, type = "boolean"})
add_configs("zlib", { description = "Enable zlib compression library.", default = false, type = "boolean"})
@ -44,10 +45,10 @@ package("ffmpeg")
end
end)
on_install("linux", "macosx", function (package)
on_install("linux", "macosx", "android@linux,macosx", function (package)
local configs = {"--enable-gpl",
"--enable-version3",
"--enable-avresample"}
"--disable-doc"}
if is_plat("macosx") and macos.version():ge("10.8") then
table.insert(configs, "--enable-videotoolbox")
end
@ -65,7 +66,60 @@ package("ffmpeg")
else
table.insert(configs, "--disable-debug")
end
import("package.tools.autoconf").install(package, configs)
if package:is_plat("android") then
import("core.base.option")
local bin = get_config("bin")
local ndk_sdkver = get_config("ndk_sdkver")
local arch, cpu, triple, cross_prefix
if package:is_arch("arm64-v8a") then
arch = "arm64"
cpu = "armv8-a"
triple = "aarch64-linux-android"
cross_prefix = path.join(bin, "aarch64-linux-android-")
elseif package:is_arch("armv7-a") then
arch = "arm"
cpu = "armv7-a"
triple = "armv7a-linux-androideabi"
cross_prefix = path.join(bin, "arm-linux-androideabi-")
else
raise("unknown arch(%s) for android!", package:arch())
end
local sysroot = path.join(path.directory(bin), "sysroot")
local cflags = table.join(table.wrap(package:config("cxflags")), table.wrap(package:config("cflags")), table.wrap(get_config("cxflags")), get_config("cflags"))
local cxxflags = table.join(table.wrap(package:config("cxflags")), table.wrap(package:config("cxxflags")), table.wrap(get_config("cxflags")), get_config("cxxflags"))
assert(os.isdir(sysroot), "we do not support old version ndk!")
if package:is_arch("arm64-v8a") then
table.insert(cflags, "-mfpu=neon")
table.insert(cflags, "-mfloat-abi=soft")
else
table.insert(cflags, "-mfpu=vfpv3-d16")
table.insert(cflags, "-mfloat-abi=soft")
end
table.insert(configs, "--enable-neon")
table.insert(configs, "--enable-asm")
table.insert(configs, "--enable-jni")
table.insert(configs, "--target-os=android")
table.insert(configs, "--enable-cross-compile")
table.insert(configs, "--disable-avdevice")
table.insert(configs, "--arch=" .. arch)
table.insert(configs, "--cpu=" .. cpu)
table.insert(configs, "--cc=" .. path.join(bin, triple .. ndk_sdkver .. "-clang"))
table.insert(configs, "--cxx=" .. path.join(bin, triple .. ndk_sdkver .. "-clang++"))
table.insert(configs, "--extra-cflags=" .. table.concat(cflags, ' '))
table.insert(configs, "--extra-cxxflags=" .. table.concat(cxxflags, ' '))
table.insert(configs, "--sysroot=" .. sysroot)
table.insert(configs, "--cross-prefix=" .. cross_prefix)
table.insert(configs, "--prefix=" .. package:installdir())
os.vrunv("./configure", configs)
local argv = {"-j4"}
if option.get("verbose") then
table.insert(argv, "V=1")
end
os.vrunv("make", argv)
os.vrun("make install")
else
import("package.tools.autoconf").install(package, configs)
end
end)
on_test(function (package)

Loading…
Cancel
Save