From 14af88ddbdf96ca380fc458962813f669bf42ad3 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Tue, 8 Jan 2019 19:34:46 -0500 Subject: [PATCH] Add AppImage integration. --- .gitignore | 2 +- .travis.yml | 82 ++++++++++-------- CMakeLists.txt | 6 ++ appimage/build.sh | 51 +++++++++++ conky.desktop | 8 ++ ...k-violet.png => conky-logomark-violet.png} | Bin ...k-violet.svg => conky-logomark-violet.svg} | 0 ...g => conky-logotype-horizontal-violet.png} | Bin ...g => conky-logotype-horizontal-violet.svg} | 0 ...png => conky-logotype-vertical-violet.png} | Bin ...svg => conky-logotype-vertical-violet.svg} | 0 11 files changed, 113 insertions(+), 36 deletions(-) create mode 100755 appimage/build.sh create mode 100644 conky.desktop rename logo/{logomark-violet.png => conky-logomark-violet.png} (100%) rename logo/{logomark-violet.svg => conky-logomark-violet.svg} (100%) rename logo/{logotype-horizontal-violet.png => conky-logotype-horizontal-violet.png} (100%) rename logo/{logotype-horizontal-violet.svg => conky-logotype-horizontal-violet.svg} (100%) rename logo/{logotype-vertical-violet.png => conky-logotype-vertical-violet.png} (100%) rename logo/{logotype-vertical-violet.svg => conky-logotype-vertical-violet.svg} (100%) diff --git a/.gitignore b/.gitignore index 125829b6..38ec9db8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ Doxyfile patches/ doc/conky.1 README -build* +build*/ doc/*.html Makefile diff --git a/.travis.yml b/.travis.yml index ecd09662..333f3e7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,9 +44,9 @@ matrix: - libircclient-dev - gawk sonarcloud: - organization: "brndnmtthws-github" + organization: brndnmtthws-github token: - secure: "KikPusy+HXcEVLr0Dqb6mkrefDU5jm7EGQ5fwO4sBG7bRMcnHV3V14s5yB4Ol8btpUC0nkNn/41+f37lkG+oT4y9ZeIH2ZrhsSEHxOgH6DF9ZSVJwtpLrF9siWgfZ0m5c5V7U5rzVYL3jlO1hQfXKCfMNAcwlKcEUrfpk7jVEZc=" + secure: KikPusy+HXcEVLr0Dqb6mkrefDU5jm7EGQ5fwO4sBG7bRMcnHV3V14s5yB4Ol8btpUC0nkNn/41+f37lkG+oT4y9ZeIH2ZrhsSEHxOgH6DF9ZSVJwtpLrF9siWgfZ0m5c5V7U5rzVYL3jlO1hQfXKCfMNAcwlKcEUrfpk7jVEZc= env: - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" - os: linux @@ -95,38 +95,38 @@ matrix: sources: - ubuntu-toolchain-r-test packages: - - g++-8 - - cmake - - docbook2x - - libxdamage-dev - - libx11-dev - - libxft-dev - - libxext-dev - - libglib2.0-dev - - libxml2-dev - - libcurl4-gnutls-dev - - liblua5.3-dev - - libcairo2-dev - - libimlib2-dev - - libxinerama-dev - - libmysqlclient-dev - - libical-dev - - libircclient-dev - - libcairo2-dev - - libmicrohttpd-dev - - ncurses-dev - - librsvg2-dev - - libaudclient-dev - - libxmmsclient-dev - - libpulse-dev - - libcurl4-gnutls-dev - - audacious-dev - - libsystemd-dev - - libxnvctrl-dev - - libircclient-dev - - gawk + - g++-8 + - cmake + - docbook2x + - libxdamage-dev + - libx11-dev + - libxft-dev + - libxext-dev + - libglib2.0-dev + - libxml2-dev + - libcurl4-gnutls-dev + - liblua5.3-dev + - libcairo2-dev + - libimlib2-dev + - libxinerama-dev + - libmysqlclient-dev + - libical-dev + - libircclient-dev + - libcairo2-dev + - libmicrohttpd-dev + - ncurses-dev + - librsvg2-dev + - libaudclient-dev + - libxmmsclient-dev + - libpulse-dev + - libcurl4-gnutls-dev + - audacious-dev + - libsystemd-dev + - libxnvctrl-dev + - libircclient-dev + - gawk env: - - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" + - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" - os: osx osx_image: xcode9.4 - os: osx @@ -221,7 +221,19 @@ script: branches: only: - master -sudo: false +sudo: required cache: - directories: - - "$HOME/.sonar/cache" + - '$HOME/.sonar/cache' +before_deploy: + - './appimage/build.sh' +deploy: + provider: releases + file_glob: true + file: conky*.AppImage + skip_cleanup: true + on: + tags: true + condition: '$CXX = clang++-7' + api_key: + secure: YGmk5e9am7gwH1pKJVwjHPheaLrSxMIIa5iDvnto9KKaj9VDgsynzPFcwfP6my78qMszdpC7IsjpukpKFBpmifAZ7OQcpEDFp1d91kXcTEM9ILgu3j3kl/gr6nIkzqJO9VAwlYO5H3t5xlD6EZa36FGg0Nlvi2cCuNG7mEyVJy0= diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a558cdc..5bf10212 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,12 @@ if(MAINTAINER_MODE) install(FILES ${MAN_FILES} DESTINATION ${MAN_PATH}) endif(MAINTAINER_MODE) +if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + install(FILES conky.desktop DESTINATION share/applications) + install(FILES logo/conky-logomark-violet.svg DESTINATION share/icons/hicolor/scalable/apps) +endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + + if(CHECK_CODE_QUALITY) # Set up clang-tidy set(CLANG_TIDY_BIN_NAME diff --git a/appimage/build.sh b/appimage/build.sh new file mode 100755 index 00000000..6eb8e279 --- /dev/null +++ b/appimage/build.sh @@ -0,0 +1,51 @@ +#!/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 + +# 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... +cmake -DCMAKE_INSTALL_PREFIX=/usr "$REPO_ROOT" + +# 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 + +mv conky*.AppImage "$OLD_CWD" diff --git a/conky.desktop b/conky.desktop new file mode 100644 index 00000000..ca653b93 --- /dev/null +++ b/conky.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=conky +Exec=conky --daemonize --pause=1 +StartupNotify=false +Terminal=false +Icon=conky-logomark-violet +Categories=System;Monitor; diff --git a/logo/logomark-violet.png b/logo/conky-logomark-violet.png similarity index 100% rename from logo/logomark-violet.png rename to logo/conky-logomark-violet.png diff --git a/logo/logomark-violet.svg b/logo/conky-logomark-violet.svg similarity index 100% rename from logo/logomark-violet.svg rename to logo/conky-logomark-violet.svg diff --git a/logo/logotype-horizontal-violet.png b/logo/conky-logotype-horizontal-violet.png similarity index 100% rename from logo/logotype-horizontal-violet.png rename to logo/conky-logotype-horizontal-violet.png diff --git a/logo/logotype-horizontal-violet.svg b/logo/conky-logotype-horizontal-violet.svg similarity index 100% rename from logo/logotype-horizontal-violet.svg rename to logo/conky-logotype-horizontal-violet.svg diff --git a/logo/logotype-vertical-violet.png b/logo/conky-logotype-vertical-violet.png similarity index 100% rename from logo/logotype-vertical-violet.png rename to logo/conky-logotype-vertical-violet.png diff --git a/logo/logotype-vertical-violet.svg b/logo/conky-logotype-vertical-violet.svg similarity index 100% rename from logo/logotype-vertical-violet.svg rename to logo/conky-logotype-vertical-violet.svg