File: 2c_portable.sh

package info (click to toggle)
meshlab 2025.07~dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,136 kB
  • sloc: cpp: 224,482; ansic: 20,973; sh: 1,001; makefile: 31
file content (48 lines) | stat: -rw-r--r-- 1,217 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

shopt -s extglob

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

ARCH=$(uname -m)

# Make sure that deploy succeeds before we start deleting files
if $RESOURCES_PATH/linux/$ARCH/linuxdeploy --appdir=$INSTALL_PATH --plugin qt; then
  # 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)
  cd $INSTALL_PATH/usr/lib/meshlab
  rm -v !("libIFXCore.so"|"libIFXExporting.so"|"libIFXScheduling.so")

  echo "$INSTALL_PATH is now a self contained meshlab application"

else
  echo "linuxdeploy failed with error code $?. Script was not completed successfully."
  exit 1
fi