summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-03-24 23:26:50 +0800
committerruki <[email protected]>2019-03-24 23:26:50 +0800
commit3508e5444a194ce6c993ee0756c021a052416c8b (patch)
tree95eb3f07d60f57520e60eaea160ab736afda2afb
parentf2f734739d1725a20d08b712e11601a37a6f47d3 (diff)
add patch package and fix sort urls
-rw-r--r--xmake/actions/require/impl/package.lua4
-rw-r--r--xmake/repository/packages/p/patch/xmake.lua30
2 files changed, 32 insertions, 2 deletions
diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua
index 4c3da935c..1ebe63ecc 100644
--- a/xmake/actions/require/impl/package.lua
+++ b/xmake/actions/require/impl/package.lua
@@ -302,12 +302,12 @@ end
function _sort_packages_urls(packages)
-- add all urls to fasturl and prepare to sort them together
- for _, package in ipairs(packages) do
+ for _, package in pairs(packages) do
fasturl.add(package:urls())
end
-- sort and update urls
- for _, package in ipairs(packages) do
+ for _, package in pairs(packages) do
package:urls_set(fasturl.sort(package:urls()))
end
end
diff --git a/xmake/repository/packages/p/patch/xmake.lua b/xmake/repository/packages/p/patch/xmake.lua
new file mode 100644
index 000000000..618710035
--- /dev/null
+++ b/xmake/repository/packages/p/patch/xmake.lua
@@ -0,0 +1,30 @@
+package("patch")
+
+ set_kind("binary")
+ set_homepage("http://www.gnu.org/software/patch/patch.html")
+ set_description("GNU patch, which applies diff files to original files.")
+
+ if is_host("windows") then
+ add_urls("https://sourceforge.net/projects/gnuwin32/files/patch/$(version)/patch-$(version)-bin.zip/download")
+ 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_urls("https://github.com/xmake-mirror/patch.git",
+ "https://gitlab.com/xmake-mirror/patch.git",
+ "https://gitee.com/xmake-mirror/patch.git")
+ add_versions("gnuftp:2.7.6", "3d1d001210d76c9f754c12824aa69f25de7cb27bb6765df63455b77601a0dcc9")
+ add_versions("github:2.7.6", "33d5a86bad9813b27dbbe890123d0b88fbcc74d5d997aeadde60c670a2bd0eb9")
+ end
+
+ on_install("windows", function (package)
+ os.cp("bin/*", package:installdir("bin"))
+ end)
+
+ on_install("macosx", "linux", function (package)
+ import("package.tools.autoconf").install(package)
+ end)
+
+ on_test(function (package)
+ os.vrun("patch --version")
+ end)