From 07d6760c82c87b3da56575597baaa843960a9ab0 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 30 Nov 2022 16:17:28 +0100 Subject: [PATCH] remove pack phase from linux --- .github/workflows/BuildMeshLab.yml | 1 + scripts/Linux/2_deploy.sh | 44 ++++++------------- scripts/Linux/3_pack.sh | 44 ------------------- .../{make_bundle.sh => 2a_make_bundle.sh} | 17 +++---- scripts/Linux/internal/2b_deb.sh | 26 +++++++++++ scripts/Linux/internal/2c_portable.sh | 42 ++++++++++++++++++ scripts/Linux/internal/2d_appimage.sh | 36 +++++++++++++++ scripts/Linux/make_it.sh | 19 +------- scripts/README.md | 4 +- scripts/Windows/3_pack.sh | 10 ++--- scripts/Windows/make_it.sh | 8 ++-- scripts/macOS/3_pack.sh | 10 ++--- scripts/macOS/make_it.sh | 8 ++-- 13 files changed, 146 insertions(+), 123 deletions(-) delete mode 100644 scripts/Linux/3_pack.sh rename scripts/Linux/internal/{make_bundle.sh => 2a_make_bundle.sh} (87%) create mode 100644 scripts/Linux/internal/2b_deb.sh create mode 100644 scripts/Linux/internal/2c_portable.sh create mode 100644 scripts/Linux/internal/2d_appimage.sh diff --git a/.github/workflows/BuildMeshLab.yml b/.github/workflows/BuildMeshLab.yml index 7df6840cf..c6addc564 100644 --- a/.github/workflows/BuildMeshLab.yml +++ b/.github/workflows/BuildMeshLab.yml @@ -68,6 +68,7 @@ jobs: run: | bash scripts/${{ runner.os }}/2_deploy.sh - name: Packaging + if: runner.os != 'Linux' shell: bash run: | bash scripts/${{ runner.os }}/3_pack.sh diff --git a/scripts/Linux/2_deploy.sh b/scripts/Linux/2_deploy.sh index 6b61d6bac..06702dacd 100644 --- a/scripts/Linux/2_deploy.sh +++ b/scripts/Linux/2_deploy.sh @@ -1,17 +1,9 @@ #!/bin/bash -# This is a script shell for deploying a meshlab-portable folder and create an AppImage. -# Requires a properly built MeshLab (see 1_build.sh). -# -# Without given arguments, the folder that will be deployed is meshlab/install, which -# should be the path where MeshLab has been installed (default output of 1_build.sh). -# The AppImage will be placed in the directory where the script is run. -# -# You can give as argument the path where you installed MeshLab. SCRIPTS_PATH="$(dirname "$(realpath "$0")")" -RESOURCES_PATH=$SCRIPTS_PATH/../../resources INSTALL_PATH=$SCRIPTS_PATH/../../install QT_DIR="" +PACKAGES_PATH=$SCRIPTS_PATH/../../packages #checking for parameters for i in "$@" @@ -25,36 +17,28 @@ case $i in QT_DIR=${i#*=} shift # past argument=value ;; + -p=*|--packages_path=*) + PACKAGES_PATH="${i#*=}" + shift # past argument=value + ;; *) # unknown option ;; esac done -bash $SCRIPTS_PATH/internal/make_bundle.sh -i=$INSTALL_PATH +bash $SCRIPTS_PATH/internal/2a_make_bundle.sh -i=$INSTALL_PATH -if [ ! -z "$QT_DIR" ] -then - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QT_DIR/lib - export QMAKE=$QT_DIR/bin/qmake -fi +echo "======= Bundle created =======" -chmod +x $INSTALL_PATH/usr/bin/meshlab +bash $SCRIPTS_PATH/internal/2b_deb.sh -i=$INSTALL_PATH -p=$PACKAGES_PATH -for plugin in $INSTALL_PATH/usr/lib/meshlab/plugins/*.so -do - # allow plugins to find linked libraries in usr/lib, usr/lib/meshlab and usr/lib/meshlab/plugins - patchelf --set-rpath '$ORIGIN/../../:$ORIGIN/../:$ORIGIN' $plugin -done +echo "======= Deb Created =======" -$RESOURCES_PATH/linux/linuxdeploy --appdir=$INSTALL_PATH \ - --plugin qt +bash $SCRIPTS_PATH/internal/2c_portable.sh -i=$INSTALL_PATH -qt=$QT_DIR -# after deploy, all required libraries are placed into usr/lib, therefore we can remove the ones in -# usr/lib/meshlab (except for the ones that are loaded at runtime) -shopt -s extglob -cd $INSTALL_PATH/usr/lib/meshlab -rm -v !("libIFXCore.so"|"libIFXExporting.so"|"libIFXScheduling.so") +echo "======= Portable Version Created =======" -#at this point, distrib folder contains all the files necessary to execute meshlab -echo "$INSTALL_PATH is now a self contained meshlab application" +bash $SCRIPTS_PATH/internal/2d_appimage.sh -i=$INSTALL_PATH -p=$PACKAGES_PATH + +echo "======= AppImage Created =======" \ No newline at end of file diff --git a/scripts/Linux/3_pack.sh b/scripts/Linux/3_pack.sh deleted file mode 100644 index b4c391f13..000000000 --- a/scripts/Linux/3_pack.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# This is a script shell for deploying a meshlab-portable folder and create an AppImage. -# Requires a properly built MeshLab (see 1_build.sh). -# -# Without given arguments, the folder that will be deployed is meshlab/install, which -# should be the path where MeshLab has been installed (default output of 1_build.sh). -# The AppImage will be placed in the directory where the script is run. -# -# You can give as argument the path where you installed MeshLab. - -SCRIPTS_PATH="$(dirname "$(realpath "$0")")" -RESOURCES_PATH=$SCRIPTS_PATH/../../resources -INSTALL_PATH=$SCRIPTS_PATH/../../install -PACKAGE_PATH=$SCRIPTS_PATH/../../packages - -#checking for parameters -for i in "$@" -do -case $i in - -i=*|--install_path=*) - INSTALL_PATH="${i#*=}" - shift # past argument=value - ;; - -p=*|--package_path=*) - PACKAGE_PATH="${i#*=}" - shift # past argument=value - ;; - *) - # unknown option - ;; -esac -done - -$RESOURCES_PATH/linux/linuxdeploy --appdir=$INSTALL_PATH \ - --output appimage - -#get version -IFS=' ' #space delimiter -STR_VERSION=$($INSTALL_PATH/AppRun --version) -read -a strarr <<< "$STR_VERSION" -ML_VERSION=${strarr[1]} #get the meshlab version from the string - -mkdir $PACKAGE_PATH -mv MeshLab-*.AppImage $PACKAGE_PATH/MeshLab$ML_VERSION-linux.AppImage diff --git a/scripts/Linux/internal/make_bundle.sh b/scripts/Linux/internal/2a_make_bundle.sh similarity index 87% rename from scripts/Linux/internal/make_bundle.sh rename to scripts/Linux/internal/2a_make_bundle.sh index 95ab1f256..f0aa31bd6 100644 --- a/scripts/Linux/internal/make_bundle.sh +++ b/scripts/Linux/internal/2a_make_bundle.sh @@ -1,11 +1,4 @@ #!/bin/bash -# this is a script shell for setting up the application bundle for linux -# Requires a properly built meshlab. -# -# Without given arguments, the application boundle will be placed in the meshlab/install -# directory. -# -# You can give as argument the path were meshlab has been installed. SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/../ RESOURCES_PATH=$SCRIPTS_PATH/../../resources @@ -26,8 +19,6 @@ case $i in esac done -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INSTALL_PATH - #check if we have an exec in distrib if ! [ -f $INSTALL_PATH/usr/bin/meshlab ] then @@ -70,6 +61,10 @@ cp $RESOURCES_PATH/LICENSE.txt $INSTALL_PATH/usr/share/doc/meshlab/ cp $RESOURCES_PATH/privacy.txt $INSTALL_PATH/usr/share/doc/meshlab/ cp $RESOURCES_PATH/readme.txt $INSTALL_PATH/usr/share/doc/meshlab/ -for filename in $INSTALL_PATH/usr/lib/meshlab/plugins/*.so; do - patchelf --set-rpath '$ORIGIN/../' $filename +for plugin in $INSTALL_PATH/usr/lib/meshlab/plugins/*.so +do + # allow plugins to find linked libraries in usr/lib, usr/lib/meshlab and usr/lib/meshlab/plugins + patchelf --set-rpath '$ORIGIN/../../:$ORIGIN/../:$ORIGIN' $plugin done + +chmod +x $INSTALL_PATH/usr/bin/meshlab \ No newline at end of file diff --git a/scripts/Linux/internal/2b_deb.sh b/scripts/Linux/internal/2b_deb.sh new file mode 100644 index 000000000..f566465bc --- /dev/null +++ b/scripts/Linux/internal/2b_deb.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/.. +RESOURCES_PATH=$SCRIPTS_PATH/../../resources +INSTALL_PATH=$SCRIPTS_PATH/../../install +PACKAGES_PATH=$SCRIPTS_PATH/../../packages + +#checking for parameters +for i in "$@" +do +case $i in + -i=*|--install_path=*) + INSTALL_PATH="${i#*=}" + shift # past argument=value + ;; + -p=*|--packages_path=*) + PACKAGES_PATH="${i#*=}" + shift # past argument=value + ;; + *) + # unknown option + ;; +esac +done + +mkdir $PACKAGES_PATH diff --git a/scripts/Linux/internal/2c_portable.sh b/scripts/Linux/internal/2c_portable.sh new file mode 100644 index 000000000..02981bf36 --- /dev/null +++ b/scripts/Linux/internal/2c_portable.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/.. +RESOURCES_PATH=$SCRIPTS_PATH/../../resources +INSTALL_PATH=$SCRIPTS_PATH/../../install +QT_DIR="" + +#checking for parameters +for i in "$@" +do +case $i in + -i=*|--install_path=*) + INSTALL_PATH="${i#*=}" + shift # past argument=value + ;; + -qt=*|--qt_dir=*) + QT_DIR=${i#*=} + shift # past argument=value + ;; + *) + # unknown option + ;; +esac +done + +if [ ! -z "$QT_DIR" ] +then + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QT_DIR/lib + export QMAKE=$QT_DIR/bin/qmake +fi + +$RESOURCES_PATH/linux/linuxdeploy --appdir=$INSTALL_PATH \ + --plugin qt + +# after deploy, all required libraries are placed into usr/lib, therefore we can remove the ones in +# usr/lib/meshlab (except for the ones that are loaded at runtime) +shopt -s extglob +cd $INSTALL_PATH/usr/lib/meshlab +rm -v !("libIFXCore.so"|"libIFXExporting.so"|"libIFXScheduling.so") + +#at this point, distrib folder contains all the files necessary to execute meshlab +echo "$INSTALL_PATH is now a self contained meshlab application" \ No newline at end of file diff --git a/scripts/Linux/internal/2d_appimage.sh b/scripts/Linux/internal/2d_appimage.sh new file mode 100644 index 000000000..5dd05a7cd --- /dev/null +++ b/scripts/Linux/internal/2d_appimage.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/.. +RESOURCES_PATH=$SCRIPTS_PATH/../../resources +INSTALL_PATH=$SCRIPTS_PATH/../../install +PACKAGES_PATH=$SCRIPTS_PATH/../../packages + +#checking for parameters +for i in "$@" +do +case $i in + -i=*|--install_path=*) + INSTALL_PATH="${i#*=}" + shift # past argument=value + ;; + -p=*|--packages_path=*) + PACKAGES_PATH="${i#*=}" + shift # past argument=value + ;; + *) + # unknown option + ;; +esac +done + +$RESOURCES_PATH/linux/linuxdeploy --appdir=$INSTALL_PATH \ + --output appimage + +#get version +IFS=' ' #space delimiter +STR_VERSION=$($INSTALL_PATH/AppRun --version) +read -a strarr <<< "$STR_VERSION" +ML_VERSION=${strarr[1]} #get the meshlab version from the string + +mkdir $PACKAGES_PATH +mv MeshLab-*.AppImage $PACKAGES_PATH/MeshLab$ML_VERSION-linux.AppImage \ No newline at end of file diff --git a/scripts/Linux/make_it.sh b/scripts/Linux/make_it.sh index 4ebeecd1f..51a3121f3 100644 --- a/scripts/Linux/make_it.sh +++ b/scripts/Linux/make_it.sh @@ -1,20 +1,4 @@ #!/bin/bash -# This is a script shell for compiling and deploying MeshLab in a Linux environment. -# -# Requires a Qt environment which is set-up properly, and an accessible -# cmake binary. -# -# Without given arguments, MeshLab will be built in the meshlab/build, -# the folder meshlab/install will be a portable version of MeshLab and -# the AppImage will be placed in meshlab/src. -# -# You can give as argument the build path, the install path (that will contain -# the portable version of MeshLab), and the number of cores to use to build MeshLab -# (default: 4). -# The AppImage will be placed in the directory where the script is run. -# -# Example of call: -# bash make_it.sh --build_path=path/to/build --install_path=path/to/install -j8 SCRIPTS_PATH="$(dirname "$(realpath "$0")")" SOURCE_PATH=$SCRIPTS_PATH/../.. @@ -66,5 +50,4 @@ esac done bash $SCRIPTS_PATH/1_build.sh -b=$BUILD_PATH -i=$INSTALL_PATH $NIGHTLY_OPTION $DOUBLE_PRECISION_OPTION $QT_DIR_OPTION $CCACHE_OPTION -bash $SCRIPTS_PATH/2_deploy.sh -i=$INSTALL_PATH $QT_DIR_OPTION -bash $SCRIPTS_PATH/3_pack.sh -i=$INSTALL_PATH -p=$PACKAGE_PATH +bash $SCRIPTS_PATH/2_deploy.sh -i=$INSTALL_PATH -p=$PACKAGE_PATH $QT_DIR_OPTION diff --git a/scripts/README.md b/scripts/README.md index 16115f459..d90f054ed 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -78,9 +78,9 @@ It takes the following input arguments: - `--install_path`: the directory containing MeshLab deployed; it should be the same argument given to the `2_deploy.sh` script; - default: `[meshlab_repo]/install` - example: `--install_path=path/to/install` - - `--package_path`: the directory where the output package(s) will be placed; + - `--packages_path`: the directory where the output package(s) will be placed; - default: `[meshlab_repo]/packages` - - example: `--package_path=path/to/packages` + - example: `--packages_path=path/to/packages` Example of call: ``` diff --git a/scripts/Windows/3_pack.sh b/scripts/Windows/3_pack.sh index 6384f316c..1cba131d7 100644 --- a/scripts/Windows/3_pack.sh +++ b/scripts/Windows/3_pack.sh @@ -12,7 +12,7 @@ SCRIPTS_PATH="$(dirname "$(realpath "$0")")" RESOURCES_PATH=$SCRIPTS_PATH/../../resources INSTALL_PATH=$SCRIPTS_PATH/../../install -PACKAGE_PATH=$SCRIPTS_PATH/../../packages +PACKAGES_PATH=$SCRIPTS_PATH/../../packages #checking for parameters for i in "$@" @@ -22,8 +22,8 @@ case $i in INSTALL_PATH="${i#*=}" shift # past argument=value ;; - -p=*|--package_path=*) - PACKAGE_PATH="${i#*=}" + -p=*|--packages_path=*) + PACKAGES_PATH="${i#*=}" shift # past argument=value ;; *) @@ -40,5 +40,5 @@ rm $INSTALL_PATH/meshlab_final.nsi rm $INSTALL_PATH/ExecWaitJob.nsh rm $INSTALL_PATH/FileAssociation.nsh -mkdir $PACKAGE_PATH -mv $INSTALL_PATH/MeshLab*-windows.exe $PACKAGE_PATH +mkdir $PACKAGES_PATH +mv $INSTALL_PATH/MeshLab*-windows.exe $PACKAGES_PATH diff --git a/scripts/Windows/make_it.sh b/scripts/Windows/make_it.sh index ec045b468..e8c97d7ca 100644 --- a/scripts/Windows/make_it.sh +++ b/scripts/Windows/make_it.sh @@ -19,7 +19,7 @@ SCRIPTS_PATH="$(dirname "$(realpath "$0")")" SOURCE_PATH=$SCRIPTS_PATH/../.. BUILD_PATH=$SOURCE_PATH/build INSTALL_PATH=$SOURCE_PATH/install -PACKAGE_PATH=$SOURCE_PATH/packages +PACKAGES_PATH=$SOURCE_PATH/packages DOUBLE_PRECISION_OPTION="" NIGHTLY_OPTION="" @@ -38,8 +38,8 @@ case $i in INSTALL_PATH="${i#*=}"/usr/ shift # past argument=value ;; - -p=*|--package_path=*) - PACKAGE_PATH="${i#*=}" + -p=*|--packages_path=*) + PACKAGES_PATH="${i#*=}" shift # past argument=value ;; --double_precision) @@ -66,5 +66,5 @@ done bash $SCRIPTS_PATH/1_build.sh -b=$BUILD_PATH -i=$INSTALL_PATH $NIGHTLY_OPTION $DOUBLE_PRECISION_OPTION $QT_DIR_OPTION $CCACHE_OPTION bash $SCRIPTS_PATH/2_deploy.sh -i=$INSTALL_PATH $QT_DIR_OPTION -bash $SCRIPTS_PATH/3_pack.sh -i=$INSTALL_PATH -p=$PACKAGE_PATH +bash $SCRIPTS_PATH/3_pack.sh -i=$INSTALL_PATH -p=$PACKAGES_PATH diff --git a/scripts/macOS/3_pack.sh b/scripts/macOS/3_pack.sh index 8c836113b..3ab9c49ca 100755 --- a/scripts/macOS/3_pack.sh +++ b/scripts/macOS/3_pack.sh @@ -12,7 +12,7 @@ SCRIPTS_PATH=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) RESOURCES_PATH=$SCRIPTS_PATH/../../resources INSTALL_PATH=$SCRIPTS_PATH/../../install -PACKAGE_PATH=$SCRIPTS_PATH/../../packages +PACKAGES_PATH=$SCRIPTS_PATH/../../packages #checking for parameters for i in "$@" @@ -22,8 +22,8 @@ case $i in INSTALL_PATH="${i#*=}" shift # past argument=value ;; - -p=*|--package_path=*) - PACKAGE_PATH="${i#*=}" + -p=*|--packages_path=*) + PACKAGES_PATH="${i#*=}" shift # past argument=value ;; *) @@ -54,8 +54,8 @@ rm -f $INSTALL_PATH/*.dmg mv $INSTALL_PATH/meshlab.app $INSTALL_PATH/MeshLab$ML_VERSION.app -mkdir $PACKAGE_PATH +mkdir $PACKAGES_PATH -appdmg $RESOURCES_PATH/macos/meshlab_dmg_final.json $PACKAGE_PATH/MeshLab$ML_VERSION-macos.dmg +appdmg $RESOURCES_PATH/macos/meshlab_dmg_final.json $PACKAGES_PATH/MeshLab$ML_VERSION-macos.dmg rm $RESOURCES_PATH/macos/meshlab_dmg_final.json diff --git a/scripts/macOS/make_it.sh b/scripts/macOS/make_it.sh index 044148b18..c485c68a6 100644 --- a/scripts/macOS/make_it.sh +++ b/scripts/macOS/make_it.sh @@ -20,7 +20,7 @@ SCRIPTS_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) SOURCE_PATH=$SCRIPTS_PATH/../.. BUILD_PATH=$SOURCE_PATH/build INSTALL_PATH=$SOURCE_PATH/install -PACKAGE_PATH=$SOURCE_PATH/packages +PACKAGES_PATH=$SOURCE_PATH/packages DOUBLE_PRECISION_OPTION="" NIGHTLY_OPTION="" @@ -39,8 +39,8 @@ case $i in INSTALL_PATH="${i#*=}"/usr/ shift # past argument=value ;; - -p=*|--package_path=*) - PACKAGE_PATH="${i#*=}" + -p=*|--packages_path=*) + PACKAGES_PATH="${i#*=}" shift # past argument=value ;; --double_precision) @@ -67,5 +67,5 @@ done bash $SCRIPTS_PATH/1_build.sh -b=$BUILD_PATH -i=$INSTALL_PATH $NIGHTLY_OPTION $DOUBLE_PRECISION_OPTION $QT_DIR_OPTION $CCACHE_OPTION bash $SCRIPTS_PATH/2_deploy.sh -i=$INSTALL_PATH $QT_DIR_OPTION -bash $SCRIPTS_PATH/3_pack.sh -i=$INSTALL_PATH -p=$PACKAGE_PATH +bash $SCRIPTS_PATH/3_pack.sh -i=$INSTALL_PATH -p=$PACKAGES_PATH