From d9c2e55bdb33b6dec304efb7ae33fa8b6aa3d367 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 16 Jun 2020 16:08:17 +0200 Subject: [PATCH] AppImages working --- .github/workflows/BuildAndRelease.yml | 5 ++- .github/workflows/BuildUbuntu.yml | 7 ++-- install/linux/linux_appimages.sh | 45 +++++++++++++----------- install/linux/linux_deploy.sh | 13 ++++--- install/linux/linux_make_boundle.sh | 12 +++---- install/linux/linux_setup_env_ubuntu.sh | 3 +- install/linux/resources/appimagetool | Bin 7 files changed, 48 insertions(+), 37 deletions(-) mode change 100644 => 100755 install/linux/resources/appimagetool diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 51cc520a6..d10e31c97 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -56,7 +56,7 @@ jobs: - name: Install dependencies run: | sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev libeigen3-dev libgmp-dev - sudo apt-get install -y libxkbcommon-x11-0 chrpath patchelf + sudo apt-get install -y libxkbcommon-x11-0 patchelf - name: Setup env variables id: envs run: | @@ -68,6 +68,9 @@ jobs: run: | sh install/linux/linux_make_boundle.sh - name: Deploy MeshLab and MeshLabServer + run : | + sh install/linux/linux_deploy.sh + - name: Build MeshLab and MeshLabServer AppImages run : | sh install/linux/linux_appimages.sh - name: Upload Meshlab Portable diff --git a/.github/workflows/BuildUbuntu.yml b/.github/workflows/BuildUbuntu.yml index ab571e0f8..46c70cfb8 100644 --- a/.github/workflows/BuildUbuntu.yml +++ b/.github/workflows/BuildUbuntu.yml @@ -23,7 +23,7 @@ jobs: - name: Install dependencies run: | sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev libeigen3-dev libgmp-dev - sudo apt-get install -y libxkbcommon-x11-0 chrpath patchelf + sudo apt-get install -y libxkbcommon-x11-0 patchelf - name: Setup env variables id: envs run: | @@ -36,7 +36,10 @@ jobs: sh install/linux/linux_make_boundle.sh - name: Deploy MeshLab and MeshLabServer run : | - sh install/linux/linux_appimages.sh + sh install/linux/linux_deploy.sh + - name: Build MeshLab and MeshLabServer AppImages + run : | + sh install/linux/linux_appimages.sh - name: Upload Meshlab Portable uses: actions/upload-artifact@v1 with: diff --git a/install/linux/linux_appimages.sh b/install/linux/linux_appimages.sh index 4227c6f36..67c96b3e4 100644 --- a/install/linux/linux_appimages.sh +++ b/install/linux/linux_appimages.sh @@ -1,12 +1,9 @@ #!/bin/bash -# this is a script shell for setting up the AppImage bundle for linux -# Requires a properly built meshlab boundle (see linux_make_boundle.sh). It does not require to run the -# linux_deploy.sh script. +# This is a script shell for setting up the AppImage bundle for linux +# Requires a properly built meshlab, boundled and deployed (see linux_deploy.sh) +# inside the directory given as argument # -# This script can be run only in the oldest supported linux distro that you are using -# due to linuxdeployqt tool choice (see https://github.com/probonopd/linuxdeployqt/issues/340). -# -# Without given arguments, MeshLab AppImage will be placed in the meshlab/distrib +# Without given arguments, MeshLab AppImage(s) will be placed in the meshlab # directory. # # You can give as argument the DISTRIB_PATH. @@ -23,27 +20,33 @@ cd "$(dirname "$(realpath "$0")")"; #move to script directory INSTALL_PATH=$(pwd) cd $DISTRIB_PATH +PARENT_NAME="$(basename $DISTRIB_PATH)" export VERSION=$(cat $INSTALL_PATH/../../ML_VERSION) -$INSTALL_PATH/resources/linuxdeployqt usr/share/applications/meshlab_server.desktop -appimage -mv *.AppImage ../MeshLabServer$VERSION-linux.AppImage -chmod +x ../MeshLabServer$VERSION-linux.AppImage +cd .. -rm AppRun -rm *.desktop -rm *.png +#mv $PARENT_NAME/usr/share/applications/meshlab.desktop . -#mv usr/bin/meshlabserver .. -$INSTALL_PATH/resources/linuxdeployqt usr/share/applications/meshlab.desktop -appimage -mv *.AppImage ../MeshLab$VERSION-linux.AppImage -chmod +x ../MeshLab$VERSION-linux.AppImage +mv $PARENT_NAME/AppRun $PARENT_NAME/AppRunMeshLab +mv $PARENT_NAME/AppRunMeshLabServer $PARENT_NAME/AppRun +rm $PARENT_NAME/*.desktop +cp $PARENT_NAME/usr/share/applications/meshlab_server.desktop $PARENT_NAME/ -patchelf --set-rpath '$ORIGIN/usr/lib:$ORIGIN/usr/lib/meshlab' AppRun +$INSTALL_PATH/resources/appimagetool $PARENT_NAME +mv MeshLabServer-$VERSION*.AppImage MeshLabServer$VERSION-linux.AppImage +#chmod +x MeshLabServer$VERSION-linux.AppImage -chmod +x usr/bin/meshlab -chmod +x usr/bin/meshlabserver -chmod +x AppRun +#mv $PARENT_NAME/usr/share/applications/meshlab_server.desktop . +#mv meshlab.desktop $PARENT_NAME/usr/share/applications/ +mv $PARENT_NAME/AppRun $PARENT_NAME/AppRunMeshLabServer +mv $PARENT_NAME/AppRunMeshLab $PARENT_NAME/AppRun +rm $PARENT_NAME/*.desktop +cp $PARENT_NAME/usr/share/applications/meshlab.desktop $PARENT_NAME/ + +$INSTALL_PATH/resources/appimagetool $PARENT_NAME +mv MeshLab-$VERSION*.AppImage MeshLab$VERSION-linux.AppImage +#chmod +x 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 diff --git a/install/linux/linux_deploy.sh b/install/linux/linux_deploy.sh index 72bb47f4c..0944429ea 100644 --- a/install/linux/linux_deploy.sh +++ b/install/linux/linux_deploy.sh @@ -1,5 +1,5 @@ #!/bin/bash -# this is a script shell for deploying a meshlab-portable folder. +# This is a script shell for deploying a meshlab-portable folder. # Requires a properly built meshlab boundle (see linux_make_boundle.sh). # # This script can be run only in the oldest supported linux distro that you are using @@ -24,12 +24,15 @@ cd $DISTRIB_PATH $INSTALL_PATH/resources/linuxdeployqt usr/share/applications/meshlab.desktop -bundle-non-qt-libs -executable=usr/bin/meshlabserver -patchelf --set-rpath '$ORIGIN/usr/lib:$ORIGIN/usr/lib/meshlab' AppRun - chmod +x usr/bin/meshlab chmod +x usr/bin/meshlabserver +rm AppRun + +cp $INSTALL_PATH/resources/AppRunMeshLab . +mv AppRunMeshLab AppRun +cp $INSTALL_PATH/resources/AppRunMeshLabServer . chmod +x AppRun +chmod +x AppRunMeshLabServer #at this point, distrib folder contains all the files necessary to execute meshlab -echo "distrib folder is now a self contained meshlab application" - +echo "distrib folder is now a self contained meshlab application" \ No newline at end of file diff --git a/install/linux/linux_make_boundle.sh b/install/linux/linux_make_boundle.sh index 2b77ec4c3..22325f5a7 100644 --- a/install/linux/linux_make_boundle.sh +++ b/install/linux/linux_make_boundle.sh @@ -54,15 +54,15 @@ mv meshlabserver usr/bin mv LICENSE.txt usr/share/doc/meshlab/ mv privacy.txt usr/share/doc/meshlab/ mv readme.txt usr/share/doc/meshlab/ -mv lib/libmeshlab-common* usr/lib/meshlab/ +mv lib/libmeshlab-common* usr/lib/ mv plugins/ usr/lib/meshlab/ mv lib/linux/* usr/lib/meshlab/ -chrpath -r '$ORIGIN/..' usr/lib/meshlab/plugins/*.so +#patchelf --set-rpath '$ORIGIN/..' usr/lib/meshlab/plugins/*.so mv shaders/ usr/share/meshlab/ rm -r lib #tmp: moving libIXF to bin directory -mv usr/lib/meshlab/libIFX* . -mv libIFXCoreStatic.a usr/lib/meshlab -chrpath -r '$ORIGIN/../lib/meshlab/' usr/bin/meshlab -chrpath -r '$ORIGIN/../lib/meshlab/' usr/bin/meshlabserver +#mv usr/lib/meshlab/libIFX* . +#mv libIFXCoreStatic.a usr/lib/meshlab +patchelf --set-rpath '$ORIGIN/../lib/meshlab/' usr/bin/meshlab +patchelf --set-rpath '$ORIGIN/../lib/meshlab/' usr/bin/meshlabserver diff --git a/install/linux/linux_setup_env_ubuntu.sh b/install/linux/linux_setup_env_ubuntu.sh index d13a25dc2..546398b88 100644 --- a/install/linux/linux_setup_env_ubuntu.sh +++ b/install/linux/linux_setup_env_ubuntu.sh @@ -5,5 +5,4 @@ # Run this script if you never installed any of the MeshLab dependencies. sudo apt-get update -sudo apt-get install -y qt5-default qttools5-dev-tools qtdeclarative5-dev libqt5xmlpatterns5-dev mesa-common-dev libglu1-mesa-dev lib3ds-dev libglew-dev libeigen3-dev libopenctm-dev libgmp-dev libqhull-dev patchelf chrpath #libmuparser-dev -sudo apt-get install -y chrpath +sudo apt-get install -y qt5-default qttools5-dev-tools qtdeclarative5-dev libqt5xmlpatterns5-dev mesa-common-dev libglu1-mesa-dev lib3ds-dev libglew-dev libeigen3-dev libopenctm-dev libgmp-dev libqhull-dev patchelf #libmuparser-dev diff --git a/install/linux/resources/appimagetool b/install/linux/resources/appimagetool old mode 100644 new mode 100755