From a21ec09a71f0e4c60957b37eb61e33f1a4ae6e86 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 24 Aug 2021 19:57:35 +0800 Subject: improve virtualenv on linux --- scripts/get.sh | 8 ++++++- scripts/register-completions.sh | 2 ++ scripts/register-virtualenvs.sh | 48 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 scripts/register-virtualenvs.sh (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index 8363b4499..21814e45e 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -227,13 +227,19 @@ write_profile() install_profile() { if [ ! -d ~/.xmake ]; then mkdir ~/.xmake; fi - echo "export PATH=$prefix/bin:\$PATH" > ~/.xmake/profile + echo "export XMAKE_ROOTDIR=$prefix/bin" > ~/.xmake/profile if [ -f "$projectdir/scripts/register-completions.sh" ]; then cat "$projectdir/scripts/register-completions.sh" >> ~/.xmake/profile else remote_get_content "$gitrepo_raw/scripts/register-completions.sh" >> ~/.xmake/profile fi + if [ -f "$projectdir/scripts/register-virtualenvs.sh" ]; then + cat "$projectdir/scripts/register-virtualenvs.sh" >> ~/.xmake/profile + else + remote_get_content "$gitrepo_raw/scripts/register-virtualenvs.sh" >> ~/.xmake/profile + fi + if [[ "$SHELL" = */zsh ]]; then write_profile ~/.zshrc elif [[ "$SHELL" = */ksh ]]; then diff --git a/scripts/register-completions.sh b/scripts/register-completions.sh index e274605b2..c93cfb15e 100755 --- a/scripts/register-completions.sh +++ b/scripts/register-completions.sh @@ -1,6 +1,8 @@ # parameter completions for *nix shell +export PATH=${XMAKE_ROOTDIR}:$PATH + if [[ "$SHELL" = */zsh ]]; then # zsh parameter completion for xmake _xmake_zsh_complete() diff --git a/scripts/register-virtualenvs.sh b/scripts/register-virtualenvs.sh new file mode 100644 index 000000000..13a661435 --- /dev/null +++ b/scripts/register-virtualenvs.sh @@ -0,0 +1,48 @@ + +# virtual environments for *nix shell + +if test "${XMAKE_ROOTDIR}"; then + export XMAKE_EXE=${XMAKE_ROOTDIR}/xmake +else + export XMAKE_EXE=xmake +fi + +function xrepo { + if [ $# -eq 2 ] && [ "$1" = "env" ]; then + local cmd="${2-x}" + case "$cmd" in + shell) + if test "${XMAKE_PROMPT_BACKUP}"; then + PS1="${XMAKE_PROMPT_BACKUP}" + source "${XMAKE_ENV_BACKUP}" || return 1 + unset XMAKE_PROMPT_BACKUP + unset XMAKE_ENV_BACKUP + fi + "$XMAKE_EXE" lua private.xrepo.action.env.info config || return 1 + local prompt="$("$XMAKE_EXE" lua private.xrepo.action.env.info prompt)" || return 1 + if [ -z "${prompt+x}" ]; then + return 1 + fi + local activateCommand="$("$XMAKE_EXE" lua private.xrepo.action.env.info script.bash)" || return 1 + export XMAKE_ENV_BACKUP="$("$XMAKE_EXE" lua private.xrepo.action.env.info envfile)" + export XMAKE_PROMPT_BACKUP="${PS1}" + "$XMAKE_EXE" lua private.xrepo.action.env.info backup.bash 1>"$XMAKE_ENV_BACKUP" + eval "$activateCommand" + PS1="${prompt} $PS1" + ;; + quit) + if test "${XMAKE_PROMPT_BACKUP}"; then + PS1="${XMAKE_PROMPT_BACKUP}" + source "${XMAKE_ENV_BACKUP}" || return 1 + unset XMAKE_PROMPT_BACKUP + unset XMAKE_ENV_BACKUP + fi + ;; + *) + "$XMAKE_EXE" lua private.xrepo $@ + ;; + esac + else + "$XMAKE_EXE" lua private.xrepo $@ + fi +} -- cgit v1.3.1 From e273de15d253d4dc1b904e4fa0da5fb1bbe57304 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 24 Aug 2021 21:11:47 +0800 Subject: move PATH setting to toplevel --- scripts/get.sh | 3 ++- scripts/register-completions.sh | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index 21814e45e..060ee4e20 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -227,7 +227,8 @@ write_profile() install_profile() { if [ ! -d ~/.xmake ]; then mkdir ~/.xmake; fi - echo "export XMAKE_ROOTDIR=$prefix/bin" > ~/.xmake/profile + echo "export XMAKE_ROOTDIR=\"$prefix/bin\"" > ~/.xmake/profile + echo "export PATH=\"${XMAKE_ROOTDIR}:$PATH\"" >> ~/.xmake/profile if [ -f "$projectdir/scripts/register-completions.sh" ]; then cat "$projectdir/scripts/register-completions.sh" >> ~/.xmake/profile else diff --git a/scripts/register-completions.sh b/scripts/register-completions.sh index c93cfb15e..e274605b2 100755 --- a/scripts/register-completions.sh +++ b/scripts/register-completions.sh @@ -1,8 +1,6 @@ # parameter completions for *nix shell -export PATH=${XMAKE_ROOTDIR}:$PATH - if [[ "$SHELL" = */zsh ]]; then # zsh parameter completion for xmake _xmake_zsh_complete() -- cgit v1.3.1 From b54b0ba654bb8b230efff2bd709839cf32bfb87e Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 24 Aug 2021 22:21:17 +0800 Subject: make prompt output more robust --- scripts/register-virtualenvs.sh | 2 +- scripts/xrepo.bat | 6 +++--- xmake/modules/private/xrepo/action/env.lua | 2 +- xmake/scripts/xrepo-hook.psm1 | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/register-virtualenvs.sh b/scripts/register-virtualenvs.sh index 13a661435..700d8dd99 100644 --- a/scripts/register-virtualenvs.sh +++ b/scripts/register-virtualenvs.sh @@ -19,7 +19,7 @@ function xrepo { unset XMAKE_ENV_BACKUP fi "$XMAKE_EXE" lua private.xrepo.action.env.info config || return 1 - local prompt="$("$XMAKE_EXE" lua private.xrepo.action.env.info prompt)" || return 1 + local prompt="$("$XMAKE_EXE" lua --quiet private.xrepo.action.env.info prompt)" || return 1 if [ -z "${prompt+x}" ]; then return 1 fi diff --git a/scripts/xrepo.bat b/scripts/xrepo.bat index c8714a11c..77acf7d24 100755 --- a/scripts/xrepo.bat +++ b/scripts/xrepo.bat @@ -22,7 +22,7 @@ if !errorlevel! neq 0 ( exit /B !errorlevel! ) - @%XMAKE_EXE% lua private.xrepo.action.env.info prompt 1>nul + @%XMAKE_EXE% lua --quiet private.xrepo.action.env.info prompt 1>nul if !errorlevel! neq 0 ( echo error: xmake.lua not found^^! exit /B !errorlevel! @@ -39,13 +39,13 @@ if !errorlevel! neq 0 ( exit /B !errorlevel! ) - @%XMAKE_EXE% lua private.xrepo.action.env.info prompt 1>nul + @%XMAKE_EXE% lua --quiet private.xrepo.action.env.info prompt 1>nul if !errorlevel! neq 0 ( echo error: xmake.lua not found^^! exit /B !errorlevel! ) endlocal - for /f %%i in ('@%XMAKE_EXE% lua private.xrepo.action.env.info prompt') do @( + for /f %%i in ('@%XMAKE_EXE% lua --quiet private.xrepo.action.env.info prompt') do @( @set "PROMPT=%%i %PROMPT%" ) @set XMAKE_PROMPT_BACKUP=%PROMPT% diff --git a/xmake/modules/private/xrepo/action/env.lua b/xmake/modules/private/xrepo/action/env.lua index 297a0717c..91d9317ed 100644 --- a/xmake/modules/private/xrepo/action/env.lua +++ b/xmake/modules/private/xrepo/action/env.lua @@ -317,7 +317,7 @@ end function info(key) if key == "prompt" then assert(os.isfile(os.projectfile()), "xmake.lua not found!") - print("[%s]", path.filename(os.projectdir())) + io.write("[" .. path.filename(os.projectdir()) .. "]") elseif key == "envfile" then print(os.tmpfile()) elseif key == "config" then diff --git a/xmake/scripts/xrepo-hook.psm1 b/xmake/scripts/xrepo-hook.psm1 index 902ef3b16..53342fba0 100644 --- a/xmake/scripts/xrepo-hook.psm1 +++ b/xmake/scripts/xrepo-hook.psm1 @@ -21,7 +21,7 @@ function Enter-XrepoEnvironment { } $xmakeColorTermBackup, $Env:XMAKE_COLORTERM = $Env:XMAKE_COLORTERM, "nocolor"; - $xrepoPrompt = (& $Env:XMAKE_EXE lua private.xrepo.action.env.info prompt | Out-String); + $xrepoPrompt = (& $Env:XMAKE_EXE lua --quiet private.xrepo.action.env.info prompt | Out-String); $Env:XMAKE_COLORTERM = $xmakeColorTermBackup; if (-not $xrepoPrompt.StartsWith("[")) { Write-Host $xrepoPrompt; -- cgit v1.3.1 From 34241bb3d8a1dec0ead81316473e505eb2e5f713 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 24 Aug 2021 23:14:16 +0800 Subject: fix xmake not found issue --- scripts/get.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index 060ee4e20..76d329116 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -227,8 +227,8 @@ write_profile() install_profile() { if [ ! -d ~/.xmake ]; then mkdir ~/.xmake; fi - echo "export XMAKE_ROOTDIR=\"$prefix/bin\"" > ~/.xmake/profile - echo "export PATH=\"${XMAKE_ROOTDIR}:$PATH\"" >> ~/.xmake/profile + echo "export XMAKE_ROOTDIR=\"$prefix/bin\"\n" > ~/.xmake/profile + echo 'export PATH="$XMAKE_ROOTDIR:$PATH"' >> ~/.xmake/profile if [ -f "$projectdir/scripts/register-completions.sh" ]; then cat "$projectdir/scripts/register-completions.sh" >> ~/.xmake/profile else -- cgit v1.3.1 From 65cd1d83d3f61415607b8976e7b5c215b67e42a8 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 24 Aug 2021 23:46:40 +0800 Subject: fix typo --- scripts/get.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index 76d329116..f64ff8041 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -227,7 +227,7 @@ write_profile() install_profile() { if [ ! -d ~/.xmake ]; then mkdir ~/.xmake; fi - echo "export XMAKE_ROOTDIR=\"$prefix/bin\"\n" > ~/.xmake/profile + echo "export XMAKE_ROOTDIR=\"$prefix/bin\"" > ~/.xmake/profile echo 'export PATH="$XMAKE_ROOTDIR:$PATH"' >> ~/.xmake/profile if [ -f "$projectdir/scripts/register-completions.sh" ]; then cat "$projectdir/scripts/register-completions.sh" >> ~/.xmake/profile -- cgit v1.3.1 From 08972d1a6c563c8793b3396fce2bc9545725aa85 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 29 Aug 2021 08:34:31 +0800 Subject: update xmake.spec --- scripts/rpmbuild/SPECS/xmake.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index 7c7d5ed38..a20b91ee9 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -1,4 +1,4 @@ -%define xmake_revision fd248b8b97f62762ce6ea6e0008b4367bef29d4d +%define xmake_revision c022587f0c32859b74f6fa16c7a3e16094bbbd7c %define tbox_revision 5ef932750ede0b90867fd4afdcf1deed2464c82b %define sv_revision 9a3cf7c8e589de4f70378824329882c4a047fffc %define lua_cjson_revision 515bab6d6d80b164b94db73af69609ea02f3a798 @@ -7,7 +7,7 @@ %undefine _disable_source_fetch Name: xmake -Version: 2.5.6 +Version: 2.5.7 Release: 1%{?dist} Summary: A cross-platform build utility based on Lua BuildArch: noarch -- cgit v1.3.1 From 627b5c112188b76ce6e3ea625015934024d9e68d Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 7 Sep 2021 11:17:52 +0800 Subject: improve xrepo as function --- scripts/register-virtualenvs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/register-virtualenvs.sh b/scripts/register-virtualenvs.sh index 700d8dd99..aa97afec5 100644 --- a/scripts/register-virtualenvs.sh +++ b/scripts/register-virtualenvs.sh @@ -39,10 +39,10 @@ function xrepo { fi ;; *) - "$XMAKE_EXE" lua private.xrepo $@ + "$XMAKE_EXE" lua private.xrepo "$@" ;; esac else - "$XMAKE_EXE" lua private.xrepo $@ + "$XMAKE_EXE" lua private.xrepo "$@" fi } -- cgit v1.3.1 From 413dfb47ea08bb19b91a96cd7ce44249821e8c6a Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 24 Sep 2021 16:00:47 +0800 Subject: update get.ps1 and remove appveyor --- scripts/get.ps1 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/get.ps1 b/scripts/get.ps1 index 8cb27a888..a8834718d 100755 --- a/scripts/get.ps1 +++ b/scripts/get.ps1 @@ -11,6 +11,7 @@ param ( ) & { + $LastRelease = "v2.5.7" $ErrorActionPreference = 'Stop' function writeErrorTip($msg) { @@ -30,9 +31,9 @@ param ( } if ($IsLinux -or $IsMacOS) { - writeErrorTip 'Install on *nix is not supported, try ' + writeErrorTip 'Install on *nix is not supported, try ' writeErrorTip '(Use curl) "bash <(curl -fsSL https://raw.githubusercontent.com/xmake-io/xmake/master/scripts/get.sh)"' - writeErrorTip 'or' + writeErrorTip 'or' writeErrorTip '(Use wget) "bash <(wget https://raw.githubusercontent.com/xmake-io/xmake/master/scripts/get.sh -O -)"' throw 'Unsupported platform' } @@ -90,7 +91,7 @@ param ( $url = if ($v -is [version]) { "https://github.com/xmake-io/xmake/releases/download/v$v/xmake-v$v.$winarch.exe" } else { - "https://ci.appveyor.com/api/projects/waruqi/xmake/artifacts/xmake-installer.exe?branch=$v&pr=false&job=Image%3A+Visual+Studio+2017%3B+Platform%3A+$arch" + "https://github.com/xmake-io/xmake/releases/download/$LastRelease/xmake-$v.$winarch.exe" } Write-Host "Start downloading $url .." try { @@ -145,9 +146,9 @@ param ( writeErrorTip "Please try again as administrator" return } - + if ($content) { - $content = [System.Text.RegularExpressions.Regex]::Replace($content, "\n*(# PowerShell parameter completion shim for xmake)?\s*Register-ArgumentCompleter -Native -CommandName xmake -ScriptBlock\s*{.+?\n}\s*", "`n", [System.Text.RegularExpressions.RegexOptions]::Singleline) + $content = [System.Text.RegularExpressions.Regex]::Replace($content, "\n*(# PowerShell parameter completion shim for xmake)?\s*Register-ArgumentCompleter -Native -CommandName xmake -ScriptBlock\s*{.+?\n}\s*", "`n", [System.Text.RegularExpressions.RegexOptions]::Singleline) } try { $appendcontent = (Invoke-Webrequest 'https://xmake.io/assets/scripts/pscompletions.text' -UseBasicParsing).Content -- cgit v1.3.1 From c8208e5fe715ae140aff4bfc91d8ea1dbcaf9fad Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 8 Oct 2021 22:38:59 +0800 Subject: update spec --- scripts/rpmbuild/SPECS/xmake.spec | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index a20b91ee9..17939bad5 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -1,8 +1,9 @@ %define xmake_revision c022587f0c32859b74f6fa16c7a3e16094bbbd7c -%define tbox_revision 5ef932750ede0b90867fd4afdcf1deed2464c82b +%define tbox_revision 7ca5145d40aa906fdc48b0b0e75e80412241be7e %define sv_revision 9a3cf7c8e589de4f70378824329882c4a047fffc %define lua_cjson_revision 515bab6d6d80b164b94db73af69609ea02f3a798 %define luajit_revision e9af1abec542e6f9851ff2368e7f196b6382a44c +%define lua_revision 75ea9ccbea7c4886f30da147fb67b693b2624c26 %define _binaries_in_noarch_packages_terminate_build 0 %undefine _disable_source_fetch @@ -15,9 +16,10 @@ License: ASL 2.0 URL: https://xmake.io Source0: https://github.com/xmake-io/xmake/archive/%{xmake_revision}.tar.gz#/xmake-%{xmake_revision}.tar.gz Source1: https://github.com/tboox/tbox/archive/%{tbox_revision}.tar.gz#/tbox-%{tbox_revision}.tar.gz -Source2: https://github.com/xmake-io/xmake-core-luajit/archive/%{luajit_revision}.tar.gz#/xmake-core-luajit-%{luajit_revision}.tar.gz -Source3: https://github.com/xmake-io/xmake-core-sv/archive/%{sv_revision}.tar.gz#/xmake-core-sv-%{sv_revision}.tar.gz -Source4: https://github.com/xmake-io/xmake-core-lua-cjson/archive/%{lua_cjson_revision}.tar.gz#/xmake-core-lua-cjson-%{lua_cjson_revision}.tar.gz +Source2: https://github.com/xmake-io/xmake-core-lua/archive/%{lua_revision}.tar.gz#/xmake-core-lua-%{lua_revision}.tar.gz +Source3: https://github.com/xmake-io/xmake-core-luajit/archive/%{luajit_revision}.tar.gz#/xmake-core-luajit-%{luajit_revision}.tar.gz +Source4: https://github.com/xmake-io/xmake-core-sv/archive/%{sv_revision}.tar.gz#/xmake-core-sv-%{sv_revision}.tar.gz +Source5: https://github.com/xmake-io/xmake-core-lua-cjson/archive/%{lua_cjson_revision}.tar.gz#/xmake-core-lua-cjson-%{lua_cjson_revision}.tar.gz BuildRequires: gcc-c++ BuildRequires: ncurses-devel @@ -38,19 +40,23 @@ system to help users solve the integrated use of C/C++ dependent libraries. %prep %setup -q -T -b 1 -n tbox-%{tbox_revision} cd .. -%setup -q -T -b 2 -n xmake-core-luajit-%{luajit_revision} +%setup -q -T -b 2 -n xmake-core-lua-%{lua_revision} cd .. -%setup -q -T -b 3 -n xmake-core-sv-%{sv_revision} +%setup -q -T -b 3 -n xmake-core-luajit-%{luajit_revision} cd .. -%setup -q -T -b 4 -n xmake-core-lua-cjson-%{lua_cjson_revision} +%setup -q -T -b 4 -n xmake-core-sv-%{sv_revision} +cd .. +%setup -q -T -b 5 -n xmake-core-lua-cjson-%{lua_cjson_revision} cd .. %setup -q -T -b 0 -n xmake-%{xmake_revision} rm -rf core/src/sv/sv rm -rf core/src/tbox/tbox +rm -rf core/src/lua/lua rm -rf core/src/luajit/luajit rm -rf core/src/lua-cjson/lua-cjson ln -s `pwd`/../tbox-%{tbox_revision} core/src/tbox/tbox ln -s `pwd`/../xmake-core-sv-%{sv_revision} core/src/sv/sv +ln -s `pwd`/../xmake-core-lua-%{lua_revision} core/src/lua/lua ln -s `pwd`/../xmake-core-luajit-%{luajit_revision} core/src/luajit/luajit ln -s `pwd`/../xmake-core-lua-cjson-%{lua_cjson_revision} core/src/lua-cjson/lua-cjson -- cgit v1.3.1 From f00a152d2cd5238a74699394e0f396654cbf421e Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 9 Oct 2021 00:48:10 +0800 Subject: update spec --- CHANGELOG.md | 4 ++++ scripts/rpmbuild/SPECS/xmake.spec | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/CHANGELOG.md b/CHANGELOG.md index 61e2fe137..2d6b88ccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master (unreleased) +## v2.5.8 + ### New features * [#388](https://github.com/xmake-io/xmake/issues/388): Pascal Language Support @@ -1088,6 +1090,8 @@ ## master (开发中) +## v2.5.8 + ### 新特性 * [#388](https://github.com/xmake-io/xmake/issues/388): Pascal 语言支持,可以使用 fpc 来编译 free pascal diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index 17939bad5..cbc0e928a 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -1,4 +1,4 @@ -%define xmake_revision c022587f0c32859b74f6fa16c7a3e16094bbbd7c +%define xmake_revision 703d5a016e2c1881990fc34e2e989b28e7673aa2 %define tbox_revision 7ca5145d40aa906fdc48b0b0e75e80412241be7e %define sv_revision 9a3cf7c8e589de4f70378824329882c4a047fffc %define lua_cjson_revision 515bab6d6d80b164b94db73af69609ea02f3a798 -- cgit v1.3.1 From b09c9d8f16682eb201382f1b9be871d18f397fc7 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 10 Oct 2021 13:08:01 +0800 Subject: Update get.ps1 --- scripts/get.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get.ps1 b/scripts/get.ps1 index a8834718d..f03d80fa4 100755 --- a/scripts/get.ps1 +++ b/scripts/get.ps1 @@ -11,7 +11,7 @@ param ( ) & { - $LastRelease = "v2.5.7" + $LastRelease = "v2.5.8" $ErrorActionPreference = 'Stop' function writeErrorTip($msg) { -- cgit v1.3.1 From a722feae41c2cdc6635a4997f2ebfa4bfbde3e19 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 10 Oct 2021 20:44:27 +0800 Subject: update spec --- scripts/rpmbuild/SPECS/xmake.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index cbc0e928a..6d2455c2c 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -1,9 +1,9 @@ -%define xmake_revision 703d5a016e2c1881990fc34e2e989b28e7673aa2 +%define xmake_revision 3f673bdf28f6351e6f8ca83d4b84f598079a8e1f %define tbox_revision 7ca5145d40aa906fdc48b0b0e75e80412241be7e %define sv_revision 9a3cf7c8e589de4f70378824329882c4a047fffc %define lua_cjson_revision 515bab6d6d80b164b94db73af69609ea02f3a798 %define luajit_revision e9af1abec542e6f9851ff2368e7f196b6382a44c -%define lua_revision 75ea9ccbea7c4886f30da147fb67b693b2624c26 +%define lua_revision eadd8c7178c79c814ecca9652973a9b9dd4cc71b %define _binaries_in_noarch_packages_terminate_build 0 %undefine _disable_source_fetch -- cgit v1.3.1 From b2da3200b61621acfb29ab88d1c8f5888f8f9713 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 10 Oct 2021 20:46:17 +0800 Subject: update spec --- scripts/rpmbuild/SPECS/xmake.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index 6d2455c2c..17d30d457 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -8,7 +8,7 @@ %undefine _disable_source_fetch Name: xmake -Version: 2.5.7 +Version: 2.5.8 Release: 1%{?dist} Summary: A cross-platform build utility based on Lua BuildArch: noarch -- cgit v1.3.1 From 07a58ccc42a8a752cecb895254238baae9abdd50 Mon Sep 17 00:00:00 2001 From: goiabae Date: Fri, 22 Oct 2021 00:26:59 -0300 Subject: added xbps as pm option --- scripts/get.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index f64ff8041..f7ef65acf 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -156,9 +156,11 @@ install_tools() { emerge -V >/dev/null 2>&1 && $sudoprefix emerge -atv dev-vcs/git ccache; } || { pkg list-installed >/dev/null 2>&1 && $sudoprefix pkg install -y git getconf build-essential readline ccache; } || # termux { pkg help >/dev/null 2>&1 && $sudoprefix pkg install -y git readline ccache ncurses; } || # freebsd - { apk --version >/dev/null 2>&1 && $sudoprefix apk add git gcc g++ make readline-dev ncurses-dev libc-dev linux-headers; } + { apk --version >/dev/null 2>&1 && $sudoprefix apk add git gcc g++ make readline-dev ncurses-dev libc-dev linux-headers; } || + { xbps-install --version >/dev/null 2>&1 && $sudoprefix xbps-install -Sy git base-devel ccache; } #void + } -test_tools || { install_tools && test_tools; } || my_exit "$(echo -e 'Dependencies Installation Fail\nThe getter currently only support these package managers\n\t* apt\n\t* yum\n\t* zypper\n\t* pacman\n\t* portage\nPlease install following dependencies manually:\n\t* git\n\t* build essential like `make`, `gcc`, etc\n\t* libreadline-dev (readline-devel)\n\t* ccache (optional)')" 1 +test_tools || { install_tools && test_tools; } || my_exit "$(echo -e 'Dependencies Installation Fail\nThe getter currently only support these package managers\n\t* apt\n\t* yum\n\t* zypper\n\t* pacman\n\t* portage\n\t* xbps\n Please install following dependencies manually:\n\t* git\n\t* build essential like `make`, `gcc`, etc\n\t* libreadline-dev (readline-devel)\n\t* ccache (optional)')" 1 projectdir=$tmpdir if [ 'x__local__' = "x$branch" ]; then if [ -d '.git' ]; then -- cgit v1.3.1 From c8fc101fa5289a657dca1fdfe8a3b6195cfe3776 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 29 Oct 2021 22:54:08 +0800 Subject: improve get.sh --- scripts/get.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index f7ef65acf..4aa988526 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -143,7 +143,8 @@ test_tools() echo -e "$prog" | clang -xc - -o /dev/null -lreadline || echo -e "$prog" | cc -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline || echo -e "$prog" | gcc -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline || - echo -e "$prog" | clang -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline + echo -e "$prog" | clang -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline || + echo -e "$prog" | cc -xc -c - -o /dev/null -I/usr/include -I/usr/local/include } } >/dev/null 2>&1 } @@ -156,6 +157,7 @@ install_tools() { emerge -V >/dev/null 2>&1 && $sudoprefix emerge -atv dev-vcs/git ccache; } || { pkg list-installed >/dev/null 2>&1 && $sudoprefix pkg install -y git getconf build-essential readline ccache; } || # termux { pkg help >/dev/null 2>&1 && $sudoprefix pkg install -y git readline ccache ncurses; } || # freebsd + { nix-env --version >/dev/null 2>&1 && nix-env -i git gcc readline ncurses; } || # nixos { apk --version >/dev/null 2>&1 && $sudoprefix apk add git gcc g++ make readline-dev ncurses-dev libc-dev linux-headers; } || { xbps-install --version >/dev/null 2>&1 && $sudoprefix xbps-install -Sy git base-devel ccache; } #void -- cgit v1.3.1 From 72e8db58ba933ab481929525a3c524a316ff4251 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 29 Oct 2021 22:56:09 +0800 Subject: fix get.sh for nixos --- scripts/get.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index 4aa988526..834289767 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -40,7 +40,7 @@ remote_get_content() { if curl --version >/dev/null 2>&1 then curl -fSL "$1" - elif wget --version >/dev/null 2>&1 + elif wget --version >/dev/null 2>&1 || wget --help >/dev/null 2>&1 then wget "$1" -O - fi -- cgit v1.3.1 From 9070ba7533f5d3081ef9b6f46bf15752c674067d Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 29 Oct 2021 22:58:19 +0800 Subject: improve get.sh --- scripts/get.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index 834289767..8abf1e26e 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -144,7 +144,9 @@ test_tools() echo -e "$prog" | cc -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline || echo -e "$prog" | gcc -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline || echo -e "$prog" | clang -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline || - echo -e "$prog" | cc -xc -c - -o /dev/null -I/usr/include -I/usr/local/include + echo -e "$prog" | cc -xc -c - -o /dev/null -I/usr/include -I/usr/local/include || + echo -e "$prog" | gcc -xc -c - -o /dev/null -I/usr/include -I/usr/local/include || + echo -e "$prog" | clang -xc -c - -o /dev/null -I/usr/include -I/usr/local/include } } >/dev/null 2>&1 } -- cgit v1.3.1 From 5db0e363896320b0cde42dd857a61941176df6e6 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 29 Oct 2021 23:00:28 +0800 Subject: improve get.sh --- scripts/get.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index 8abf1e26e..01634a967 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -133,17 +133,14 @@ my_exit(){ } test_tools() { - prog='#include \n#include \nint main(){readline(0);return 0;}' + prog='#include \nint main(){return 0;}' { git --version && $make --version && { - echo -e "$prog" | cc -xc - -o /dev/null -lreadline || - echo -e "$prog" | gcc -xc - -o /dev/null -lreadline || - echo -e "$prog" | clang -xc - -o /dev/null -lreadline || - echo -e "$prog" | cc -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline || - echo -e "$prog" | gcc -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline || - echo -e "$prog" | clang -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline || + echo -e "$prog" | cc -xc - -o /dev/null || + echo -e "$prog" | gcc -xc - -o /dev/null || + echo -e "$prog" | clang -xc - -o /dev/null || echo -e "$prog" | cc -xc -c - -o /dev/null -I/usr/include -I/usr/local/include || echo -e "$prog" | gcc -xc -c - -o /dev/null -I/usr/include -I/usr/local/include || echo -e "$prog" | clang -xc -c - -o /dev/null -I/usr/include -I/usr/local/include -- cgit v1.3.1 From 809ee9806f7ce18a30ef9628ff861b76385453b4 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 31 Oct 2021 20:33:08 +0800 Subject: update spec --- scripts/rpmbuild/SPECS/xmake.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index 17d30d457..5540c4e76 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -1,4 +1,4 @@ -%define xmake_revision 3f673bdf28f6351e6f8ca83d4b84f598079a8e1f +%define xmake_revision b41c432c85d82d7e7c5503635b1d04820c6fb783 %define tbox_revision 7ca5145d40aa906fdc48b0b0e75e80412241be7e %define sv_revision 9a3cf7c8e589de4f70378824329882c4a047fffc %define lua_cjson_revision 515bab6d6d80b164b94db73af69609ea02f3a798 @@ -8,7 +8,7 @@ %undefine _disable_source_fetch Name: xmake -Version: 2.5.8 +Version: 2.5.9 Release: 1%{?dist} Summary: A cross-platform build utility based on Lua BuildArch: noarch -- cgit v1.3.1 From e79e2886eb22d78910a6c52c5b9f77c698d5d8b9 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Fri, 5 Nov 2021 16:02:33 +0800 Subject: improve env scripts to support binding --- scripts/register-virtualenvs.sh | 23 +++++++++++++++- scripts/xrepo.bat | 42 ++++++++++++++++++++++++++++++ scripts/xrepo.ps1 | 16 +++++++++++- xmake/modules/private/xrepo/action/env.lua | 38 +++++++++++++++------------ xmake/scripts/xrepo-hook.psm1 | 42 ++++++++++++++++++++---------- 5 files changed, 129 insertions(+), 32 deletions(-) (limited to 'scripts') diff --git a/scripts/register-virtualenvs.sh b/scripts/register-virtualenvs.sh index aa97afec5..8518060f8 100644 --- a/scripts/register-virtualenvs.sh +++ b/scripts/register-virtualenvs.sh @@ -8,7 +8,7 @@ else fi function xrepo { - if [ $# -eq 2 ] && [ "$1" = "env" ]; then + if [ $# -ge 2 ] && [ "$1" = "env" ]; then local cmd="${2-x}" case "$cmd" in shell) @@ -38,6 +38,27 @@ function xrepo { unset XMAKE_ENV_BACKUP fi ;; + -b|--bind) + if [ "$4" = "shell" ]; then + local bnd="${3-x}" + if test "${XMAKE_PROMPT_BACKUP}"; then + PS1="${XMAKE_PROMPT_BACKUP}" + source "${XMAKE_ENV_BACKUP}" || return 1 + unset XMAKE_PROMPT_BACKUP + unset XMAKE_ENV_BACKUP + fi + local prompt="$("$XMAKE_EXE" lua --quiet private.xrepo.action.env.info prompt $bnd)" || return 1 + if [ -z "${prompt+x}" ]; then + return 1 + fi + local activateCommand="$("$XMAKE_EXE" lua --quiet private.xrepo.action.env.info script.bash $bnd)" || return 1 + export XMAKE_ENV_BACKUP="$("$XMAKE_EXE" lua private.xrepo.action.env.info envfile $bnd)" + export XMAKE_PROMPT_BACKUP="${PS1}" + "$XMAKE_EXE" lua --quiet private.xrepo.action.env.info backup.bash $bnd 1>"$XMAKE_ENV_BACKUP" + eval "$activateCommand" + PS1="${prompt} $PS1" + fi + ;; *) "$XMAKE_EXE" lua private.xrepo "$@" ;; diff --git a/scripts/xrepo.bat b/scripts/xrepo.bat index 77acf7d24..82180398a 100755 --- a/scripts/xrepo.bat +++ b/scripts/xrepo.bat @@ -60,6 +60,48 @@ ) goto :ENDXREPO ) + set XREPO_BIND_FLAG= + if [%2]==[-b] if [%4]==[shell] ( + set XREPO_BIND_FLAG=1 + ) + if [%2]==[--bind] if [%4]==[shell] ( + set XREPO_BIND_FLAG=1 + ) + if defined XREPO_BIND_FLAG ( + set XREPO_BIND_FLAG= + if defined XMAKE_PROMPT_BACKUP ( + call %XMAKE_ENV_BACKUP% + setlocal EnableDelayedExpansion + if !errorlevel! neq 0 exit /B !errorlevel! + endlocal + set PROMPT=%XMAKE_PROMPT_BACKUP% + set XMAKE_ENV_BACKUP= + set XMAKE_PROMPT_BACKUP= + echo Please rerun `xrepo env shell` to enter the environment. + exit /B 1 + ) else ( + setlocal EnableDelayedExpansion + @%XMAKE_EXE% lua --quiet private.xrepo.action.env.info prompt %3 1>nul + if !errorlevel! neq 0 ( + echo error: environment not found^^! + exit /B !errorlevel! + ) + endlocal + for /f %%i in ('@%XMAKE_EXE% lua --quiet private.xrepo.action.env.info prompt %3') do @( + @set "PROMPT=%%i %PROMPT%" + ) + @set XMAKE_PROMPT_BACKUP=%PROMPT% + ) + for /f %%i in ('@%XMAKE_EXE% lua private.xrepo.action.env.info envfile %3') do @( + @set "XMAKE_ENV_BACKUP=%%i.bat" + @"%XMAKE_EXE%" lua --quiet private.xrepo.action.env.info backup.cmd %3 1>"%%i.bat" + ) + for /f %%i in ('@%XMAKE_EXE% lua private.xrepo.action.env.info envfile %3') do @( + @"%XMAKE_EXE%" lua --quiet private.xrepo.action.env.info script.cmd %3 1>"%%i.bat" + call "%%i.bat" + ) + goto :ENDXREPO + ) ) @call %XMAKE_EXE% lua private.xrepo %* diff --git a/scripts/xrepo.ps1 b/scripts/xrepo.ps1 index a821d8057..74e5e4682 100644 --- a/scripts/xrepo.ps1 +++ b/scripts/xrepo.ps1 @@ -19,13 +19,27 @@ if ($Args.Count -eq 0) { if ((Test-Path 'Env:XMAKE_PROMPT_MODIFIER') -and ($Env:XMAKE_PROMPT_MODIFIER -ne "")) { Exit-XrepoEnvironment; } - Enter-XrepoEnvironment; + Enter-XrepoEnvironment $Null; return; } "quit" { Exit-XrepoEnvironment; return; } + {$_ -in "-b", "--bind"} { + if (($Args.Count -ge 4) -and ($Args[3] -eq "shell")) { + if (-not (Test-Path 'Env:XMAKE_ROOTDIR')) { + $Env:XMAKE_ROOTDIR = $BASE_DIR; + Import-Module "$Env:XMAKE_ROOTDIR\scripts\xrepo-hook.psm1"; + Add-XrepoEnvironmentToPrompt; + } + if ((Test-Path 'Env:XMAKE_PROMPT_MODIFIER') -and ($Env:XMAKE_PROMPT_MODIFIER -ne "")) { + Exit-XrepoEnvironment; + } + Enter-XrepoEnvironment $Args[2]; + return; + } + } } } diff --git a/xmake/modules/private/xrepo/action/env.lua b/xmake/modules/private/xrepo/action/env.lua index 8590fcab9..18b59c0e6 100644 --- a/xmake/modules/private/xrepo/action/env.lua +++ b/xmake/modules/private/xrepo/action/env.lua @@ -199,8 +199,8 @@ function _get_envsdir() end -- get bound environment or packages -function _get_boundenv() - local bind = option.get("bind") +function _get_boundenv(opt) + local bind = (opt and opt.bind) or option.get("bind") if bind then local envfile = path.join(_get_envsdir(), bind .. ".lua") if envfile and os.isfile(envfile) then @@ -287,9 +287,9 @@ function _toolchain_addenvs(envs) end -- get package environments -function _package_getenvs() +function _package_getenvs(opt) local envs = os.getenvs() - local boundenv = _get_boundenv() + local boundenv = _get_boundenv(opt) local has_envfile = false local packages = nil if boundenv and os.isfile(boundenv) then @@ -341,15 +341,15 @@ function _get_env_script(envs, shell, del) suffix = "\"" elseif shell:endswith("sh") then if del then - prefix = "unset " - connector = "" + prefix = "unset '" + connector = "'" else - prefix = "export " - connector = "='" + prefix = "export '" + connector = "'='" suffix = "'" end end - local exceptions = hashset.of("_", "PS1", "PROMPT") + local exceptions = hashset.of("_", "PS1", "PROMPT", "!;", "!EXITCODE") local ret = "" if del then for name, _ in pairs(envs) do @@ -368,25 +368,31 @@ function _get_env_script(envs, shell, del) end -- get information of current virtual environment -function info(key) +function info(key, bnd) if key == "prompt" then - assert(os.isfile(os.projectfile()), "xmake.lua not found!") - io.write("[" .. path.filename(os.projectdir()) .. "]") + local boundenv = _get_boundenv({bind = bnd}) + if boundenv then + assert(os.isfile(boundenv), "environment not found!") + io.write("[" .. path.basename(boundenv) .. "]") + elseif not bnd then + assert(os.isfile(os.projectfile()), "xmake.lua not found!") + io.write("[" .. path.filename(os.projectdir()) .. "]") + end elseif key == "envfile" then print(os.tmpfile()) elseif key == "config" then - if os.isfile(os.projectfile()) then + if not bnd and os.isfile(os.projectfile()) then task.run("config", {target = "all"}, {disable_dump = true}) end elseif key:startswith("script.") then local shell = key:match("script%.(.+)") - print(_get_env_script(_package_getenvs(), shell, false)) + io.write(_get_env_script(_package_getenvs({bind = bnd}), shell, false)) elseif key:startswith("backup.") then local shell = key:match("backup%.(.+)") -- remove current environment variables first - print(_get_env_script(_package_getenvs(), shell, true)) - print(_get_env_script(os.getenvs(), shell, false)) + io.write(_get_env_script(_package_getenvs({bind = bnd}), shell, true)) + io.write(_get_env_script(os.getenvs(), shell, false)) end end diff --git a/xmake/scripts/xrepo-hook.psm1 b/xmake/scripts/xrepo-hook.psm1 index 53342fba0..2210f10ef 100644 --- a/xmake/scripts/xrepo-hook.psm1 +++ b/xmake/scripts/xrepo-hook.psm1 @@ -10,26 +10,40 @@ #> function Enter-XrepoEnvironment { [CmdletBinding()] - param(); + param( + [string]$bnd + ); begin { $script:xrepoOldEnvs = (Get-ChildItem -Path Env:); - & $Env:XMAKE_EXE lua private.xrepo.action.env.info config; - if (-not $?) { - Exit 1; - } - - $xmakeColorTermBackup, $Env:XMAKE_COLORTERM = $Env:XMAKE_COLORTERM, "nocolor"; - $xrepoPrompt = (& $Env:XMAKE_EXE lua --quiet private.xrepo.action.env.info prompt | Out-String); - $Env:XMAKE_COLORTERM = $xmakeColorTermBackup; - if (-not $xrepoPrompt.StartsWith("[")) { - Write-Host $xrepoPrompt; - Exit 1; + if ($bnd -eq $Null) { + & $Env:XMAKE_EXE lua private.xrepo.action.env.info config; + if (-not $?) { + Exit 1; + } + + $xmakeColorTermBackup, $Env:XMAKE_COLORTERM = $Env:XMAKE_COLORTERM, "nocolor"; + $xrepoPrompt = (& $Env:XMAKE_EXE lua --quiet private.xrepo.action.env.info prompt | Out-String); + $Env:XMAKE_COLORTERM = $xmakeColorTermBackup; + if (-not $xrepoPrompt.StartsWith("[")) { + Write-Host "error: xmake.lua not found!"; + Exit 1; + } + + $activateCommand = (& $Env:XMAKE_EXE lua --quiet private.xrepo.action.env.info script.powershell | Out-String); + } else { + $xmakeColorTermBackup, $Env:XMAKE_COLORTERM = $Env:XMAKE_COLORTERM, "nocolor"; + $xrepoPrompt = (& $Env:XMAKE_EXE lua --quiet private.xrepo.action.env.info prompt $bnd | Out-String); + $Env:XMAKE_COLORTERM = $xmakeColorTermBackup; + if (-not $xrepoPrompt.StartsWith("[")) { + Write-Host "error: invalid environment!"; + Exit 1; + } + + $activateCommand = (& $Env:XMAKE_EXE lua --quiet private.xrepo.action.env.info script.powershell $bnd | Out-String); } - $activateCommand = (& $Env:XMAKE_EXE lua private.xrepo.action.env.info script.powershell | Out-String); - Write-Verbose "[xrepo env script.powershell]`n$activateCommand"; Invoke-Expression -Command $activateCommand; -- cgit v1.3.1 From 95dea5af25edb9f1eda15ad8412342e26ef39525 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 5 Nov 2021 21:08:33 +0800 Subject: Update installer.nsi --- scripts/installer.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/installer.nsi b/scripts/installer.nsi index a01b6feea..4c7ea290b 100644 --- a/scripts/installer.nsi +++ b/scripts/installer.nsi @@ -248,7 +248,7 @@ Section "XMake (required)" InstallExeutable WriteRegStr ${RootKey} ${RegUninstall} "NoAdmin" "$NOADMIN" ; Write the uninstall keys for Windows - WriteRegStr ${RootKey} ${RegUninstall} "DisplayName" "XMake build utility" + WriteRegStr ${RootKey} ${RegUninstall} "DisplayName" "XMake build utility (${ARCH})" WriteRegStr ${RootKey} ${RegUninstall} "DisplayIcon" '"$InstDir\xmake.exe"' WriteRegStr ${RootKey} ${RegUninstall} "Comments" "A cross-platform build utility based on Lua" WriteRegStr ${RootKey} ${RegUninstall} "Publisher" "The TBOOX Open Source Group" -- cgit v1.3.1 From 2ed6222d854d03441d24314595cae550b4b842e0 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Sat, 6 Nov 2021 15:30:38 +0800 Subject: improve env config --- scripts/register-virtualenvs.sh | 1 + scripts/xrepo.bat | 4 ++++ xmake/modules/private/xrepo/action/env.lua | 8 +++++++- xmake/scripts/xrepo-hook.psm1 | 5 +++++ 4 files changed, 17 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/register-virtualenvs.sh b/scripts/register-virtualenvs.sh index 8518060f8..cf067d040 100644 --- a/scripts/register-virtualenvs.sh +++ b/scripts/register-virtualenvs.sh @@ -47,6 +47,7 @@ function xrepo { unset XMAKE_PROMPT_BACKUP unset XMAKE_ENV_BACKUP fi + "$XMAKE_EXE" lua private.xrepo.action.env.info config $bnd || return 1 local prompt="$("$XMAKE_EXE" lua --quiet private.xrepo.action.env.info prompt $bnd)" || return 1 if [ -z "${prompt+x}" ]; then return 1 diff --git a/scripts/xrepo.bat b/scripts/xrepo.bat index 82180398a..0416d4a10 100755 --- a/scripts/xrepo.bat +++ b/scripts/xrepo.bat @@ -81,6 +81,10 @@ exit /B 1 ) else ( setlocal EnableDelayedExpansion + %XMAKE_EXE% lua private.xrepo.action.env.info config %3 + if !errorlevel! neq 0 ( + exit /B !errorlevel! + ) @%XMAKE_EXE% lua --quiet private.xrepo.action.env.info prompt %3 1>nul if !errorlevel! neq 0 ( echo error: environment not found^^! diff --git a/xmake/modules/private/xrepo/action/env.lua b/xmake/modules/private/xrepo/action/env.lua index 18b59c0e6..07709b7bd 100644 --- a/xmake/modules/private/xrepo/action/env.lua +++ b/xmake/modules/private/xrepo/action/env.lua @@ -381,7 +381,13 @@ function info(key, bnd) elseif key == "envfile" then print(os.tmpfile()) elseif key == "config" then - if not bnd and os.isfile(os.projectfile()) then + local boundenv = _get_boundenv({bind = bnd}) + local has_envfile = (boundenv and os.isfile(boundenv)) and true or false + if has_envfile or os.isfile(os.projectfile()) then + if has_envfile then + _enter_project({enteronly = true}) + table.insert(project.rcfiles(), boundenv) + end task.run("config", {target = "all"}, {disable_dump = true}) end elseif key:startswith("script.") then diff --git a/xmake/scripts/xrepo-hook.psm1 b/xmake/scripts/xrepo-hook.psm1 index 2210f10ef..2a2c24c05 100644 --- a/xmake/scripts/xrepo-hook.psm1 +++ b/xmake/scripts/xrepo-hook.psm1 @@ -33,6 +33,11 @@ function Enter-XrepoEnvironment { $activateCommand = (& $Env:XMAKE_EXE lua --quiet private.xrepo.action.env.info script.powershell | Out-String); } else { + & $Env:XMAKE_EXE lua private.xrepo.action.env.info config $bnd; + if (-not $?) { + Exit 1; + } + $xmakeColorTermBackup, $Env:XMAKE_COLORTERM = $Env:XMAKE_COLORTERM, "nocolor"; $xrepoPrompt = (& $Env:XMAKE_EXE lua --quiet private.xrepo.action.env.info prompt $bnd | Out-String); $Env:XMAKE_COLORTERM = $xmakeColorTermBackup; -- cgit v1.3.1 From 135638f4b805517e182015a1722f355f43b4eea5 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 8 Nov 2021 23:00:11 +0800 Subject: update spec --- scripts/rpmbuild/SPECS/xmake.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index 5540c4e76..e8eee1e75 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -1,6 +1,6 @@ -%define xmake_revision b41c432c85d82d7e7c5503635b1d04820c6fb783 +%define xmake_revision 96d398228e9ae045973af9c656a09c7376f9582c %define tbox_revision 7ca5145d40aa906fdc48b0b0e75e80412241be7e -%define sv_revision 9a3cf7c8e589de4f70378824329882c4a047fffc +%define sv_revision 035262773da0500367cb88e6f30197908159a348 %define lua_cjson_revision 515bab6d6d80b164b94db73af69609ea02f3a798 %define luajit_revision e9af1abec542e6f9851ff2368e7f196b6382a44c %define lua_revision eadd8c7178c79c814ecca9652973a9b9dd4cc71b -- cgit v1.3.1 From 97ae2e38c5394903b0ed41ac6b5ba080963a4907 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Mon, 8 Nov 2021 18:32:42 +0800 Subject: fix a bug with venv on unix --- scripts/register-virtualenvs.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/register-virtualenvs.sh b/scripts/register-virtualenvs.sh index cf067d040..6b0c25160 100644 --- a/scripts/register-virtualenvs.sh +++ b/scripts/register-virtualenvs.sh @@ -58,6 +58,8 @@ function xrepo { "$XMAKE_EXE" lua --quiet private.xrepo.action.env.info backup.bash $bnd 1>"$XMAKE_ENV_BACKUP" eval "$activateCommand" PS1="${prompt} $PS1" + else + "$XMAKE_EXE" lua private.xrepo "$@" fi ;; *) -- cgit v1.3.1 From b995865e5b4211ed455703b242cf3614677bf296 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Fri, 19 Nov 2021 18:17:43 +0800 Subject: update install scripts --- scripts/get.ps1 | 4 ++-- scripts/get.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/get.ps1 b/scripts/get.ps1 index f03d80fa4..449e0e3a1 100755 --- a/scripts/get.ps1 +++ b/scripts/get.ps1 @@ -11,7 +11,7 @@ param ( ) & { - $LastRelease = "v2.5.8" + $LastRelease = "v2.5.9" $ErrorActionPreference = 'Stop' function writeErrorTip($msg) { @@ -157,7 +157,7 @@ param ( writeErrorTip 'Check your network or... the news of S3 break' return } - Set-Content $file "$content`n$appendcontent" -NoNewline + Set-Content $file "$content`n# >>> xmake >>>`n$appendcontent`n# <<< xmake <<<`n" -NoNewline . $file Write-Host "Tab completion installed" } diff --git a/scripts/get.sh b/scripts/get.sh index 01634a967..b32c28b6f 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -225,7 +225,7 @@ else fi write_profile() { - grep -sq ".xmake/profile" $1 || echo -e "\n[[ -s \"\$HOME/.xmake/profile\" ]] && source \"\$HOME/.xmake/profile\" # load xmake profile" >> $1 + grep -sq ".xmake/profile" $1 || echo -e "\n# >>> xmake >>>\n[[ -s \"\$HOME/.xmake/profile\" ]] && source \"\$HOME/.xmake/profile\" # load xmake profile\n# <<< xmake <<<" >> $1 } install_profile() { -- cgit v1.3.1 From a834aa4e27d7fb597f53fe0be24b81e8cb7c28ef Mon Sep 17 00:00:00 2001 From: nasso <11479594+nasso@users.noreply.github.com> Date: Sun, 21 Nov 2021 18:24:41 +0100 Subject: Install `bzip2` with `yum` --- scripts/get.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index b32c28b6f..ca009407d 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -150,7 +150,7 @@ test_tools() install_tools() { { apt --version >/dev/null 2>&1 && $sudoprefix apt install -y git build-essential libreadline-dev ccache; } || - { yum --version >/dev/null 2>&1 && $sudoprefix yum install -y git readline-devel ccache && $sudoprefix yum groupinstall -y 'Development Tools'; } || + { yum --version >/dev/null 2>&1 && $sudoprefix yum install -y git readline-devel ccache bzip2 && $sudoprefix yum groupinstall -y 'Development Tools'; } || { zypper --version >/dev/null 2>&1 && $sudoprefix zypper --non-interactive install git readline-devel ccache && $sudoprefix zypper --non-interactive install -t pattern devel_C_C++; } || { pacman -V >/dev/null 2>&1 && $sudoprefix pacman -S --noconfirm --needed git base-devel ccache; } || { emerge -V >/dev/null 2>&1 && $sudoprefix emerge -atv dev-vcs/git ccache; } || -- cgit v1.3.1 From b5af4b27137ab12de8a53a7e62cf004eb488ba5f Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 30 Nov 2021 20:37:49 +0800 Subject: Update PKGBUILD --- scripts/archlinux/PKGBUILD | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/archlinux/PKGBUILD b/scripts/archlinux/PKGBUILD index 2d17c0dfe..445e51047 100755 --- a/scripts/archlinux/PKGBUILD +++ b/scripts/archlinux/PKGBUILD @@ -2,15 +2,16 @@ # PKGBuild Create By: lumpyzhu pkgname=xmake -pkgver=2.3.2 +pkgver=2.5.9 pkgrel=1 -pkgdesc="A make-like build utility based on Lua" +pkgdesc="A cross-platform build utility based on Lua" +depends=('bash') 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") -sha256sums=('b189074320ce1b215f85f8f20142fe173d981eb17c2c157f0fa6756fc00dac4e') +source=("https://github.com/xmake-io/xmake/releases/download/v${pkgver}/xmake-v${pkgver}.tar.gz") +sha256sums=('5b50e3f28956cabcaa153624c91781730387ceb7c056f3f9b5306b1c77460d8f') build() { cd "$srcdir" -- cgit v1.3.1 From 82983f1e86061f3a867aef4fc4636fb8d04fd8ae Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 2 Dec 2021 22:49:15 +0800 Subject: Update xmake.spec --- scripts/rpmbuild/SPECS/xmake.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index e8eee1e75..f512d59c7 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -1,5 +1,5 @@ %define xmake_revision 96d398228e9ae045973af9c656a09c7376f9582c -%define tbox_revision 7ca5145d40aa906fdc48b0b0e75e80412241be7e +%define tbox_revision 122a479e626ee3fdd7d6c1117ec7c19212a1e087 %define sv_revision 035262773da0500367cb88e6f30197908159a348 %define lua_cjson_revision 515bab6d6d80b164b94db73af69609ea02f3a798 %define luajit_revision e9af1abec542e6f9851ff2368e7f196b6382a44c -- cgit v1.3.1 From 666dc54797f2cc37ecfc5a952b1e9862820e8b86 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 3 Dec 2021 21:09:57 +0800 Subject: update spec --- scripts/rpmbuild/SPECS/xmake.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index f512d59c7..8b03b8634 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -1,4 +1,4 @@ -%define xmake_revision 96d398228e9ae045973af9c656a09c7376f9582c +%define xmake_revision 7ae3c378f897fac7e0bf7dc9e0f7562a589514c8 %define tbox_revision 122a479e626ee3fdd7d6c1117ec7c19212a1e087 %define sv_revision 035262773da0500367cb88e6f30197908159a348 %define lua_cjson_revision 515bab6d6d80b164b94db73af69609ea02f3a798 @@ -8,7 +8,7 @@ %undefine _disable_source_fetch Name: xmake -Version: 2.5.9 +Version: 2.6.1 Release: 1%{?dist} Summary: A cross-platform build utility based on Lua BuildArch: noarch -- cgit v1.3.1 From 7790baafb16afb45fbf81fafcfc60001f0e1afe1 Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Sat, 4 Dec 2021 14:26:02 +0800 Subject: Update get.ps1 --- scripts/get.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get.ps1 b/scripts/get.ps1 index 449e0e3a1..d1c1c22a9 100755 --- a/scripts/get.ps1 +++ b/scripts/get.ps1 @@ -11,7 +11,7 @@ param ( ) & { - $LastRelease = "v2.5.9" + $LastRelease = "v2.6.1" $ErrorActionPreference = 'Stop' function writeErrorTip($msg) { -- cgit v1.3.1 From b062cae6275c91a0c415524353daa49220cbb3f8 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 5 Dec 2021 21:24:46 +0800 Subject: Update installer.nsi --- scripts/installer.nsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/installer.nsi b/scripts/installer.nsi index 4c7ea290b..03204558e 100644 --- a/scripts/installer.nsi +++ b/scripts/installer.nsi @@ -230,7 +230,11 @@ Section "XMake (required)" InstallExeutable SetOutPath $InstDir ; Remove previous directories used - RMDir /r "$InstDir" + IfFileExists "$InstDir\xmake.exe" file_found file_not_found_or_end + file_found: + RMDir /r "$InstDir" + goto file_not_found_or_end + file_not_found_or_end: ; Put file there File /r /x ".DS_Store" /x "*.swp" "..\xmake\*.*" -- cgit v1.3.1 From babc5cb8dadcdb774de506ca0d2478381181d2e4 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 5 Dec 2021 21:25:40 +0800 Subject: Update installer.nsi --- scripts/installer.nsi | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/installer.nsi b/scripts/installer.nsi index 03204558e..8ef9e2e6d 100644 --- a/scripts/installer.nsi +++ b/scripts/installer.nsi @@ -230,6 +230,7 @@ Section "XMake (required)" InstallExeutable SetOutPath $InstDir ; Remove previous directories used + ; https://github.com/xmake-io/xmake/issues/1888 IfFileExists "$InstDir\xmake.exe" file_found file_not_found_or_end file_found: RMDir /r "$InstDir" -- cgit v1.3.1 From 022ca13475739cee7e10bd0a3256ecd704fb2e6d Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 18 Dec 2021 00:35:37 +0800 Subject: update version --- CHANGELOG.md | 4 ++++ core/project.mak | 2 +- core/xmake.lua | 2 +- scripts/rpmbuild/SPECS/xmake.spec | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/CHANGELOG.md b/CHANGELOG.md index 78c70ba9d..efc18354a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master (unreleased) +## v2.6.2 + ### New features * [#1902](https://github.com/xmake-io/xmake/issues/1902): Support to build linux kernel driver modules @@ -1164,6 +1166,8 @@ ## master (开发中) +## v2.6.2 + ### 新特性 * [#1902](https://github.com/xmake-io/xmake/issues/1902): 支持构建 linux 内核驱动模块 diff --git a/core/project.mak b/core/project.mak index 945871e92..3e3838897 100644 --- a/core/project.mak +++ b/core/project.mak @@ -10,7 +10,7 @@ PRO_VERSION_MAJOR = 2 PRO_VERSION_MINOR = 6 # the project alter version -PRO_VERSION_ALTER = 1 +PRO_VERSION_ALTER = 2 # the project prefix PRO_PREFIX = XM_ diff --git a/core/xmake.lua b/core/xmake.lua index 5b72c672a..552781c76 100644 --- a/core/xmake.lua +++ b/core/xmake.lua @@ -2,7 +2,7 @@ set_project("xmake") -- version -set_version("2.6.1", {build = "%Y%m%d%H%M"}) +set_version("2.6.2", {build = "%Y%m%d%H%M"}) -- set xmake min version set_xmakever("2.2.3") diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index 8b03b8634..98e9cef22 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -8,7 +8,7 @@ %undefine _disable_source_fetch Name: xmake -Version: 2.6.1 +Version: 2.6.2 Release: 1%{?dist} Summary: A cross-platform build utility based on Lua BuildArch: noarch -- cgit v1.3.1 From 90e499cb2992883fef7a0eb16640e1765581ba8e Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 18 Dec 2021 00:35:45 +0800 Subject: update ps1 --- scripts/get.ps1 | 2 +- scripts/rpmbuild/SPECS/xmake.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/get.ps1 b/scripts/get.ps1 index d1c1c22a9..538220acd 100755 --- a/scripts/get.ps1 +++ b/scripts/get.ps1 @@ -11,7 +11,7 @@ param ( ) & { - $LastRelease = "v2.6.1" + $LastRelease = "v2.6.2" $ErrorActionPreference = 'Stop' function writeErrorTip($msg) { diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index 98e9cef22..3485dc68a 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -1,4 +1,4 @@ -%define xmake_revision 7ae3c378f897fac7e0bf7dc9e0f7562a589514c8 +%define xmake_revision 022ca13475739cee7e10bd0a3256ecd704fb2e6d %define tbox_revision 122a479e626ee3fdd7d6c1117ec7c19212a1e087 %define sv_revision 035262773da0500367cb88e6f30197908159a348 %define lua_cjson_revision 515bab6d6d80b164b94db73af69609ea02f3a798 -- cgit v1.3.1