diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index 0ef059d45..5444cd6ed 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -39,7 +39,7 @@ jobs: sh scripts/${{ runner.os }}/2_deploy.sh - name: Build MeshLab AppImage run : | - sh scripts/${{ runner.os }}/3_appimage.sh + sh scripts/${{ runner.os }}/3_appimage.sh --${{ matrix.precision }} - name: Upload Meshlab Portable uses: actions/upload-artifact@v1 with: diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml index cd1b0210c..92219e0f9 100644 --- a/.github/workflows/MacOS.yml +++ b/.github/workflows/MacOS.yml @@ -26,10 +26,10 @@ jobs: shell: bash run: | if [ "${{matrix.precision}}" == "double_precision" ]; then - echo ::set-output name=date::"$(cat ML_VERSION)d" + echo ::set-output name=version::"$(cat ML_VERSION)d" echo ::set-output name=artifact_suffix::"_double" else - echo ::set-output name=date::"$(cat ML_VERSION)" + echo ::set-output name=version::"$(cat ML_VERSION)" echo ::set-output name=artifact_suffix::"" fi - name: Configure and Build @@ -40,10 +40,10 @@ jobs: sh scripts/${{ runner.os }}/2_deploy.sh - name: Create DMG run: | - sh scripts/${{ runner.os }}/3_dmg.sh - mv src/install/MeshLab${{steps.envs.outputs.date}}.dmg src/install/MeshLab${{steps.envs.outputs.date}}-macos.dmg + sh scripts/${{ runner.os }}/3_dmg.sh --${{ matrix.precision }} + mv src/install/MeshLab${{steps.envs.outputs.version}}.dmg src/install/MeshLab${{steps.envs.outputs.version}}-macos.dmg - name: Upload DMG uses: actions/upload-artifact@v1 with: name: meshlab_macos_dmg${{steps.envs.outputs.artifact_suffix}} - path: src/install/MeshLab${{steps.envs.outputs.date}}-macos.dmg + path: src/install/MeshLab${{steps.envs.outputs.version}}-macos.dmg diff --git a/scripts/Linux/2_deploy.sh b/scripts/Linux/2_deploy.sh index f79692c62..0286656a9 100644 --- a/scripts/Linux/2_deploy.sh +++ b/scripts/Linux/2_deploy.sh @@ -11,31 +11,37 @@ # You can give as argument the path where you installed MeshLab. SCRIPTS_PATH="$(dirname "$(realpath "$0")")" +INSTALL_PATH=$SCRIPTS_PATH/../../src/install #checking for parameters -if [ "$#" -eq 0 ] -then - BUNDLE_PATH=$SCRIPTS_PATH/../../src/install -else - BUNDLE_PATH=$(realpath $1) -fi +for i in "$@" +do +case $i in + -i=*|--install_path=*) + INSTALL_PATH="${i#*=}" + shift # past argument=value + *) + # unknown option + ;; +esac +done -bash $SCRIPTS_PATH/resources/make_bundle.sh $BUNDLE_PATH +bash $SCRIPTS_PATH/resources/make_bundle.sh $INSTALL_PATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BUNDLE_PATH/usr/lib/meshlab -$SCRIPTS_PATH/resources/linuxdeployqt $BUNDLE_PATH/usr/share/applications/meshlab.desktop \ +$SCRIPTS_PATH/resources/linuxdeployqt $INSTALL_PATH/usr/share/applications/meshlab.desktop \ -bundle-non-qt-libs \ - -executable=$BUNDLE_PATH/usr/lib/meshlab/plugins/libfilter_sketchfab.so \ - -executable=$BUNDLE_PATH/usr/lib/meshlab/plugins/libio_3ds.so \ - -executable=$BUNDLE_PATH/usr/lib/meshlab/plugins/libio_ctm.so - + -executable=$INSTALL_PATH/usr/lib/meshlab/plugins/libfilter_sketchfab.so \ + -executable=$INSTALL_PATH/usr/lib/meshlab/plugins/libio_3ds.so \ + -executable=$INSTALL_PATH/usr/lib/meshlab/plugins/libio_ctm.so -chmod +x $BUNDLE_PATH/usr/bin/meshlab -rm $BUNDLE_PATH/AppRun -cp $SCRIPTS_PATH/resources/AppRunMeshLab $BUNDLE_PATH/ -mv $BUNDLE_PATH/AppRunMeshLab $BUNDLE_PATH/AppRun -chmod +x $BUNDLE_PATH/AppRun +chmod +x $INSTALL_PATH/usr/bin/meshlab +rm $INSTALL_PATH/AppRun + +cp $SCRIPTS_PATH/resources/AppRunMeshLab $INSTALL_PATH/ +mv $INSTALL_PATH/AppRunMeshLab $INSTALL_PATH/AppRun +chmod +x $INSTALL_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" +echo "$INSTALL_PATH is now a self contained meshlab application" diff --git a/scripts/Linux/3_appimage.sh b/scripts/Linux/3_appimage.sh index 7c9820543..6ef0cb569 100644 --- a/scripts/Linux/3_appimage.sh +++ b/scripts/Linux/3_appimage.sh @@ -10,20 +10,33 @@ # and the AppImage will be placed in the parent directory (src) SCRIPTS_PATH="$(dirname "$(realpath "$0")")" +INSTALL_PATH=$SCRIPTS_PATH/../../src/install +ML_VERSION=$(cat $SCRIPTS_PATH/../../ML_VERSION) + #checking for parameters -if [ "$#" -eq 0 ] -then - BUNDLE_PATH=$SCRIPTS_PATH/../../src/install -else - BUNDLE_PATH=$(realpath $1) -fi +for i in "$@" +do +case $i in + -i=*|--install_path=*) + INSTALL_PATH="${i#*=}" + shift # past argument=value + ;; + --double_precision) + ML_VERSION=$ML_VERSIONd + shift # past argument=value + ;; + *) + # unknown option + ;; +esac +done -PARENT_NAME="$(dirname $BUNDLE_PATH)" +PARENT_NAME="$(dirname $INSTALL_PATH)" -export VERSION=$(cat $SCRIPTS_PATH/../../ML_VERSION) +export VERSION=$ML_VERSION -$SCRIPTS_PATH/resources/appimagetool $BUNDLE_PATH +$SCRIPTS_PATH/resources/appimagetool $INSTALL_PATH mv MeshLab-$VERSION*.AppImage $PARENT_NAME/MeshLab$VERSION-linux.AppImage #at this point, distrib folder contains all the files necessary to execute meshlab diff --git a/scripts/Linux/make_it.sh b/scripts/Linux/make_it.sh index c1af8df49..38cb5ba95 100644 --- a/scripts/Linux/make_it.sh +++ b/scripts/Linux/make_it.sh @@ -24,6 +24,7 @@ SOURCE_PATH=$SCRIPTS_PATH/../../src BUILD_PATH=$SOURCE_PATH/build INSTALL_PATH=$SOURCE_PATH/install CORES="-j4" +DOUBLE_PRECISION_OPTION="" #check parameters for i in "$@" @@ -41,6 +42,10 @@ case $i in CORES=$i shift # past argument=value ;; + --double_precision) + DOUBLE_PRECISION_OPTION="--double_precision" + shift # past argument=value + ;; *) # unknown option ;; @@ -48,5 +53,5 @@ esac done sh $SCRIPTS_PATH/1_build.sh -b=$BUILD_PATH -i=$INSTALL_PATH $CORES -sh $SCRIPTS_PATH/2_deploy.sh $INSTALL_PATH -sh $SCRIPTS_PATH/3_appimages.sh $INSTALL_PATH +sh $SCRIPTS_PATH/2_deploy.sh -i=$INSTALL_PATH +sh $SCRIPTS_PATH/3_appimages.sh -i=$INSTALL_PATH $DOUBLE_PRECISION_OPTION diff --git a/scripts/macOS/1_build.sh b/scripts/macOS/1_build.sh index 9efa03de2..5d561e4f4 100644 --- a/scripts/macOS/1_build.sh +++ b/scripts/macOS/1_build.sh @@ -40,7 +40,7 @@ case $i in CORES=$i shift # past argument=value ;; - --double_precision*) + --double_precision) DOUBLE_PRECISION_OPTION="-DBUILD_WITH_DOUBLE_SCALAR=ON" shift # past argument=value ;; diff --git a/scripts/macOS/2_deploy.sh b/scripts/macOS/2_deploy.sh index d7c048c22..54b5850d8 100755 --- a/scripts/macOS/2_deploy.sh +++ b/scripts/macOS/2_deploy.sh @@ -14,16 +14,21 @@ realpath() { } SCRIPTS_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +INSTALL_PATH=$SCRIPTS_PATH/../../src/install +APPNAME="meshlab.app" #checking for parameters -if [ "$#" -eq 0 ] -then - INSTALL_PATH=$SCRIPTS_PATH/../../src/install -else - INSTALL_PATH=$(realpath $1) -fi - -APPNAME="meshlab.app" +for i in "$@" +do +case $i in + -i=*|--install_path=*) + INSTALL_PATH="${i#*=}" + shift # past argument=value + *) + # unknown option + ;; +esac +done echo "Hopefully I should find " $INSTALL_PATH/$APPNAME diff --git a/scripts/macOS/3_dmg.sh b/scripts/macOS/3_dmg.sh index e941f4ec3..7391ee684 100755 --- a/scripts/macOS/3_dmg.sh +++ b/scripts/macOS/3_dmg.sh @@ -5,7 +5,7 @@ # # Without given arguments, meshlab.app will be looked for in meshlab/distrib # folder. MeshLab DMG will be placed in the same directory of meshlab.app. -# +# # You can give as argument the DISTRIB_PATH containing meshlab.app. #realpath function @@ -13,15 +13,27 @@ realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" } -SCRIPTS_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +SCRIPTS_PATH=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) +INSTALL_PATH=$SCRIPTS_PATH/../../src/install +ML_VERSION=$(cat $SCRIPTS_PATH/../../ML_VERSION) #checking for parameters -if [ "$#" -eq 0 ] -then - INSTALL_PATH=$SCRIPTS_PATH/../../src/install -else - INSTALL_PATH=$( realpath $1 ) -fi +for i in "$@" +do +case $i in + -i=*|--install_path=*) + INSTALL_PATH="${i#*=}" + shift # past argument=value + ;; + --double_precision) + ML_VERSION=$ML_VERSIONd + shift # past argument=value + ;; + *) + # unknown option + ;; +esac +done if ! [ -e $INSTALL_PATH/meshlab.app -a -d $INSTALL_PATH/meshlab.app ] then @@ -39,7 +51,7 @@ sed -i '' "s%SOURCE_PATH%$SOURCE_PATH%g" $SCRIPTS_PATH/resources/meshlab_dmg_fin rm -f $INSTALL_PATH/*.dmg echo "Running appdmg" -appdmg $SCRIPTS_PATH/resources/meshlab_dmg_final.json $INSTALL_PATH/MeshLab$(cat $SCRIPTS_PATH/../../ML_VERSION).dmg +appdmg $SCRIPTS_PATH/resources/meshlab_dmg_final.json $INSTALL_PATH/MeshLab$ML_VERSION.dmg rm $SCRIPTS_PATH/resources/meshlab_dmg_final.json