modify on_install

pull/18/head
ruki 6 years ago
parent 50716af7b0
commit 61d9407e4d
No known key found for this signature in database
GPG Key ID: 33341DF9719963FA
  1. 70
      PKGLIST.md
  2. 2
      packages/a/autoconf/xmake.lua
  3. 2
      packages/a/automake/xmake.lua
  4. 4
      packages/c/cmake/xmake.lua
  5. 22
      packages/g/glib/xmake.lua
  6. 2
      packages/l/libtool/xmake.lua
  7. 4
      packages/m/make/xmake.lua
  8. 5
      packages/m/meson/xmake.lua
  9. 2
      packages/n/nasm/xmake.lua
  10. 6
      packages/n/ninja/xmake.lua
  11. 4
      packages/p/patch/xmake.lua
  12. 2
      packages/p/pkg-config/xmake.lua
  13. 2
      packages/y/yasm/xmake.lua
  14. 36
      scripts/packages.lua

@ -2,39 +2,40 @@
|linux|windows|mingw|iphoneos|macosx|android|
|-----|-------|-----|--------|------|-------|
|autoconf|bzip2|doctest|cjson|autoconf|cjson||
|automake|cairo|nlohmann_json|doctest|automake|doctest||
|bzip2|cmake|tbox|json-c|bzip2|json-c||
|cairo|doctest|zlib|libcurl|cairo|libjpeg||
|cjson|expat||libev|cjson|libpng||
|cmake(x86_64)|freeglut||libffi|cmake|libuv||
|doctest|freetype||libjpeg|doctest|libxml2||
|expat|glew||libpng|expat|lua||
|ffmpeg|go||libuv|ffmpeg|nlohmann_json||
|fontconfig|libcurl||libxml2|fontconfig|tbox||
|freeglut|libjpeg||nlohmann_json|freetype|zlib||
|freetype|libpng||tbox|glew|||
|glew|libsdl||zlib|go|||
|go|libuv|||gperf|||
|gperf|lua|||json-c|||
|json-c|luajit|||libcurl|||
|libcurl|make|||libev|||
|libev|ninja|||libffi|||
|libffi|nlohmann_json|||libiconv|||
|libiconv|patch|||libjpeg|||
|libjpeg|pcre|||libmill|||
|libmill|pixman|||libpng|||
|libpng|python|||libsdl|||
|libsdl|python2|||libtask|||
|libtask|skia|||libtool|||
|libtool|sqlite3|||libuv|||
|libuv|tbox|||libxml2|||
|libxml2|zlib|||lua|||
|lua||||luajit|||
|luajit||||make|||
|make||||mbedtls|||
|mbedtls||||meson|||
|meson||||mysql|||
|autoconf|autoconf|autoconf|autoconf|autoconf|autoconf||
|automake|automake|automake|automake|automake|automake||
|bzip2|bzip2|cmake|cjson|bzip2|cjson||
|cairo|cairo|doctest|cmake|cairo|cmake||
|cjson|cmake|libtool|doctest|cjson|doctest||
|cmake|doctest|make|json-c|cmake|json-c||
|doctest|expat|meson|libcurl|doctest|libjpeg||
|expat|freeglut|nasm|libev|expat|libpng||
|ffmpeg|freetype|ninja|libffi|ffmpeg|libtool||
|fontconfig|glew|nlohmann_json|libjpeg|fontconfig|libuv||
|freeglut|go|patch|libpng|freetype|libxml2||
|freetype|libcurl|pkg-config|libtool|glew|lua||
|glew|libjpeg|tbox|libuv|glib|make||
|glib|libpng|yasm|libxml2|go|meson||
|go|libsdl|zlib|make|gperf|nasm||
|gperf|libtool||meson|json-c|ninja||
|json-c|libuv||nasm|libcurl|nlohmann_json||
|libcurl|lua||ninja|libev|patch||
|libev|luajit||nlohmann_json|libffi|pkg-config||
|libffi|make||patch|libiconv|tbox||
|libiconv|meson||pkg-config|libjpeg|yasm||
|libjpeg|nasm||tbox|libmill|zlib||
|libmill|ninja||yasm|libpng|||
|libpng|nlohmann_json||zlib|libsdl|||
|libsdl|patch|||libtask|||
|libtask|pcre|||libtool|||
|libtool|pixman|||libuv|||
|libuv|pkg-config|||libxml2|||
|libxml2|python|||lua|||
|lua|python2|||luajit|||
|luajit|sqlite3|||make|||
|make|tbox|||mbedtls|||
|mbedtls|yasm|||meson|||
|meson|zlib|||mysql|||
|mysql||||nasm|||
|nasm||||ncurses|||
|ncurses||||ninja|||
@ -47,8 +48,7 @@
|pixman||||pkg-config|||
|pkg-config||||python|||
|python||||python2|||
|python2||||skia|||
|skia||||sqlite3|||
|python2||||sqlite3|||
|sqlite3||||tbox|||
|tbox||||util-linux|||
|util-linux||||x264|||

@ -12,7 +12,7 @@ package("autoconf")
add_versions("2.68", "eff70a2916f2e2b3ed7fe8a2d7e63d72cf3a23684b56456b319c3ebce0705d99")
end
on_install("macosx", "linux", function (package)
on_install("@macosx", "@linux", function (package)
import("package.tools.autoconf").install(package)
end)

@ -13,7 +13,7 @@ package("automake")
add_versions("1.9.5", "68712753fcb756f3707b7da554917afb348450eb8530cae3b623a067078596fd")
end
on_install("macosx", "linux", function (package)
on_install("@macosx", "@linux", function (package)
import("package.tools.autoconf").install(package)
io.writefile(path.join(package:installdir("share", "aclocal"), "dirlist"), [[
/usr/local/share/aclocal

@ -32,12 +32,12 @@ package("cmake")
end
end
on_install("macosx", function (package)
on_install("@macosx", function (package)
os.cp("CMake.app/Contents/bin", package:installdir())
os.cp("CMake.app/Contents/share", package:installdir())
end)
on_install("linux|x86_64", "windows", function (package)
on_install("@linux|x86_64", "@windows", function (package)
os.cp("bin", package:installdir())
os.cp("share", package:installdir())
end)

@ -0,0 +1,22 @@
package("glib")
set_homepage("https://developer.gnome.org/glib/")
set_description("Core application library for C.")
set_urls("https://download.gnome.org/sources/glib/2.60/glib-2.60.2.tar.xz")
add_versions("2.60.2", "2ef15475060addfda0443a7e8a52b28a10d5e981e82c083034061daf9a8f80d9")
add_deps("meson", "ninja")
on_install("macosx", "linux", function (package)
local configs = {"-Dbsymbolic_functions=false", "-Ddtrace=false"}
table.insert(configs, "-Dgio_module_dir=" .. path.join(package:installdir(), "lib/gio/modules"))
if is_plat("macosx") then
table.insert(configs, "-Diconv=native")
end
import("package.tools.meson").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("g_convert", {includes = "glib.h"}))
end)

@ -12,7 +12,7 @@ package("libtool")
add_versions("2.4.5", "509cb49c7de14ce7eaf88993cf09fd4071882699dfd874c2e95b31ab107d6987")
end
on_install("macosx", "linux", function (package)
on_install("@macosx", "@linux", function (package)
import("package.tools.autoconf").install(package, {"--disable-dependency-tracking", "--enable-ltdl-install"})
end)

@ -9,12 +9,12 @@ package("make")
"http://mirror.easyname.at/gnu/make/make-$(version).tar.gz")
add_versions("4.2.1", "e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7")
on_install("windows", function(package)
on_install("@windows", function(package)
os.vrun("build_w32.bat")
os.cp("WinRel/gnumake.exe", path.join(package:installdir("bin"), "make.exe"))
end)
on_install("macosx", "linux", function (package)
on_install("@macosx", "@linux", function (package)
import("package.tools.autoconf").install(package, {"--disable-dependency-tracking", "--disable-gtk", "--disable-silent-rules"})
end)

@ -10,9 +10,8 @@ package("meson")
add_deps("ninja", "python 3.x")
on_install("macosx", "linux", function (package)
import("core.base.semver")
local version = semver.new(package:dep("python"):version_str())
on_install("@macosx", "@linux", function (package)
local version = package:dep("python"):version()
local envs = {PYTHONPATH = package:installdir("lib", "python" .. version:major() .. "." .. version:minor(), "site-packages")}
os.vrunv("python3", {"setup.py", "install", "--prefix=" .. package:installdir()}, {envs = envs})
package:addenv("PYTHONPATH", envs.PYTHONPATH)

@ -8,6 +8,6 @@ package("nasm")
"https://repo.or.cz/nasm.git")
add_versions("2.13.03", "812ecfb0dcbc5bd409aaa8f61c7de94c5b8752a7b00c632883d15b2ed6452573")
on_install("linux", "macosx", function (package)
on_install("@linux", "@macosx", function (package)
import("package.tools.autoconf").install(package)
end)

@ -20,15 +20,15 @@ package("ninja")
add_deps("python2")
end
on_install("windows", function (package)
on_install("@windows", function (package)
os.cp("./ninja.exe", package:installdir("bin"))
end)
on_install("macosx", function (package)
on_install("@macosx", function (package)
os.cp("./ninja", package:installdir("bin"))
end)
on_install("linux", function (package)
on_install("@linux", function (package)
os.vrun("python2 configure.py --bootstrap")
os.cp("./ninja", package:installdir("bin"))
end)

@ -15,11 +15,11 @@ package("patch")
add_versions("github:2.7.6", "33d5a86bad9813b27dbbe890123d0b88fbcc74d5d997aeadde60c670a2bd0eb9")
end
on_install("windows", function (package)
on_install("@windows", function (package)
os.cp("bin/*", package:installdir("bin"))
end)
on_install("macosx", "linux", function (package)
on_install("@macosx", "@linux", function (package)
import("package.tools.autoconf").install(package)
end)

@ -10,7 +10,7 @@ package("pkg-config")
add_versions("0.29.2", "6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591")
end
on_install("macosx", "linux", function (package)
on_install("@macosx", "@linux", function (package)
local pcpath = {"/usr/local/lib/pkgconfig", "/usr/lib/pkgconfig"}
if is_host("macosx") then
table.insert(pcpath, "/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/" .. macos.version():major() .. '.' .. macos.version():minor())

@ -8,7 +8,7 @@ package("yasm")
"https://ftp.openbsd.org/pub/OpenBSD/distfiles/yasm-$(version).tar.gz")
add_versions("1.3.0", "3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f")
on_install("linux", "macosx", function (package)
on_install("@linux", "@macosx", function (package)
local configs = {"--disable-python"}
if package:debug() then
table.insert(configs, "--enable-debug")

@ -16,45 +16,33 @@ function _is_supported(instance, plat, arch)
local plat = plat or ""
local arch = arch or ""
-- match script for special plat and arch
local pattern = plat .. '|' .. arch
-- match pattern
--
-- `@linux`
-- `@linux|x86_64`
-- `@macosx,linux`
-- `android@macosx,linux`
-- `android|armv7-a@macosx,linux`
-- `android|armv7-a@macosx,linux|x86_64`
-- `android|armv7-a@linux|x86_64`
--
for _pattern, _script in pairs(script) do
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
if not _pattern:startswith("__") and (not hosts_spec or hosts[os.host() .. '|' .. os.arch()] or hosts[os.host()])
and (_pattern:trim() == "" or (plat .. '|' .. arch):find('^' .. _pattern .. '$') or plat:find('^' .. _pattern .. '$')) then
result = _script
break
end
end
-- match script for special plat
if result == nil then
for _pattern, _script in pairs(script) do
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
end
end
-- get generic script
result = result or script["__generic__"]
end

Loading…
Cancel
Save