diff --git a/appimage/AppRun b/appimage/AppRun new file mode 100755 index 00000000..9e0271c1 --- /dev/null +++ b/appimage/AppRun @@ -0,0 +1,12 @@ +#!/bin/sh + +export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}" +export PATH="${APPDIR}/usr/bin:${PATH}" +export XDG_DATA_DIRS="${APPDIR}/usr/share:${XDG_DATA_DIRS}" + +export GSETTINGS_SCHEMA_DIR="${APPDIR}/usr/share/glib-2.0/schemas/:${GSETTINGS_SCHEMA_DIR}" +export GTK_PATH="${APPDIR}/usr/lib/gtk-3.0" +export GTK_DATA_PREFIX="${APPDIR}/usr/" +#export GTK_THEME="Adwaita" + +"${APPDIR}/usr/bin/com.github.tkashkin.gamehub" "$@" diff --git a/appimage/build.sh b/appimage/build.sh new file mode 100755 index 00000000..c24a56fb --- /dev/null +++ b/appimage/build.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +_ROOT="`pwd`" +_SCRIPTROOT="$(dirname "$(readlink -f "$0")")" +_LINUXDEPLOYQT="linuxdeployqt-continuous-x86_64.AppImage" + +BUILDROOT="$_ROOT/build/appimage" +BUILDDIR="$BUILDROOT/build" +APPDIR="$BUILDROOT/appdir" + +ACTION=${1:-build_local} + +deps() +{ + sudo add-apt-repository ppa:elementary-os/stable -y + sudo add-apt-repository ppa:elementary-os/os-patches -y + sudo add-apt-repository ppa:elementary-os/daily -y + sudo apt update -qq + sudo apt install -y meson valac checkinstall build-essential elementary-sdk libgranite-dev libgtk-3-dev libglib2.0-dev libwebkit2gtk-4.0-dev libjson-glib-dev libgee-0.8-dev libsoup2.4-dev libsqlite3-dev libxml2-dev + sudo apt full-upgrade -y +} + +build() +{ + cd "$_ROOT" + mkdir -p "$BUILDROOT" + meson "$BUILDDIR" --prefix=/usr --buildtype=debugoptimized -Ddistro=generic -Dappimage=true + cd "$BUILDDIR" + ninja + DESTDIR="$APPDIR" ninja install + cd "$_ROOT" +} + +appimage() +{ + cd "$BUILDROOT" + wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/$_LINUXDEPLOYQT" + chmod a+x linuxdeployqt-continuous-x86_64.AppImage + unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH + export VERSION=$(git rev-parse --short HEAD) + export LD_LIBRARY_PATH=$APPDIR/usr/lib:$LD_LIBRARY_PATH + "./$_LINUXDEPLOYQT" "$APPDIR/usr/share/applications/com.github.tkashkin.gamehub.desktop" -appimage -bundle-non-qt-libs -verbose=2 + rm -f "$APPDIR/AppRun" + cp -f "$_SCRIPTROOT/AppRun" "$APPDIR/AppRun" + glib-compile-schemas "$APPDIR/usr/share/glib-2.0/schemas" + "./$_LINUXDEPLOYQT" --appimage-extract + PATH=./squashfs-root/usr/bin:$PATH ./squashfs-root/usr/bin/appimagetool "$APPDIR" +} + +upload() +{ + cd "$BUILDROOT" + wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + bash upload.sh GameHub*.AppImage* +} + +if [[ "$ACTION" = "deps" ]]; then deps; fi +if [[ "$ACTION" = "build" || "$ACTION" = "build_local" ]]; then build; fi +if [[ "$ACTION" = "appimage" || "$ACTION" = "build_local" ]]; then appimage; fi +if [[ "$ACTION" = "upload" ]]; then upload; fi diff --git a/appimage/meson.build b/appimage/meson.build new file mode 100644 index 00000000..e69de29b diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..a1a5e898 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,25 @@ +branches: + except: + - flatpak + +image: + - Ubuntu1804 + +clone_folder: ~/GameHub + +build_script: + - sh: dpkg-buildpackage -b -us -uc + - sh: bash appimage/build.sh build && bash appimage/build.sh appimage + +install: + - sh: bash appimage/build.sh deps + +test: off + +artifacts: + - path: ~/com.github.tkashkin.gamehub*.deb + name: deb + - path: ~/com.github.tkashkin.gamehub*.ddeb + name: deb-dbgsym + - path: build/appimage/GameHub*.AppImage* + name: AppImage diff --git a/data/com.github.tkashkin.gamehub.appdata.xml.in b/data/com.github.tkashkin.gamehub.appdata.xml.in index 62c1a141..7cc4010c 100644 --- a/data/com.github.tkashkin.gamehub.appdata.xml.in +++ b/data/com.github.tkashkin.gamehub.appdata.xml.in @@ -41,6 +41,15 @@ + + +
    +
  • Humble Trove support
  • +
  • Additional compat tools (CustomScript, DOSBox)
  • +
  • AppImage version
  • +
+
+

Compatibility tools support for non-native games:

diff --git a/data/meson.build b/data/meson.build index a9fb51d8..76bedc9f 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,6 +1,6 @@ install_data( meson.project_name() + '.svg', - install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps') + install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps') ) install_data( diff --git a/debian/changelog b/debian/changelog index efc0fb1a..4c4b5703 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +com.github.tkashkin.gamehub (0.11.0) xenial; urgency=low + + * Humble Trove support + * Additional compat tools (CustomScript, DOSBox) + * AppImage version + + -- tkashkin Tue, 18 Sep 2018 09:18:25 +0300 + com.github.tkashkin.gamehub (0.10.0) xenial; urgency=low * Compatibility tools support for non-native games: diff --git a/meson.build b/meson.build index 0dbff144..bd05fde8 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,14 @@ -project('com.github.tkashkin.gamehub', 'vala', 'c', version: '0.10.0') +project('com.github.tkashkin.gamehub', 'vala', 'c', version: '0.11.0') i18n = import('i18n') gnome = import('gnome') add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), language: 'c') -if get_option('flatpak') +if get_option('appimage') + add_global_arguments('-D', 'APPIMAGE', language: 'vala') + subdir('appimage') +elif get_option('flatpak') add_global_arguments('-D', 'FLATPAK', language: 'vala') elif get_option('snap') add_global_arguments('-D', 'SNAP', language: 'vala') diff --git a/meson_options.txt b/meson_options.txt index 64f817cc..49042092 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,6 @@ option('distro', type: 'combo', choices: ['generic', 'debian', 'arch'], value: 'generic') +option('appimage', type: 'boolean', value: false) option('flatpak', type: 'boolean', value: false) option('snap', type: 'boolean', value: false) diff --git a/src/utils/Utils.vala b/src/utils/Utils.vala index 7e1404de..a3472ec8 100644 --- a/src/utils/Utils.vala +++ b/src/utils/Utils.vala @@ -130,8 +130,12 @@ namespace GameHub.Utils public static string get_distro() { - #if FLATPAK + #if APPIMAGE + return "appimage"; + #elif FLATPAK return "flatpak"; + #elif SNAP + return "snap"; #else return Utils.run({"bash", "-c", "lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | head -n1 || uname -om"}); #endif @@ -144,7 +148,7 @@ namespace GameHub.Utils public static bool is_package_installed(string package) { - #if FLATPAK || SNAP + #if APPIMAGE || FLATPAK || SNAP return false; #elif PM_APT var output = Utils.run({"dpkg-query", "-W", "-f=${Status}", package});