-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathBuildLinuxImage.sh.in
More file actions
75 lines (65 loc) · 1.99 KB
/
BuildLinuxImage.sh.in
File metadata and controls
75 lines (65 loc) · 1.99 KB
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
#!/bin/bash
export ROOT=$(echo $ROOT | grep . || pwd)
export NCORES=`nproc --all`
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/*
rm -rf package/.* 2&>/dev/null
else
mkdir package
fi
mkdir package/bin
# copy Resources
cp -Rf ../resources package/resources
#llvm-strip --strip-debug src/@SLIC3R_APP_CMD@
cp -f src/@SLIC3R_APP_CMD@ package/bin/@SLIC3R_APP_CMD@
# remove unneeded po from resources
## find package/resources/localization -name "*.po" -type f -delete ## FIXME: DD - do we need this?
# create bin
cat << EOF >@SLIC3R_APP_CMD@
#!/bin/bash
DIR=\$(readlink -f "\$0" | xargs dirname)
# Support for previously defined LD_LIBRARY_PATH.
EXT_LIB_PATH=""
if [ "x\$LD_LIBRARY_PATH" != "x" ]; then
EXT_LIB_PATH=":\$LD_LIBRARY_PATH"
fi
export LD_LIBRARY_PATH="\$DIR/bin:\$DIR/usr/lib"
# FIXME: CrealityPrint segfault workarounds
# 1) CrealityPrint will segfault on systems where locale info is not as expected (i.e. Holo-ISO arch-based distro)
export LC_ALL=C
exec "\$DIR/bin/@SLIC3R_APP_CMD@" "\$@"
EOF
chmod ug+x @SLIC3R_APP_CMD@
cp -f @SLIC3R_APP_CMD@ package/@SLIC3R_APP_CMD@
pushd package
tar -cvf ../@SLIC3R_APP_KEY@.tar . &>/dev/null
popd
#} &> $ROOT/Build.log # Capture all command output
echo "done"
if [[ -n "$BUILD_IMAGE" ]]
then
echo -n "Creating Appimage for distribution..."
#{
pushd package
chmod +x ../build_appimage.sh
../build_appimage.sh
popd
mv package/"@SLIC3R_APP_NAME@-V@CREALITYPRINT_VERSION@-x86_64-@PROJECT_VERSION_EXTRA@.AppImage" "@SLIC3R_APP_NAME@-V@CREALITYPRINT_VERSION@-x86_64-@PROJECT_VERSION_EXTRA@.AppImage"
#} &> $ROOT/Build.log # Capture all command output
echo "done"
fi