aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2022-02-12 20:24:47 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2022-02-12 20:24:47 +0100
commitf3992316ad3611b5c1d62469e201fea555702b86 (patch)
tree589852f2fd958a80810786e03c7aab4cc3390429
parent378e299f8fb227f37ae876dac915a0e3d8ca42c5 (diff)
downloadlite-xl-f3992316ad3611b5c1d62469e201fea555702b86.tar.gz
lite-xl-f3992316ad3611b5c1d62469e201fea555702b86.zip
Fix version option for appimage script
-rw-r--r--scripts/appimage.sh15
-rw-r--r--scripts/package.sh14
2 files changed, 17 insertions, 12 deletions
diff --git a/scripts/appimage.sh b/scripts/appimage.sh
index 8571d394..dc28c5e3 100644
--- a/scripts/appimage.sh
+++ b/scripts/appimage.sh
@@ -20,7 +20,7 @@ show_help(){
echo "-n --nobuild Skips the build step, use existing files."
echo "-s --static Specify if building using static libraries"
echo " by using lhelper tool."
- echo "-v --version VERSION Specify a version, non whitespace separated string."
+ echo "-v --version version Specify a version, non whitespace separated string."
echo
}
@@ -49,7 +49,7 @@ for i in "$@"; do
shift
;;
-v|--version)
- VERSION="$2"
+ version="$2"
shift
shift
;;
@@ -117,6 +117,7 @@ generate_appimage() {
DESTDIR="$(realpath LiteXL.AppDir)" meson install --skip-subprojects -C ${BUILD_DIR}
mv AppRun LiteXL.AppDir/
+ strip LiteXL.AppDir/AppRun
# These could be symlinks but it seems they doesn't work with AppimageLauncher
cp resources/icons/lite-xl.svg LiteXL.AppDir/
cp resources/linux/org.lite_xl.lite_xl.desktop LiteXL.AppDir/
@@ -144,16 +145,16 @@ generate_appimage() {
fi
done
echo " Ignoring: $libname"
- done < <(ldd build/src/lite-xl | awk '{print $1 " " $3}')
+ done < <(ldd ${BUILD_DIR}/src/lite-xl | awk '{print $1 " " $3}')
fi
echo "Generating AppImage..."
- local version=""
- if [ -n "$VERSION" ]; then
- version="-$VERSION"
+ local version_tag=""
+ if [ -n "$version" ]; then
+ version_tag="-$version"
fi
- ./appimagetool LiteXL.AppDir LiteXL${version}-${ARCH}.AppImage
+ ./appimagetool LiteXL.AppDir LiteXL${version_tag}-${ARCH}.AppImage
}
setup_appimagetool
diff --git a/scripts/package.sh b/scripts/package.sh
index 90c30580..64bee032 100644
--- a/scripts/package.sh
+++ b/scripts/package.sh
@@ -91,6 +91,7 @@ main() {
local dest_dir=lite-xl
local prefix=/
local version
+ local version_tag
local addons=false
local appimage=false
local binary=false
@@ -120,7 +121,9 @@ main() {
shift
;;
-v|--version)
- if [[ -n $2 ]]; then version="-$2"; fi
+ # if [[ -n $2 ]]; then version="-$2"; fi
+ version="$2"
+ version_tag="-$version"
shift
shift
;;
@@ -174,7 +177,7 @@ main() {
# The source package doesn't require a previous build,
# nor the following install step, so run it now.
- if [[ $source == true ]]; then source_package "lite-xl$version-src"; fi
+ if [[ $source == true ]]; then source_package "lite-xl${version_tag}-src"; fi
# No packages request
if [[ $appimage == false && $binary == false && $dmg == false && $innosetup == false ]]; then
@@ -190,7 +193,7 @@ main() {
local data_dir="$(pwd)/${dest_dir}/data"
local exe_file="$(pwd)/${dest_dir}/lite-xl"
- local package_name=lite-xl$version-$platform-$arch
+ local package_name=lite-xl${version_tag}-${platform}-${arch}
local bundle=false
local portable=false
local stripcmd="strip"
@@ -252,9 +255,10 @@ main() {
fi
fi
+ local version_option=()
+ if [[ -n $version ]]; then version_option=("--version" "${version}"); fi
if [[ $appimage == true ]]; then
- # FIXME: manage the case when version is not set
- bash scripts/appimage.sh -n -b "$build_dir" --version $version
+ bash scripts/appimage.sh -n -b "$build_dir" ${version_option[@]}
fi
if [[ $bundle == true && $dmg == true ]]; then source scripts/appdmg.sh "${package_name}"; fi
if [[ $innosetup == true ]]; then source scripts/innosetup/innosetup.sh -b "${build_dir}"; fi