diff options
| -rwxr-xr-x | scripts/PKGBUILD | 13 | ||||
| -rwxr-xr-x | scripts/get.sh | 2 | ||||
| -rw-r--r-- | xmake/actions/update/main.lua | 9 | ||||
| -rw-r--r-- | xmake/actions/update/xmake.lua | 1 |
4 files changed, 10 insertions, 15 deletions
diff --git a/scripts/PKGBUILD b/scripts/PKGBUILD index 5163bb1b3..22f791e5d 100755 --- a/scripts/PKGBUILD +++ b/scripts/PKGBUILD @@ -3,13 +3,13 @@ pkgname=xmake pkgver=2.2.9 -pkgrel=1 +pkgrel=2 pkgdesc="A make-like build utility based on Lua" arch=('i686' 'x86_64') url="https://github.com/xmake-io/xmake" license=('Apache') makedepends=() -source=("$pkgname.tar.gz::https://github.com/xmake-io/xmake/releases/download/v${pkgver}/xmake-v${pkgver}.tar.gz") +source=("$pkgname.tar.gz::https://cdn.jsdelivr.net/gh/xmake-mirror/xmake-releases@${pkgver}/xmake-v${pkgver}.tar.gz") sha256sums=('7d7b4b368808c78cda4bcdd00a140cd8b4cab8f32c7b3c31aa22fdd08dde4940') build() { @@ -19,12 +19,5 @@ build() { package() { cd "$srcdir" - mkdir -p "${pkgdir}/usr/share" - cp -r "./xmake" "${pkgdir}/usr/share/" - install -Dm755 ./core/src/demo/demo.b "${pkgdir}/usr/share/xmake/xmake" - echo "#!/bin/bash -export XMAKE_PROGRAM_DIR=/usr/share/xmake -/usr/share/xmake/xmake \"\$@\" -" > ./xmake.sh - install -Dm755 "./xmake.sh" "${pkgdir}/usr/bin/xmake" + make install prefix="${pkgdir}/usr" } diff --git a/scripts/get.sh b/scripts/get.sh index 48161c2d1..424fe0cfd 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -162,7 +162,7 @@ elif [ 'x__run__' = "x$branch" ]; then pack=gz fi mkdir -p $projectdir - runfile_url="https://cdn.jsdelivr.net/gh/xmake-mirror/xmake-releases@master/xmake-$version.$pack.run" + runfile_url="https://cdn.jsdelivr.net/gh/xmake-mirror/xmake-releases@$version/xmake-$version.$pack.run" echo "downloading $runfile_url .." remote_get_content "$runfile_url" > $projectdir/xmake.run if [[ $? != 0 ]]; then diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua index 79ce6c7b1..13cb9592d 100644 --- a/xmake/actions/update/main.lua +++ b/xmake/actions/update/main.lua @@ -301,7 +301,7 @@ function main() local is_official = fetchinfo.is_official local mainurls = fetchinfo.urls local version = fetchinfo.version - if is_official and xmake.version():eq(version) then + if is_official and xmake.version():eq(version) and not option.get("force") then cprint("${bright}xmake %s has been installed!", version) return end @@ -314,10 +314,11 @@ function main() end if version:find('.', 1, true) then + local winarch = os.arch() == "x64" and "win64" or "win32" mainurls = {format("https://ci.appveyor.com/api/projects/waruqi/xmake/artifacts/xmake-installer.exe?tag=%s&pr=false&job=Image%%3A+Visual+Studio+2017%%3B+Platform%%3A+%s", version, os.arch()), - format("https://github.com/xmake-io/xmake/releases/download/%s/xmake-%s.exe", version, version), - format("https://cdn.jsdelivr.net/gh/xmake-mirror/xmake-releases@master/xmake-%s.exe.zip", version), - format("https://gitlab.com/xmake-mirror/xmake-releases/raw/master/xmake-%s.exe.zip", version)} + format("https://github.com/xmake-io/xmake/releases/download/%s/xmake-%s.%s.exe", version, version, winarch), + format("https://cdn.jsdelivr.net/gh/xmake-mirror/xmake-releases@%s/xmake-%s.%s.exe.zip", version, version, winarch), + format("https://gitlab.com/xmake-mirror/xmake-releases/raw/%s/xmake-%s.%s.exe.zip", version, version, winarch)} else -- regard as a git branch, fetch from ci mainurls = {format("https://ci.appveyor.com/api/projects/waruqi/xmake/artifacts/xmake-installer.exe?branch=%s&pr=false&job=Image%%3A+Visual+Studio+2017%%3B+Platform%%3A+%s", version, os.arch())} diff --git a/xmake/actions/update/xmake.lua b/xmake/actions/update/xmake.lua index 74dcd0ba9..2f272dd07 100644 --- a/xmake/actions/update/xmake.lua +++ b/xmake/actions/update/xmake.lua @@ -41,6 +41,7 @@ task("update") {nil, "uninstall", "k", nil, "Uninstall the current xmake program." } , { } , {'s', "scriptonly", "k", nil, "Update script only" } + , {'f', "force", "k", nil, "Force to update and reinstall the given version." } , {nil, "xmakever", "v", nil, "The given xmake version, or a git source (and branch). ", "e.g.", " from official source: ", |
