-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathappimage_create.sh
More file actions
executable file
·58 lines (46 loc) · 1.54 KB
/
appimage_create.sh
File metadata and controls
executable file
·58 lines (46 loc) · 1.54 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
#!/bin/bash
INSTALL_DIR="$1"
APPDIR_DIR="$2"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR=$( dirname ${SCRIPT_DIR} )
APPIMAGE_DIR="${ROOT_DIR}/appimage"
if [ -z "${LINUXDEPLOY}" ]; then
LINUXDEPLOY="$(realpath ~/bin/linuxdeploy-$(uname -m).AppImage)"
fi
function usage {
echo "Usage: ${0} <install_dir> [<AppDir>]"
}
if [ -z "${INSTALL_DIR}" ]; then
echo "ERROR: The binaries install directory is not provided"
echo
usage
exit 1
fi
if [ ! -x "${LINUXDEPLOY}" ]; then
echo "ERROR: Failed to find \"linuxdeploy\" utility (${LINUXDEPLOY}), use \"LINUXDEPLOY\" environment variable to override default path"
exit 2
fi
if [ -z "${APPDIR_DIR}" ]; then
APPDIR_DIR="$(dirname $(realpath ${INSTALL_DIR}))/AppDir"
fi
set -e
CC_DIR="${APPDIR_DIR}/cc"
rm -rf ${APPDIR_DIR}
mkdir -p ${APPDIR_DIR}/usr/lib
rm -rf ${CC_DIR}
cp -r ${INSTALL_DIR} ${CC_DIR}
cp -r ${APPIMAGE_DIR}/AppRun ${APPDIR_DIR}/
cp -r ${APPIMAGE_DIR}/app_icon.png ${APPDIR_DIR}/app_icon.png.png
rm -rf ${CC_DIR}/include ${CC_DIR}/bin/*.sh ${CC_DIR}/share/doc ${CC_DIR}/lib/*.a ${CC_DIR}/lib/*/cmake
PARAMS=""
for b in ${CC_DIR}/bin/*; do
if [ ! -e ${b} ]; then break; fi
PARAMS="${PARAMS} -e ${CC_DIR}/bin/$(basename $b)"
done
# Add qt plugin of Qt based apps are present
if [ -e ${CC_DIR}/bin/cc_view ]; then
PARAMS="${PARAMS} --plugin qt"
fi
set -x
export LD_LIBRARY_PATH=${CC_DIR}/lib:${LD_LIBRARY_PATH}
${LINUXDEPLOY} --appdir ${APPDIR_DIR} ${PARAMS} -d ${APPIMAGE_DIR}/cc.desktop -i ${APPIMAGE_DIR}/app_icon.png --output appimage