/
linux_appimages.sh
86 lines (71 loc) · 2.37 KB
/
linux_appimages.sh
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# this is a script shell for setting up the application bundle for linux
# Requires a properly built meshlab (does not require to run the
# linux_deploy.sh script).
#
# 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
# directory.
#
# You can give as argument the DISTRIB_PATH.
cd "${0%/*}" #move to script directory
#checking for parameters
if [ "$#" -eq 0 ]
then
DISTRIB_PATH=$PWD/../../distrib
else
DISTRIB_PATH=$1
fi
SOURCE_PATH=$PWD/../../src
INSTALL_PATH=$(pwd)
cd $DISTRIB_PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)
#check if we have an exec in distrib
if ! [ -f meshlab ]
then
echo "ERROR: meshlab bin not found inside distrib"
exit 1
fi
rm -r lib/macx64/
rm -r lib/win32-msvc/
rm -r lib/win32-msvc2008/
rm -r lib/win32-msvc2015/
rm -r lib/readme.txt
rm -r plugins/U3D_OSX/
rm -r plugins/U3D_W32/
rm -r plugins/plugins.txt
rm -r README.md
mkdir -p usr/bin
mkdir -p usr/lib/meshlab
mkdir -p usr/share/applications
mkdir -p usr/share/meshlab
mkdir -p usr/share/doc/meshlab
mkdir -p usr/share/icons/hicolor/512x512/apps/
cp $INSTALL_PATH/resources/meshlab_server.desktop usr/share/applications/
mv meshlab.png usr/share/icons/hicolor/512x512/apps/meshlab.png
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/libcommon* usr/lib/
mv plugins/ usr/lib/meshlab/
mv shaders/ usr/share/meshlab/
export VERSION=$(cat $INSTALL_PATH/../../ML_VERSION)
$INSTALL_PATH/resources/linuxdeployqt usr/share/applications/meshlab_server.desktop -appimage
mv *.AppImage ../MeshLabServer$VERSION-linux.AppImage
rm AppRun
rm *.desktop
rm *.png
rm usr/share/applications/meshlab_server.desktop
cp $INSTALL_PATH/resources/default.desktop usr/share/applications/meshlab.desktop
mv usr/bin/meshlabserver .
mv meshlab usr/bin
$INSTALL_PATH/resources/linuxdeployqt usr/share/applications/meshlab.desktop -appimage
mv *.AppImage ../MeshLab$VERSION-linux.AppImage
cp $INSTALL_PATH/resources/meshlab_server.desktop usr/share/applications/
mv meshlabserver usr/bin/
rm -r lib
#at this point, distrib folder contains all the files necessary to execute meshlab
echo MeshLab$VERSION-linux.AppImage generated