support libuv and libev for android

pull/18/head
ruki 6 years ago
parent 70aa492b39
commit 6def19fcc1
No known key found for this signature in database
GPG Key ID: 33341DF9719963FA
  1. 14
      PKGLIST.md
  2. 2
      packages/l/libjpeg/xmake.lua
  3. 2
      packages/l/libpng/xmake.lua
  4. 2
      packages/l/libuv/xmake.lua
  5. 2
      packages/z/zlib/xmake.lua
  6. 24
      scripts/packages.lua
  7. 7
      scripts/test.lua

@ -3,13 +3,13 @@
|linux|windows|mingw|iphoneos|macosx|android|
|-----|-------|-----|--------|------|-------|
|autoconf|bzip2|doctest|doctest|autoconf|doctest||
|automake|cairo|nlohmann_json|libjpeg|automake|libjpeg||
|bzip2|cmake|tbox|libpng|bzip2|nlohmann_json||
|cairo|doctest|zlib|nlohmann_json|cairo|tbox||
|cjson|expat||tbox|cjson|zlib||
|cmake(x86_64)|freeglut||zlib|cmake|||
|doctest|freetype|||doctest|||
|expat|glew|||expat|||
|automake|cairo|nlohmann_json|libev|automake|libjpeg||
|bzip2|cmake|tbox|libjpeg|bzip2|libpng||
|cairo|doctest|zlib|libpng|cairo|nlohmann_json||
|cjson|expat||libuv|cjson|tbox||
|cmake(x86_64)|freeglut||nlohmann_json|cmake|zlib||
|doctest|freetype||tbox|doctest|||
|expat|glew||zlib|expat|||
|ffmpeg|go|||ffmpeg|||
|fontconfig|libjpeg|||fontconfig|||
|freeglut|libpng|||freetype|||

@ -15,7 +15,7 @@ package("libjpeg")
os.cp("libjpeg.lib", package:installdir("lib"))
end)
on_install("linux", "macosx", "iphoneos", "android", function (package)
on_install("linux", "macosx", "iphoneos", "android@linux,macosx", function (package)
import("package.tools.autoconf").install(package, {"--enable-shared=no"})
end)

@ -31,7 +31,7 @@ package("libpng")
import("package.tools.autoconf").install(package, {"--disable-dependency-tracking", "--disable-silent-rules", "--enable-shared=no"})
end)
on_install("iphoneos", "android", function (package)
on_install("iphoneos", "android@linux,macosx", function (package)
import("package.tools.autoconf")
local zlib = package:dep("zlib")
local envs = autoconf.buildenvs(package)

@ -33,7 +33,7 @@ package("libuv")
os.cp("include", package:installdir())
end)
on_install("macosx", "linux", "iphoneos", "android", function (package)
on_install("macosx", "linux", "iphoneos", "android@linux,android", function (package)
import("package.tools.autoconf").install(package, {"--enable-shared=no"})
end)

@ -20,7 +20,7 @@ package("zlib")
import("package.tools.autoconf").install(package, {"--static"})
end)
on_install("iphoneos", "android", function (package)
on_install("iphoneos", "android@linux,macosx", "mingw@linux,macosx", function (package)
import("package.tools.autoconf").configure(package, {host = "", "--static"})
io.gsub("Makefile", "\nAR=.-\n", "\nAR=" .. (package:build_getenv("ar") or "") .. "\n")
io.gsub("Makefile", "\nARFLAGS=.-\n", "\nARFLAGS=cr\n")

@ -19,7 +19,17 @@ function _is_supported(instance, plat, arch)
-- match script for special plat and arch
local pattern = plat .. '|' .. arch
for _pattern, _script in pairs(script) do
if not _pattern:startswith("__") and pattern:find('^' .. _pattern .. '$') then
local hosts = {}
local hosts_spec = false
_pattern = _pattern:gsub("@(.+)", function (v)
-- get and remove hosts for `android|armv7-a@macosx,linux`
for _, host in ipairs(v:split(',')) do
hosts[host] = true
hosts_spec = true
end
return ""
end)
if not _pattern:startswith("__") and pattern:find('^' .. _pattern .. '$') and (not hosts_spec or hosts[os.host()]) then
result = _script
break
end
@ -28,7 +38,17 @@ function _is_supported(instance, plat, arch)
-- match script for special plat
if result == nil then
for _pattern, _script in pairs(script) do
if not _pattern:startswith("__") and plat:find('^' .. _pattern .. '$') then
local hosts = {}
local hosts_spec = false
_pattern = _pattern:gsub("@(.+)", function (v)
-- get and remove hosts for `android@macosx,linux`
for _, host in ipairs(v:split(',')) do
hosts[host] = true
hosts_spec = true
end
return ""
end)
if not _pattern:startswith("__") and plat:find('^' .. _pattern .. '$') and (not hosts_spec or hosts[os.host()]) then
result = _script
break
end

@ -11,6 +11,7 @@ local options =
, {'p', "plat", "kv", nil, "Set the given platform." }
, {'a', "arch", "kv", nil, "Set the given architecture." }
, {nil, "ndk", "kv", nil, "Set the android NDK directory."}
, {nil, "mingw", "kv", nil, "Set the MingW directory." }
, {nil, "packages", "vs", nil, "The package list." }
}
@ -32,6 +33,9 @@ function _require_packages(argv, packages)
if argv.ndk then
table.insert(config_argv, "--ndk=" .. argv.ndk)
end
if argv.mingw then
table.insert(config_argv, "--mingw=" .. argv.mingw)
end
os.execv("xmake", config_argv)
local require_argv = {"require", "-f", "-y"}
if argv.verbose then
@ -48,7 +52,8 @@ end
function _package_is_supported(argv, packagename)
local packages = get_packages()
if packages then
local packages_plat = packages[argv.plat or os.host()]
local plat = argv.plat or os.host()
local packages_plat = packages[plat]
for _, package in ipairs(packages_plat) do
if package and packagename:split("%s+")[1] == package.name then
local arch = argv.arch or platform.archs(plat)[1] or os.arch()

Loading…
Cancel
Save