Adapt build package script for Windows using MSYS2

This commit is contained in:
Francesco Abbate 2020-06-21 23:57:58 +02:00
parent 579d07c248
commit 6a1690c051
1 changed files with 16 additions and 4 deletions

View File

@ -24,14 +24,26 @@ lite_build_package () {
build="$1" build="$1"
version="$2" version="$2"
arch="$3" arch="$3"
lite_exe=lite
strip=strip
if [[ "$OSTYPE" == msys || "$OSTYPE" == win32 ]]; then
lite_exe=lite.exe
strip="strip --strip-all"
fi
local pdir=".package-build/lite-xl-$version" local pdir=".package-build/lite-xl-$version"
mkdir -p "$pdir" mkdir -p "$pdir"
cp -r data "$pdir" cp -r data "$pdir"
cp "$build/src/lite" "$pdir" cp "$build/src/$lite_exe" "$pdir"
strip "$pdir/lite" $strip "$pdir/$lite_exe"
pushd ".package-build" pushd ".package-build"
local package_name="lite-xl-$version-$arch.tar.gz" local package_name
tar czf "$package_name" "lite-xl-$version" if [[ "$OSTYPE" == msys || "$OSTYPE" == win32 ]]; then
package_name="lite-xl-$version-$arch.zip"
zip "$package_name" -r "lite-xl-$version"
else
package_name="lite-xl-$version-$arch.tar.gz"
tar czf "$package_name" "lite-xl-$version"
fi
mv "$package_name" .. mv "$package_name" ..
popd popd
rm -fr ".package-build" rm -fr ".package-build"