Skip to content

Commit

Permalink
Merge pull request tkashkin#79 from tkashkin/appimage
Browse files Browse the repository at this point in the history
0.11.0 release
  • Loading branch information
tkashkin authored Sep 18, 2018
2 parents 6bff75d + 7362f95 commit 3802672
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 5 deletions.
12 changes: 12 additions & 0 deletions appimage/AppRun
Original file line number Diff line number Diff line change
@@ -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" "$@"
60 changes: 60 additions & 0 deletions appimage/build.sh
Original file line number Diff line number Diff line change
@@ -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
Empty file added appimage/meson.build
Empty file.
25 changes: 25 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions data/com.github.tkashkin.gamehub.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@
</screenshots>

<releases>
<release type="development" version="0.11.0" date="2018-09-18">
<description>
<ul>
<li>Humble Trove support</li>
<li>Additional compat tools (CustomScript, DOSBox)</li>
<li>AppImage version</li>
</ul>
</description>
</release>
<release type="development" version="0.10.0" date="2018-09-14">
<description>
<p>Compatibility tools support for non-native games:</p>
Expand Down
2 changes: 1 addition & 1 deletion data/meson.build
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -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 <tkashkin@gmail.com> 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:
Expand Down
7 changes: 5 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
8 changes: 6 additions & 2 deletions src/utils/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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});
Expand Down

0 comments on commit 3802672

Please sign in to comment.