1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-15 17:47:09 +00:00
conky/appimage/build.sh

58 lines
1.5 KiB
Bash
Raw Normal View History

2019-01-09 00:34:46 +00:00
#!/bin/bash
set -e
set -x
# building in temporary directory to keep system clean
# use RAM disk if possible (as in: not building on CI system like Travis, and RAM disk is available)
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
TEMP_BASE=/dev/shm
else
TEMP_BASE=/tmp
fi
BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" AppImageLauncher-build-XXXXXX)
# make sure to clean up build dir, even if errors occur
cleanup () {
if [ -d "$BUILD_DIR" ]; then
rm -rf "$BUILD_DIR"
fi
}
trap cleanup EXIT
2019-01-09 00:34:46 +00:00
# store repo root as variable
REPO_ROOT=$(readlink -f $(dirname $(dirname $0)))
OLD_CWD=$(readlink -f .)
# switch to build dir
pushd "$BUILD_DIR"
# configure build files with cmake
# we need to explicitly set the install prefix, as CMake's default is /usr/local for some reason...
2019-02-23 01:55:45 +00:00
cmake -DRELEASE=ON -DCMAKE_INSTALL_PREFIX=/usr "$REPO_ROOT"
2019-01-09 00:34:46 +00:00
# build project and install files into AppDir
make -j4
make install DESTDIR=AppDir
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
# make them executable
chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage \
--appdir AppDir \
-e AppDir/usr/bin/conky \
-i AppDir/usr/share/icons/hicolor/scalable/apps/conky-logomark-violet.svg \
-d AppDir/usr/share/applications/conky.desktop \
--output appimage
2019-02-23 00:24:30 +00:00
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
2019-02-23 00:39:21 +00:00
chmod +x appimagetool-x86_64.AppImage
2019-02-23 00:24:30 +00:00
2019-02-23 00:39:21 +00:00
./appimagetool-x86_64.AppImage conky*.AppImage --sign
2019-02-23 00:24:30 +00:00
2019-01-09 00:34:46 +00:00
mv conky*.AppImage "$OLD_CWD"