diff --git a/scripts/Linux/2_deploy.sh b/scripts/Linux/2_deploy.sh index 0286656a9..74835c15b 100644 --- a/scripts/Linux/2_deploy.sh +++ b/scripts/Linux/2_deploy.sh @@ -20,6 +20,7 @@ case $i in -i=*|--install_path=*) INSTALL_PATH="${i#*=}" shift # past argument=value + ;; *) # unknown option ;; diff --git a/scripts/Linux/README.md b/scripts/Linux/README.md index 7b11d13fc..edb460a13 100644 --- a/scripts/Linux/README.md +++ b/scripts/Linux/README.md @@ -9,8 +9,10 @@ This folder contains a series of scripts to build and deploy MeshLab under a Lin * the build directory (default: `src/build`): `--build_path=path/to/build` * the install directory (default: `src/install`): `--install_path=path/to/install` * the number of cores used to build MeshLab (default: `-j4`)` -* `2_deploy.sh`: this script makes the given path a portable version of MeshLab. Takes as argument the path where the output install path of the `1_build.sh` script is placed (default: `src/install`); -* `3_appimage.sh`: this script computes, starting from the portable folder of MeshLab, an [AppImage](https://appimage.org/) that can be run in a Linux Environment without dependencies. Takes as argument the path where the output install path of the `2_deploy.sh` script is placed (default: `src/install`); +* `2_deploy.sh`: this script makes the given path a portable version of MeshLab. Takes as arguments: + * the path where the output install path of the `1_build.sh` script is placed (default: `src/install`): `--install_path=path/to/install` +* `3_appimage.sh`: this script computes, starting from the portable folder of MeshLab, an [AppImage](https://appimage.org/) that can be run in a Linux Environment without dependencies. Takes as arguments: + * the path where the output install path of the `2_deploy.sh` script is placed (default: `src/install`): `--install_path=path/to/install` * `make_it.sh`: this script builds, deploys and generates an [AppImage](https://appimage.org/) that can be run in a Linux Environment without dependencies. Arguments are the same of the `1_build.sh` script. __NOTE__: `linux_deploy.sh`and `linux_make_it.sh` use [LinuxDeployQt](https://github.com/probonopd/linuxdeployqt), which allows to deploy applications **only running the oldest supported linux distro** (see [this](https://github.com/probonopd/linuxdeployqt/issues/340)) in order to guarantee the largest support possible. Therefore, before running these scripts, be sure that your Linux distribution is the oldest supported one. diff --git a/scripts/README.md b/scripts/README.md index c7b8226de..3da38854e 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -5,7 +5,7 @@ This folder contains a series of platform-dependent scripts to build and deploy Every platform folder contains: * `1_build.sh`: a script that builds MeshLab. Requires a Qt environment properly set, with `cmake` accessible. Takes as inputh the build directory (default: `src/build`), the install directory (default: `src/install`) and the number of cores used to build MeshLab (default: `-j4`). Example of call: `bash 1_build.sh --build_path=path/to/build --install_path=path/to/install -j8` -* `2_deploy.sh`: a script that deploys MeshLab, making sure that the folder will be a self-contained MeshLab, without Qt library dependencies. Requires a properly built MeshLab in the directory passed as an argument (default: `src/install`). Example of call: `bash 2_deploy.sh path/to/deploy` +* `2_deploy.sh`: a script that deploys MeshLab, making sure that the folder will be a self-contained MeshLab, without Qt library dependencies. Requires a properly built MeshLab in the directory passed as an argument (default: `src/install`). Example of call: `bash 2_deploy.sh --install_path=path/to/deploy` * `3_$installer$.sh`: a script that computes a platform-dependent self-contained package/installer of MeshLab. Requires a properly deployed MeshLab in the directory passed as an argument (default: `src/install`). The result will be saved in the parent directory of the given argument. * `make_it.sh`: a script that computes all the three previous scripts: starting from the source code, it will produce a self-contained package/installer of MeshLab (arguments are the same of `1_build.sh`). Example of call: `bash makeit.sh --build_path=path/to/build --install_path=path/to/install -j8` diff --git a/scripts/Windows/2_deploy.sh b/scripts/Windows/2_deploy.sh index edfc98228..8059d30bb 100644 --- a/scripts/Windows/2_deploy.sh +++ b/scripts/Windows/2_deploy.sh @@ -8,23 +8,30 @@ SCRIPTS_PATH="$(dirname "$(realpath "$0")")" DISTRIB_PATH=$SCRIPTS_PATH/../../distrib +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 -windeployqt $BUNDLE_PATH/meshlab.exe +windeployqt $INSTALL_PATH/meshlab.exe -windeployqt $BUNDLE_PATH/plugins/filter_sketchfab.dll --libdir $BUNDLE_PATH/ +windeployqt $INSTALL_PATH/plugins/filter_sketchfab.dll --libdir $INSTALL_PATH/ -mv $BUNDLE_PATH/lib/meshlab/IFX* $BUNDLE_PATH -cp $BUNDLE_PATH/IFXCoreStatic.lib $BUNDLE_PATH/lib/meshlab/ -cp $DISTRIB_PATH/LICENSE.txt $BUNDLE_PATH/ -cp $DISTRIB_PATH/privacy.txt $BUNDLE_PATH/ +mv $INSTALL_PATH/lib/meshlab/IFX* $INSTALL_PATH +cp $INSTALL_PATH/IFXCoreStatic.lib $INSTALL_PATH/lib/meshlab/ +cp $DISTRIB_PATH/LICENSE.txt $INSTALL_PATH/ +cp $DISTRIB_PATH/privacy.txt $INSTALL_PATH/ #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/Windows/3_installer.sh b/scripts/Windows/3_installer.sh index 6b3073928..363bfd290 100644 --- a/scripts/Windows/3_installer.sh +++ b/scripts/Windows/3_installer.sh @@ -10,16 +10,29 @@ # After running this script, the installer can be found inside the resources folder. SCRIPTS_PATH="$(dirname "$(realpath "$0")")" +INSTALL_PATH=$SCRIPTS_PATH/../../src/install +DOUBLE_PRECISION_OPTION="" + #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) + DOUBLE_PRECISION_OPTION="--double_precision" + shift # past argument=value + ;; + *) + # unknown option + ;; +esac +done -sh $SCRIPTS_PATH/resources/nsis_script.sh $BUNDLE_PATH +sh $SCRIPTS_PATH/resources/nsis_script.sh -i=$INSTALL_PATH $DOUBLE_PRECISION_OPTION makensis.exe $SCRIPTS_PATH/resources/meshlab_final.nsi diff --git a/scripts/Windows/README.md b/scripts/Windows/README.md index 0289b4f7f..e38851fa8 100644 --- a/scripts/Windows/README.md +++ b/scripts/Windows/README.md @@ -1,7 +1,5 @@ # Windows Scripts -**WORK IN PROGRESS** - This folder contains a series of scripts to build and deploy MeshLab under a Windows environment. **Note**: scripts are written in bash, therefore they should be run in a linux subsystem environment. @@ -13,8 +11,10 @@ This folder contains a series of scripts to build and deploy MeshLab under a Win * the build directory (default: `src/build`): `--build_path=path/to/build` * the install directory (default: `src/install`): `--install_path=path/to/install` * the number of cores used to build MeshLab (default: `-j4`)` -* `2_deploy.sh`: this script makes the given path a portable version of MeshLab. Takes as argument the path where the output install path of the `1_build.sh` script is placed (default: `src/install`); -* `3_installer.sh`: this script computes, starting from the portable folder of MeshLab, an NSIS installer. Takes as argument the path where the output install path of the `2_deploy.sh` script is placed (default: `src/install`); +* `2_deploy.sh`: this script makes the given path a portable version of MeshLab. Takes as arguments: + * the path where the output install path of the `1_build.sh` script is placed (default: `src/install`): `--install_path=path/to/install` +* `3_installer.sh`: this script computes, starting from the portable folder of MeshLab, an NSIS installer. Takes as arguments: + * the path where the output install path of the `2_deploy.sh` script is placed (default: `src/install`): `--install_path=path/to/install` * it requires `makensis.exe` in the PATH env variable. diff --git a/scripts/Windows/resources/nsis_script.sh b/scripts/Windows/resources/nsis_script.sh index ea6ec5c22..26a4576d2 100644 --- a/scripts/Windows/resources/nsis_script.sh +++ b/scripts/Windows/resources/nsis_script.sh @@ -11,25 +11,30 @@ SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/.. SOURCE_PATH=$SCRIPTS_PATH/../../src - -#checking for parameters -if [ "$#" -eq 0 ] -then - BUNDLE_PATH=$SOURCE_PATH/install -else - BUNDLE_PATH=$(realpath $1) -fi - -#if(! (Test-Path meshlab.exe)){ #meshlab.exe not found inside $DISTRIB_PATH -# cd $DIR -# throw 'meshlab.exe not found in ' + ($BUNDLE_PATH) + '. Exiting.' -#} - VERSION=$(cat $SOURCE_PATH/../ML_VERSION) +INSTALL_PATH=$SOURCE_PATH/install + +#check parameters +for i in "$@" +do +case $i in + -i=*|--install_path=*) + INSTALL_PATH="${i#*=}" + shift # past argument=value + ;; + --double_precision) + VERSION=$VERSIONd + shift # past argument=value + ;; + *) + # unknown option + ;; +esac +done sed "s%MESHLAB_VERSION%$VERSION%g" $SCRIPTS_PATH/resources/meshlab.nsi > $SCRIPTS_PATH/resources/meshlab_final.nsi sed -i "s%DISTRIB_PATH%.%g" $SCRIPTS_PATH/resources/meshlab_final.nsi -mv $SCRIPTS_PATH/resources/meshlab_final.nsi $BUNDLE_PATH/ -cp $SCRIPTS_PATH/resources/ExecWaitJob.nsh $BUNDLE_PATH/ -cp $SCRIPTS_PATH/resources/FileAssociation.nsh $BUNDLE_PATH/ +mv $SCRIPTS_PATH/resources/meshlab_final.nsi $INSTALL_PATH/ +cp $SCRIPTS_PATH/resources/ExecWaitJob.nsh $INSTALL_PATH/ +cp $SCRIPTS_PATH/resources/FileAssociation.nsh $INSTALL_PATH/ diff --git a/scripts/macOS/2_deploy.sh b/scripts/macOS/2_deploy.sh index 54b5850d8..cbe313b3b 100755 --- a/scripts/macOS/2_deploy.sh +++ b/scripts/macOS/2_deploy.sh @@ -24,6 +24,7 @@ case $i in -i=*|--install_path=*) INSTALL_PATH="${i#*=}" shift # past argument=value + ;; *) # unknown option ;; diff --git a/scripts/macOS/README.md b/scripts/macOS/README.md index 0d00ba543..ba98e0e21 100644 --- a/scripts/macOS/README.md +++ b/scripts/macOS/README.md @@ -9,8 +9,10 @@ This folder contains a series of scripts to build and deploy MeshLab under a Mac * the build directory (default: `src/build`): `--build_path=path/to/build` * the install directory (default: `src/install`): `--install_path=path/to/install` * the number of cores used to build MeshLab (default: `-j4`)` -* `2_deploy.sh`: this script makes portable a `meshlab.app` appdir. Takes as argument the path where the output install path of the `1_build.sh` script is placed (default: `src/install`); -* `3_dmg.sh`: this script generates a [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) that can be used to install MeshLab. Takes as argument the path where the install path of the `2_deploy.sh` script is placed (default: `src/install`); +* `2_deploy.sh`: this script makes portable a `meshlab.app` appdir. Takes as arguments: + * the path where the output install path of the `1_build.sh` script is placed (default: `src/install`): `--install_path=path/to/install` +* `3_dmg.sh`: this script generates a [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) that can be used to install MeshLab. Takes as arguments: + * the path where the install path of the `2_deploy.sh` script is placed (default: `src/install`): `--install_path=path/to/install` * `make_it.sh`: this script builds, deploys and generates a [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) that can be used to install MeshLab. Arguments are the same of the `1_build.sh` script. ## Examples