4 # This script installs the required build-time dependencies
5 # and builds AppImages for AppImageKit
18 '--use-shared-libs' |
'-s' )
21 '--run-tests' |
'-t' )
27 rm -rf squashfuse
/* squashfuse
/.git
28 rm -rf squashfs-tools
/* squashfs-tools
/.git
32 echo 'Usage: ./build.sh [OPTIONS]'
35 echo ' -h, --help: Show this help screen'
36 echo ' -d, --debug: Build with debug info.'
37 echo ' -n, --no-dependencies: Do not try to install distro specific build dependencies.'
38 echo ' -s, --use-shared-libs: Use distro provided shared versions of inotify-tools and openssl.'
39 echo ' -c, --clean: Clean all artifacts generated by the build.'
48 if cat /etc
/*release |
grep "CentOS" 2>&1 >/dev
/null
; then
49 if [ -e /opt
/rh
/devtoolset-
4/enable ]; then
50 .
/opt
/rh
/devtoolset-
4/enable
59 HERE
="$(dirname "$
(readlink
-f "${0}")")"
62 # Fetch git submodules
63 git submodule update
--init --recursive
65 # Clean up from previous run
66 [ -d build
/ ] && rm -rf build
/
72 # make sure that deps in separate install tree are found
73 export PKG_CONFIG_PATH
=/deps
/lib
/pkgconfig
/
75 cmake ..
-DCMAKE_INSTALL_PREFIX=/usr
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DBUILD_TESTING=ON
-DAPPIMAGEKIT_PACKAGE_DEBS=ON
77 make install DESTDIR
=install_prefix
/
79 if [ -d /deps
/lib
]; then
80 export LD_LIBRARY_PATH
="$LD_LIBRARY_PATH":/deps
/lib
/
85 if [ $RUN_TESTS -ne 0 ]; then
89 xxd src
/runtime |
head -n 1
91 # Do NOT strip runtime
92 find install_prefix
/usr
/bin
/ -not -iname runtime
-print -exec "$STRIP" "{}" \
; 2>/dev
/null
94 ls -lh install_prefix
/usr
/bin
/
95 for FILE
in install_prefix
/usr
/bin
/*; do
100 bash
-ex "$HERE/build-appdir.sh"
105 cp -r install_prefix
/usr
/{bin
,lib
/appimagekit
}/* appdirs
/*.AppDir out
/