From f730693acc0cc100c824a521da217ffa94b9a2ea Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 20 Oct 2020 10:52:15 +0200 Subject: [PATCH] linux scripts without cd --- scripts/linux/linux_appimage.sh | 15 +++++---------- scripts/linux/linux_deploy.sh | 25 +++++++++++-------------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/scripts/linux/linux_appimage.sh b/scripts/linux/linux_appimage.sh index 043be1f4e..451c77c91 100644 --- a/scripts/linux/linux_appimage.sh +++ b/scripts/linux/linux_appimage.sh @@ -9,27 +9,22 @@ # You can give as argument the path of the bundle (default is src/install), # and the AppImage will be placed in the parent directory (src) +SCRIPTS_PATH="$(dirname "$(realpath "$0")")" + #checking for parameters if [ "$#" -eq 0 ] then - BUNDLE_PATH="../../src/install" + BUNDLE_PATH=$SCRIPTS_PATH/../../src/install else BUNDLE_PATH=$(realpath $1) fi -cd "$(dirname "$(realpath "$0")")"; #move to script directory -SCRIPTS_PATH=$(pwd) - -cd $BUNDLE_PATH PARENT_NAME="$(basename $BUNDLE_PATH)" export VERSION=$(cat $SCRIPTS_PATH/../../ML_VERSION) -cd .. - $SCRIPTS_PATH/resources/appimagetool $PARENT_NAME -mv MeshLab-$VERSION*.AppImage MeshLab$VERSION-linux.AppImage -#chmod +x MeshLab$VERSION-linux.AppImage +mv $PARENT_NAME/MeshLab-$VERSION*.AppImage $PARENT_NAME/MeshLab$VERSION-linux.AppImage #at this point, distrib folder contains all the files necessary to execute meshlab -echo MeshLab$VERSION-linux.AppImage and MeshLabServer$VERSION-linux.AppImage generated +echo MeshLab$VERSION-linux.AppImage generated diff --git a/scripts/linux/linux_deploy.sh b/scripts/linux/linux_deploy.sh index b50477bee..ed9bcba0b 100644 --- a/scripts/linux/linux_deploy.sh +++ b/scripts/linux/linux_deploy.sh @@ -6,30 +6,27 @@ # due to linuxdeployqt tool choice (see https://github.com/probonopd/linuxdeployqt/issues/340). # # Without given arguments, the folder that will be deployed is meshlab/src/install. -# +# # You can give as argument the path of the bundle. +SCRIPTS_PATH="$(dirname "$(realpath "$0")")" + #checking for parameters if [ "$#" -eq 0 ] then - BUNDLE_PATH="../../src/install" + BUNDLE_PATH=$SCRIPTS_PATH/../../src/install else BUNDLE_PATH=$(realpath $1) fi -cd "$(dirname "$(realpath "$0")")"; #move to script directory -SCRIPTS_PATH=$(pwd) +$SCRIPTS_PATH/resources/linuxdeployqt $BUNDLE_PATH/usr/share/applications/meshlab.desktop -bundle-non-qt-libs -cd $BUNDLE_PATH +chmod +x $BUNDLE_PATH/usr/bin/meshlab +rm $BUNDLE_PATH/AppRun -$SCRIPTS_PATH/resources/linuxdeployqt usr/share/applications/meshlab.desktop -bundle-non-qt-libs - -chmod +x usr/bin/meshlab -rm AppRun - -cp $SCRIPTS_PATH/resources/AppRunMeshLab . -mv AppRunMeshLab AppRun -chmod +x AppRun +cp $SCRIPTS_PATH/resources/AppRunMeshLab $BUNDLE_PATH/ +mv $BUNDLE_PATH/AppRunMeshLab $BUNDLE_PATH/AppRun +chmod +x $BUNDLE_PATH/AppRun #at this point, distrib folder contains all the files necessary to execute meshlab -echo "$BUNDLE_PATH is now a self contained meshlab application" \ No newline at end of file +echo "$BUNDLE_PATH is now a self contained meshlab application"