diff options
| author | ruki <[email protected]> | 2017-09-21 23:27:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-09-21 14:42:01 +0800 |
| commit | 034185734b5bc91f8188c15c9e02b0ce8ebaa850 (patch) | |
| tree | 17788345197514d464006129d76a0d36f2addf35 /xmake/packages/git/xmake.lua | |
| parent | 253e814d11d2af31088a22401a28b4a6abef70e3 (diff) | |
improve option and add require option
Diffstat (limited to 'xmake/packages/git/xmake.lua')
| -rw-r--r-- | xmake/packages/git/xmake.lua | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/xmake/packages/git/xmake.lua b/xmake/packages/git/xmake.lua index b1825dc4d..1029771b1 100644 --- a/xmake/packages/git/xmake.lua +++ b/xmake/packages/git/xmake.lua @@ -3,7 +3,14 @@ package("git") set_kind("binary") set_homepage("https://git-scm.com/") set_description("A free and open source distributed version control system") - add_imports("package.manager.install", "lib.detect.find_tool") + + if os.host() == "windows" then + local winenv_arch = ifelse(os.arch() == "x64", "win64", "win32") + add_urls(format("https://github.com/tboox/xmake-%senv/archive/master.zip", winenv_arch)) + add_urls(format("https://coding.net/u/waruqi/p/xmake-%senv/git/archive/master", winenv_arch)) + else + add_imports("package.manager.install") + end on_build(function (package) end) @@ -13,5 +20,13 @@ package("git") end) on_install("windows", function (package) + + -- install winenv with git + local winenv_dir = path.translate("~/.xmake/winenv") + os.mkdir(winenv_dir) + os.cp("*", winenv_dir) + + -- load winenv + import("winenv", {rootdir = winenv_dir})(winenv_dir) end) |
