blob: 24d306612252e865c6e956f4f11ecdb65f09f3b2 (
plain)
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
export ROOT=`pwd`
export NCORES=`sysctl -n hw.ncpu`
while getopts ":ih" opt; do
case ${opt} in
i )
export BUILD_IMAGE="1"
;;
h ) echo "Usage: ./BuildLinuxImage.sh [-i]"
echo " -i: Generate Appimage (optional)"
exit 0
;;
esac
done
echo -n "[9/9] Generating Linux app..."
{
# create directory and copy into it
if [ -d "package" ]
then
rm -rf package/*
fi
mkdir package
mkdir package/bin
# copy Resources
cp -Rf ../resources package/resources
cp -f src/@SLIC3R_APP_CMD@ package/bin/@SLIC3R_APP_CMD@
# create bin
echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/@SLIC3R_APP_CMD@" "$@"' >@SLIC3R_APP_CMD@
chmod u+x @SLIC3R_APP_CMD@
tar -cvf ../@SLIC3R_APP_KEY@.tar .
} &> $ROOT/Build.log # Capture all command output
echo "done"
if [[ -n "$BUILD_IMAGE" ]]
then
echo -n "Creating Appimage for distribution..."
{
chmod +x ../build_appimage.sh
../build_appimage.sh
} &> $ROOT/Build.log # Capture all command output
echo "done"
fi
|