From f75d11fb137ffa8bf802199b3fb5a47691482d7f Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 28 Sep 2018 22:54:23 +0800 Subject: [PATCH] remove on_build --- packages/f/fontconfig/xmake.lua | 6 +----- packages/f/freeglut/xmake.lua | 6 +----- packages/f/freetype/xmake.lua | 9 +-------- packages/g/glew/xmake.lua | 8 +------- packages/g/go/xmake.lua | 3 --- packages/l/libjpeg/xmake.lua | 11 ++--------- packages/l/libmill/xmake.lua | 6 +----- packages/l/libpng/xmake.lua | 12 ++---------- packages/l/libsdl/xmake.lua | 9 +-------- packages/l/libtask/xmake.lua | 5 +---- packages/l/libxml2/xmake.lua | 12 ++---------- packages/l/luajit/xmake.lua | 16 +++++----------- packages/m/mbedtls/xmake.lua | 12 +++--------- packages/o/openssl/xmake.lua | 7 ++----- packages/p/pcre/xmake.lua | 12 ++---------- packages/p/pcre2/xmake.lua | 12 ++---------- packages/p/python/xmake.lua | 9 +-------- packages/p/python2/xmake.lua | 9 +-------- packages/p/python3/xmake.lua | 9 +-------- packages/s/sqlite3/xmake.lua | 11 ++--------- packages/t/tbox/xmake.lua | 7 ++----- packages/z/zlib/xmake.lua | 10 ++-------- 22 files changed, 36 insertions(+), 165 deletions(-) diff --git a/packages/f/fontconfig/xmake.lua b/packages/f/fontconfig/xmake.lua index 475b041cf..aebfa7999 100644 --- a/packages/f/fontconfig/xmake.lua +++ b/packages/f/fontconfig/xmake.lua @@ -8,10 +8,6 @@ package("fontconfig") add_deps("freetype") - on_build("linux", "macosx", function (package) - import("package.builder.autoconf").build(package) - end) - on_install("linux", "macosx", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package) end) diff --git a/packages/f/freeglut/xmake.lua b/packages/f/freeglut/xmake.lua index d4c518cb2..470499ef1 100644 --- a/packages/f/freeglut/xmake.lua +++ b/packages/f/freeglut/xmake.lua @@ -11,10 +11,6 @@ package("freeglut") add_deps("cmake") end - on_build("linux", "windows", function (package) - import("package.builder.cmake").build(package) - end) - on_install("linux", "windows", function (package) - import("package.builder.cmake").install(package) + import("package.tools.cmake").install(package) end) diff --git a/packages/f/freetype/xmake.lua b/packages/f/freetype/xmake.lua index ebddee88f..00482eeb9 100644 --- a/packages/f/freetype/xmake.lua +++ b/packages/f/freetype/xmake.lua @@ -11,18 +11,11 @@ package("freetype") add_versions("2.9.1", "ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce") end - on_build("windows", function (package) - end) - on_install("windows", function (package) os.cp("include", package:installdir()) os.cp(is_arch("x64") and "win64/*" or "win32/*", package:installdir("lib")) end) - on_build("linux", "macosx", function (package) - import("package.builder.autoconf").build(package) - end) - on_install("linux", "macosx", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package) end) diff --git a/packages/g/glew/xmake.lua b/packages/g/glew/xmake.lua index ffa84e5c4..97555e9d6 100644 --- a/packages/g/glew/xmake.lua +++ b/packages/g/glew/xmake.lua @@ -11,9 +11,6 @@ package("glew") add_versions("2.1.0", "2700383d4de2455f06114fbaf872684f15529d4bdc5cdea69b5fb0e9aa7763f1") end - on_build("windows", function (package) - end) - on_install("windows", function (package) os.cp("include", package:installdir()) if is_arch("x64") then @@ -26,11 +23,8 @@ package("glew") package:addvar("links", "glew32s") end) - on_build("linux", "macosx", function (package) - os.vrun("make") - end) - on_install("linux", "macosx", function (package) + os.vrun("make") os.cp("lib", package:installdir()) os.cp("include", package:installdir()) end) diff --git a/packages/g/go/xmake.lua b/packages/g/go/xmake.lua index 22c3e4ded..957c65e5c 100644 --- a/packages/g/go/xmake.lua +++ b/packages/g/go/xmake.lua @@ -30,9 +30,6 @@ package("go") end end - on_build(function (package) - end) - on_install("macosx", "linux", "windows", function (package) os.cp("bin", package:installdir()) os.cp("lib", package:installdir()) diff --git a/packages/l/libjpeg/xmake.lua b/packages/l/libjpeg/xmake.lua index 6bfd7f22a..c101d96d1 100644 --- a/packages/l/libjpeg/xmake.lua +++ b/packages/l/libjpeg/xmake.lua @@ -8,20 +8,13 @@ package("libjpeg") add_versions("v9c", "650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122") add_versions("v9b", "240fd398da741669bf3c90366f58452ea59041cacc741a489b99f2f6a0bad052") - on_build("windows", function (package) + on_install("windows", function (package) os.mv("jconfig.vc", "jconfig.h") os.vrun("nmake -f makefile.vc") - end) - - on_install("windows", function (package) os.cp("*.h", package:installdir("include")) os.cp("libjpeg.lib", package:installdir("lib")) end) - on_build("macosx", "linux", function (package) - import("package.builder.autoconf").build(package) - end) - on_install("macosx", "linux", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package) end) diff --git a/packages/l/libmill/xmake.lua b/packages/l/libmill/xmake.lua index d9b8c5460..0833be09c 100644 --- a/packages/l/libmill/xmake.lua +++ b/packages/l/libmill/xmake.lua @@ -8,11 +8,7 @@ package("libmill") add_versions("1.18", "12e538dbee8e52fd719a9a84004e0aba9502a6e62cd813223316a1e45d49577d") add_versions("1.17", "ada513275d8d5a2ce98cdbc47ad491bfb10f5e9a5429656e539a5889f863042d") - on_build("macosx", "linux", function (package) - import("package.builder.autoconf").build(package) - end) - on_install("macosx", "linux", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package) end) diff --git a/packages/l/libpng/xmake.lua b/packages/l/libpng/xmake.lua index 8d0401565..39a95836b 100644 --- a/packages/l/libpng/xmake.lua +++ b/packages/l/libpng/xmake.lua @@ -12,18 +12,10 @@ package("libpng") add_deps("cmake") end - on_build("windows", function (package) - import("package.builder.cmake").build(package) - end) - on_install("windows", function (package) - import("package.builder.cmake").install(package) - end) - - on_build("macosx", "linux", function (package) - import("package.builder.autoconf").build(package) + import("package.tools.cmake").install(package) end) on_install("macosx", "linux", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package) end) diff --git a/packages/l/libsdl/xmake.lua b/packages/l/libsdl/xmake.lua index 716a830ec..5e6ddb02e 100644 --- a/packages/l/libsdl/xmake.lua +++ b/packages/l/libsdl/xmake.lua @@ -11,19 +11,12 @@ package("libsdl") add_versions("2.0.8", "e6a7c71154c3001e318ba7ed4b98582de72ff970aca05abc9f45f7cbdc9088cb") end - on_build("windows", function (package) - end) - on_install("windows", function (package) os.cp("include", package:installdir()) os.cp("lib/$(arch)/*.lib", package:installdir("lib")) os.cp("lib/$(arch)/*.dll", package:installdir("lib")) end) - on_build("macosx", "linux", function (package) - import("package.builder.autoconf").build(package) - end) - on_install("macosx", "linux", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package) end) diff --git a/packages/l/libtask/xmake.lua b/packages/l/libtask/xmake.lua index c4e0e0ebd..bad8e9b47 100644 --- a/packages/l/libtask/xmake.lua +++ b/packages/l/libtask/xmake.lua @@ -7,11 +7,8 @@ package("libtask") add_versions("1.0", "4f484fbb29f8d016fa9f12a7c89abd9b0972cb677319369b076ec1558db7c327") - on_build("macosx", "linux", function (package) - os.vrun("make") - end) - on_install("macosx", "linux", function (package) + os.vrun("make") os.cp("*.h", package:installdir("include")) os.cp("libtask.a", package:installdir("lib")) end) diff --git a/packages/l/libxml2/xmake.lua b/packages/l/libxml2/xmake.lua index 2c4e5235d..50d2110a7 100644 --- a/packages/l/libxml2/xmake.lua +++ b/packages/l/libxml2/xmake.lua @@ -12,24 +12,16 @@ package("libxml2") add_deps("libtool", "autoconf", "automake") end - on_build("windows", function (package) + on_install("windows", function (package) os.cd("win32") os.vrun("cscript configure.js iso8859x=yes iconv=no compiler=msvc cruntime=/MT debug=%s prefix=\"%s\"", package:debug() and "yes" or "no", package:installdir()) os.vrun("nmake /f Makefile.msvc") - end) - - on_install("windows", function (package) - os.cd("win32") os.vrun("nmake /f Makefile.msvc install") package:addvar("includedirs", "include/libxml2") package:addvar("links", "libxml2") end) - on_build("macosx", "linux", function (package) - import("package.builder.autoconf").build(package) - end) - on_install("macosx", "linux", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package) package:addvar("includedirs", "include/libxml2") end) diff --git a/packages/l/luajit/xmake.lua b/packages/l/luajit/xmake.lua index 3875cd8a6..fe6012cc3 100644 --- a/packages/l/luajit/xmake.lua +++ b/packages/l/luajit/xmake.lua @@ -14,23 +14,17 @@ package("luajit") add_versions("2.0.4", "620fa4eb12375021bef6e4f237cbd2dd5d49e56beb414bee052c746beef1807d") add_versions("2.0.5", "874b1f8297c697821f561f9b73b57ffd419ed8f4278c82e05b48806d30c1e979") - on_build("windows", function (package) + on_install("windows", function (package) os.cd("src") os.vrun("msvcbuild.bat") + os.cp("lua51.lib", package:installdir("lib")) + os.cp("lua51.dll", package:installdir("lib")) + os.cp("*.h", package:installdir("include")) end) - on_install("windows", function (package) - os.cp("src/lua51.lib", package:installdir("lib")) - os.cp("src/lua51.dll", package:installdir("lib")) - os.cp("src/*.h", package:installdir("include")) - end) - - on_build("macosx", "linux", function (package) + on_install("macosx", "linux", function (package) io.gsub("./Makefile", "export PREFIX= /usr/local", "export PREFIX=" .. package:installdir()) os.vrun("make") - end) - - on_install("macosx", "linux", function (package) os.vrun("make install") end) diff --git a/packages/m/mbedtls/xmake.lua b/packages/m/mbedtls/xmake.lua index 8a7e9a30b..fcc546899 100644 --- a/packages/m/mbedtls/xmake.lua +++ b/packages/m/mbedtls/xmake.lua @@ -12,19 +12,13 @@ package("mbedtls") add_deps("cmake") end - on_build("windows", function (package) - import("package.builder.cmake").build(package) - end) - on_install("windows", function (package) - import("package.builder.cmake").install(package) + import("package.tools.cmake").install(package) end) - on_build("macosx", "linux", function (package) + on_install("macosx", "linux", function (package) io.gsub("./Makefile", "DESTDIR=/usr/local", "DESTDIR=" .. package:installdir()) os.vrun("make") - end) - - on_install("macosx", "linux", function (package) os.vrun("make install") end) + diff --git a/packages/o/openssl/xmake.lua b/packages/o/openssl/xmake.lua index 67713501b..121a98f56 100644 --- a/packages/o/openssl/xmake.lua +++ b/packages/o/openssl/xmake.lua @@ -10,10 +10,7 @@ package("openssl") add_versions("home:1.1.1", "2836875a0f89c03d0fdf483941512613a50cfb421d6fd94b9f41d7279d586a3d") add_versions("github:1.1.1", "7da8c193d3828a0cb4d866dc75622b2aac392971c3d656f7817fb84355290343") - on_build("linux", "macosx", function (package) - import("package.builder.autoconf").build(package, {package:debug() and "--debug" or ""}) - end) - on_install("linux", "macosx", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package, {package:debug() and "--debug" or ""}) end) + diff --git a/packages/p/pcre/xmake.lua b/packages/p/pcre/xmake.lua index ebafd77ef..425acf208 100644 --- a/packages/p/pcre/xmake.lua +++ b/packages/p/pcre/xmake.lua @@ -13,18 +13,10 @@ package("pcre") add_deps("cmake") end - on_build("windows", function (package) - import("package.builder.cmake").build(package) - end) - on_install("windows", function (package) - import("package.builder.cmake").install(package) - end) - - on_build("macosx", "linux", function (package) - import("package.builder.autoconf").build(package) + import("package.tools.cmake").install(package) end) on_install("macosx", "linux", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package) end) diff --git a/packages/p/pcre2/xmake.lua b/packages/p/pcre2/xmake.lua index 5c1944734..c8fbb172e 100644 --- a/packages/p/pcre2/xmake.lua +++ b/packages/p/pcre2/xmake.lua @@ -14,22 +14,14 @@ package("pcre2") add_deps("cmake") end - on_build("windows", function (package) - import("package.builder.cmake").build(package) - end) - on_install("windows", function (package) - import("package.builder.cmake").install(package) + import("package.tools.cmake").install(package) package:addvar("links", "pcre2-8") package:addvar("defines", "PCRE2_CODE_UNIT_WIDTH=8") end) - on_build("macosx", "linux", function (package) - import("package.builder.autoconf").build(package) - end) - on_install("macosx", "linux", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package) package:addvar("links", "pcre2-8") package:addvar("defines", "PCRE2_CODE_UNIT_WIDTH=8") end) diff --git a/packages/p/python/xmake.lua b/packages/p/python/xmake.lua index c6e8b6e67..63a572089 100644 --- a/packages/p/python/xmake.lua +++ b/packages/p/python/xmake.lua @@ -22,9 +22,6 @@ package("python") add_versions("3.7.0", "85bb9feb6863e04fb1700b018d9d42d1caac178559ffa453d7e6a436e259fd0d") end - on_build(function (package) - end) - on_install("windows", function (package) local installdir = package:installdir("share", package:name(), package:version_str()) if package:version_str():startswith("2.") then @@ -39,12 +36,8 @@ package("python") package:addenv("PATH", path.join("share", package:name(), package:version_str())) end) - on_build("macosx", "linux", function (package) - import("package.builder.autoconf").build(package, {prefix = package:installdir("share", package:name(), package:version_str())}) - end) - on_install("macosx", "linux", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package, {prefix = package:installdir("share", package:name(), package:version_str())}) package:addenv("PATH", path.join("share", package:name(), package:version_str(), "bin")) end) diff --git a/packages/p/python2/xmake.lua b/packages/p/python2/xmake.lua index a353249a2..4e3c886f5 100644 --- a/packages/p/python2/xmake.lua +++ b/packages/p/python2/xmake.lua @@ -17,9 +17,6 @@ package("python2") add_versions("2.7.15", "18617d1f15a380a919d517630a9cd85ce17ea602f9bbdc58ddc672df4b0239db") end - on_build(function (package) - end) - on_install("windows", function (package) local installdir = package:installdir("share", package:name(), package:version_str()) os.mkdir("targetdir") @@ -29,12 +26,8 @@ package("python2") package:addenv("PATH", path.join("share", package:name(), package:version_str())) end) - on_build("macosx", "linux", function (package) - import("package.builder.autoconf").build(package, {prefix = package:installdir("share", package:name(), package:version_str())}) - end) - on_install("macosx", "linux", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package, {prefix = package:installdir("share", package:name(), package:version_str())}) package:addenv("PATH", path.join("share", package:name(), package:version_str(), "bin")) end) diff --git a/packages/p/python3/xmake.lua b/packages/p/python3/xmake.lua index 2f13fed60..2d9b3d9ff 100644 --- a/packages/p/python3/xmake.lua +++ b/packages/p/python3/xmake.lua @@ -17,9 +17,6 @@ package("python3") add_versions("3.7.0", "85bb9feb6863e04fb1700b018d9d42d1caac178559ffa453d7e6a436e259fd0d") end - on_build(function (package) - end) - on_install("windows", function (package) local installdir = package:installdir("share", package:name(), package:version_str()) os.cp("*", installdir) @@ -27,12 +24,8 @@ package("python3") package:addenv("PATH", path.join("share", package:name(), package:version_str())) end) - on_build("macosx", "linux", function (package) - import("package.builder.autoconf").build(package, {prefix = package:installdir("share", package:name(), package:version_str())}) - end) - on_install("macosx", "linux", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package, {prefix = package:installdir("share", package:name(), package:version_str())}) package:addenv("PATH", path.join("share", package:name(), package:version_str(), "bin")) end) diff --git a/packages/s/sqlite3/xmake.lua b/packages/s/sqlite3/xmake.lua index 0eff523fe..eff37f441 100644 --- a/packages/s/sqlite3/xmake.lua +++ b/packages/s/sqlite3/xmake.lua @@ -9,11 +9,8 @@ package("sqlite3") add_versions("3.24.0", "d9d14e88c6fb6d68de9ca0d1f9797477d82fc3aed613558f87ffbdbbc5ceb74a") add_versions("3.23.0", "b7711a1800a071674c2bf76898ae8584fc6c9643cfe933cfc1bc54361e3a6e49") - on_build("windows", function (package) - os.vrun("nmake DEBUG=%s -f Makefile.msc", package:debug() and "1" or "0") - end) - on_install("windows", function (package) + os.vrun("nmake DEBUG=%s -f Makefile.msc", package:debug() and "1" or "0") os.cp("*.h", package:installdir("include")) os.cp("sqlite3.lib", package:installdir("lib")) os.cp("sqlite3.pdb", package:installdir("lib")) @@ -21,10 +18,6 @@ package("sqlite3") os.cp("sqlite3.def", package:installdir("lib")) end) - on_build("macosx", "linux", function (package) - import("package.builder.autoconf").build(package, {package:debug() and "--enable-debug" or ""}) - end) - on_install("macosx", "linux", function (package) - import("package.builder.autoconf").install(package) + import("package.tools.autoconf").install(package, {package:debug() and "--enable-debug" or ""}) end) diff --git a/packages/t/tbox/xmake.lua b/packages/t/tbox/xmake.lua index 0f416b9b7..f59808060 100644 --- a/packages/t/tbox/xmake.lua +++ b/packages/t/tbox/xmake.lua @@ -11,10 +11,7 @@ package("tbox") add_versions("v1.6.2", "5236090b80374b812c136c7fe6b8c694418cbfc9c0a820ec2ba35ff553078c7b") add_versions("v1.6.3", "bc5a957cdb1610c19f0cf94497ad114a0e01fd7d569777e9cb2133c513ef6baa") - on_build(function (package) - import("package.builder.xmake").build(package, {demo = false}) - end) - on_install(function (package) - import("package.builder.xmake").install(package) + import("package.tools.xmake").install(package, {demo = false}) end) + diff --git a/packages/z/zlib/xmake.lua b/packages/z/zlib/xmake.lua index 2e6391c2c..e7f67f703 100644 --- a/packages/z/zlib/xmake.lua +++ b/packages/z/zlib/xmake.lua @@ -9,20 +9,14 @@ package("zlib") add_versions("1.2.10", "8d7e9f698ce48787b6e1c67e6bff79e487303e66077e25cb9784ac8835978017") add_versions("1.2.11", "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1") - on_build("macosx", "linux", function (package) + on_install("macosx", "linux", function (package) os.vrun("./configure --prefix=%s", package:installdir()) os.vrun("make") - end) - - on_install("macosx", "linux", function (package) os.vrun("make install") end) - on_build("windows", function (package) - os.vrun("nmake -f win32\\Makefile.msc zlib.lib") - end) - on_install("windows", function (package) + os.vrun("nmake -f win32\\Makefile.msc zlib.lib") os.cp("zlib.lib", package:installdir("lib")) os.cp("*.h", package:installdir("include")) end)