add msys subhost

pull/101/head
ruki 4 years ago
parent 57a5f7073e
commit f8dc70f9cc
No known key found for this signature in database
GPG Key ID: 809EF06AD42725BD
  1. 2
      packages/c/cmake/xmake.lua
  2. 2
      packages/l/luajit/port/xmake.lua
  3. 8
      packages/m/m4/xmake.lua
  4. 8
      packages/m/make/xmake.lua
  5. 2
      packages/m/moonjit/port/xmake.lua
  6. 2
      packages/n/ninja/xmake.lua
  7. 2
      packages/o/openexr/xmake.lua
  8. 9
      packages/p/patch/xmake.lua
  9. 2
      packages/p/protoc/xmake.lua
  10. 6
      packages/p/python/xmake.lua
  11. 6
      packages/p/python2/xmake.lua
  12. 2
      packages/t/tbb/xmake.lua
  13. 14
      packages/z/zlib/xmake.lua

@ -49,7 +49,7 @@ package("cmake")
os.cp("CMake.app/Contents/share", package:installdir())
end)
on_install("@linux|x86_64", "@windows", function (package)
on_install("@linux|x86_64", "@windows", "@msys", "@cygwin", function (package)
os.cp("bin", package:installdir())
os.cp("share", package:installdir())
end)

@ -162,7 +162,7 @@ target("buildvm")
else
add_defines("LUAJIT_OS=LUAJIT_OS_OTHER", {public = true})
end
before_build("@windows", function (target)
before_build("@windows", "@msys", "@cygwin", function (target)
if not is_arch("x86", "x64", "mips", "mips64") then
-- @note we need fix `illegal zero-sized array` errors for msvc
io.gsub("src/lj_jit.h", " LJ_K32__MAX\n", " LJ_K32__MAX=1\n")

@ -14,16 +14,10 @@ package("m4")
add_patches("1.4.18", path.join(os.scriptdir(), "patches", "1.4.18", "secure_snprintf.patch"), "c0a408fbffb7255fcc75e26bd8edab116fc81d216bfd18b473668b7739a4158e")
end
on_install("@macosx", "@linux", function (package)
on_install("@macosx", "@linux", "@msys", "@cygwin", function (package)
import("package.tools.autoconf").install(package, {"--disable-dependency-tracking"})
end)
if is_subhost("msys") then
on_install("@windows", function (package)
import("package.tools.autoconf").install(package, {"--disable-dependency-tracking"})
end)
end
on_test(function (package)
os.vrun("m4 --version")
end)

@ -10,11 +10,17 @@ package("make")
add_versions("4.2.1", "e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7")
on_install("@windows", function(package)
os.vrun("build_w32.bat")
import("core.tool.toolchain")
local runenvs = toolchain.load("msvc"):runenvs()
os.vrunv("build_w32.bat", {}, {envs = runenvs})
os.cp("WinRel/gnumake.exe", path.join(package:installdir("bin"), "make.exe"))
end)
on_install("@macosx", "@linux", function (package)
-- fix undefined reference to `__alloca'
if is_subhost("linux") then
io.replace("glob/glob.c", "!defined __alloca && !defined __GNU_LIBRARY__", "1")
end
import("package.tools.autoconf").install(package, {"--disable-dependency-tracking", "--disable-gtk", "--disable-silent-rules"})
end)

@ -162,7 +162,7 @@ target("buildvm")
else
add_defines("LUAJIT_OS=LUAJIT_OS_OTHER", {public = true})
end
before_build("@windows", function (target)
before_build("@windows", "@msys", "@cygwin", function (target)
if not is_arch("x86", "x64", "mips", "mips64") then
-- @note we need fix `illegal zero-sized array` errors for msvc
io.gsub("src/lj_jit.h", " LJ_K32__MAX\n", " LJ_K32__MAX=1\n")

@ -20,7 +20,7 @@ package("ninja")
add_deps("python2", {kind = "binary"})
end
on_install("@windows", function (package)
on_install("@windows", "@msys", "@cygwin", function (package)
os.cp("./ninja.exe", package:installdir("bin"))
end)

@ -13,7 +13,7 @@ package("openexr")
add_configs("build_both", {description = "Build both static library and shared library.", default = false, type = "boolean"})
on_install("macosx", "linux", "windows", "mingw@windows", function (package)
on_install("macosx", "linux", "windows", "mingw@windows", "mingw@msys", function (package)
local configs = {"-DBUILD_TESTING=OFF", "-DINSTALL_OPENEXR_EXAMPLES=OFF", "-DINSTALL_OPENEXR_DOCS=OFF", "-DOPENEXR_BUILD_UTILS=ON"}
if package:config("build_both") then
table.insert(configs, "-DBUILD_SHARED_LIBS=ON")

@ -9,13 +9,12 @@ package("patch")
add_urls("https://github.com/xmake-mirror/patch/releases/download/v2.5.9/patch-$(version)-bin.zip")
add_versions("2.5.9-7", "fabd6517e7bd88e067db9bf630d69bb3a38a08e044fa73d13a704ab5f8dd110b")
else
add_urls("https://ftp.gnu.org/gnu/patch/patch-$(version).tar.bz2", {alias = "gnuftp"})
add_urls("https://github.com/xmake-mirror/patch/archive/v$(version).tar.gz", {alias = "github"})
add_versions("gnuftp:2.7.6", "3d1d001210d76c9f754c12824aa69f25de7cb27bb6765df63455b77601a0dcc9")
add_versions("github:2.7.6", "33d5a86bad9813b27dbbe890123d0b88fbcc74d5d997aeadde60c670a2bd0eb9")
add_urls("https://ftp.gnu.org/gnu/patch/patch-$(version).tar.bz2",
"https://github.com/xmake-mirror/patch/releases/download/v$(version)/patch-$(version).tar.bz2")
add_versions("2.7.6", "3d1d001210d76c9f754c12824aa69f25de7cb27bb6765df63455b77601a0dcc9")
end
on_install("@windows", function (package)
on_install("@windows", "@msys", "@cygwin", function (package)
os.cp("bin/*", package:installdir("bin"))
end)

@ -25,7 +25,7 @@ package("protoc")
add_versions("3.8.0", "91ea92a8c37825bd502d96af9054064694899c5c7ecea21b8d11b1b5e7e993b5")
end
on_install("@windows", "@macosx", function (package)
on_install("@windows", "@msys", "@cygwin", "@macosx", function (package)
os.cp("bin", package:installdir())
os.cp("include", package:installdir())
end)

@ -82,7 +82,7 @@ package("python")
end)
end)
on_install("@windows", function (package)
on_install("@windows", "@msys", "@cygwin", function (package)
if package:version():ge("3.0") then
os.cp("python.exe", path.join(package:installdir("bin"), "python3.exe"))
else
@ -165,5 +165,7 @@ package("python")
os.vrun("python -c \"import pip\"")
os.vrun("python -c \"import setuptools\"")
os.vrun("python -c \"import wheel\"")
assert(package:has_cfuncs("PyModule_New", {includes = "Python.h"}))
if package:kind() ~= "binary" then
assert(package:has_cfuncs("PyModule_New", {includes = "Python.h"}))
end
end)

@ -69,7 +69,7 @@ package("python2")
end)
end)
on_install("@windows", function (package)
on_install("@windows", "@msys", "@cygwin", function (package)
os.cp("python.exe", path.join(package:installdir("bin"), "python2.exe"))
os.mv("*.exe", package:installdir("bin"))
os.mv("*.dll", package:installdir("bin"))
@ -137,5 +137,7 @@ package("python2")
os.vrun("python2 -c \"import pip\"")
os.vrun("python2 -c \"import setuptools\"")
os.vrun("python2 -c \"import wheel\"")
assert(package:has_cfuncs("PyModule_New", {includes = "Python.h"}))
if package:kind() ~= "binary" then
assert(package:has_cfuncs("PyModule_New", {includes = "Python.h"}))
end
end)

@ -18,7 +18,7 @@ package("tbb")
end
end
on_install("macosx", "linux", "mingw@windows", function (package)
on_install("macosx", "linux", "mingw@windows", "mingw@msys", function (package)
local configs = {"-j4", "tbb_build_prefix=build_dir"}
local cfg = package:debug() and "debug" or "release"
table.insert(configs, "cfg=" .. cfg)

@ -16,14 +16,12 @@ package("zlib")
os.cp("*.h", package:installdir("include"))
end)
on_install("mingw@windows", function (package)
if is_subhost("msys") then
io.gsub("win32/Makefile.gcc", "\nCC =.-\n", "\nCC=" .. (package:build_getenv("cc") or "") .. "\n")
io.gsub("win32/Makefile.gcc", "\nAR =.-\n", "\nAR=" .. (package:build_getenv("ar") or "") .. "\n")
import("package.tools.make").build(package, {"-f", "win32/Makefile.gcc", "libz.a"})
os.cp("libz.a", package:installdir("lib"))
os.cp("*.h", package:installdir("include"))
end
on_install("mingw@msys", function (package)
io.gsub("win32/Makefile.gcc", "\nCC =.-\n", "\nCC=" .. (package:build_getenv("cc") or "") .. "\n")
io.gsub("win32/Makefile.gcc", "\nAR =.-\n", "\nAR=" .. (package:build_getenv("ar") or "") .. "\n")
import("package.tools.make").build(package, {"-f", "win32/Makefile.gcc", "libz.a"})
os.cp("libz.a", package:installdir("lib"))
os.cp("*.h", package:installdir("include"))
end)
on_install("macosx", function (package)

Loading…
Cancel
Save