Skip to content

Commit

Permalink
More appimage fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kozec committed Jun 5, 2018
1 parent 04638eb commit 7ad421b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
16 changes: 14 additions & 2 deletions appimage-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function build_dep() {
popd
}


function unpack_dep() {
NAME="$1"
pushd ${BUILD_APPDIR}
Expand All @@ -56,6 +55,15 @@ function unpack_dep() {
popd
}

function unpack_gi() {
NAME="$1"
pushd ${BUILD_APPDIR}
tar --extract --wildcards "usr/lib/girepository-1.0/*" -f /tmp/${NAME}.tar.gz
popd
}

unpack_gi "pango-1.42.1"

set -exu # display commands, no empty vars, terminate on 1st failure

# Download deps
Expand All @@ -68,6 +76,8 @@ download_dep "python-gobject-3.28.1" "https://archive.archlinux.org/packages/p/p
download_dep "gir-1.56.1" "https://archive.archlinux.org/packages/g/gobject-introspection-runtime/gobject-introspection-runtime-1.56.1-1-x86_64.pkg.tar.xz"
download_dep "gtk-3.22.30" "https://archive.archlinux.org/packages/g/gtk3/gtk3-3.22.30-1-x86_64.pkg.tar.xz"
download_dep "glib-2.56.1" "https://archive.archlinux.org/packages/g/glib2/glib2-2.56.1-1-x86_64.pkg.tar.xz"
download_dep "pango-1.42.1" "https://archive.archlinux.org/packages/p/pango/pango-1.42.1-1-x86_64.pkg.tar.xz"
download_dep "gdk-pixbuf-2.36.9" "http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.36/gdk-pixbuf-2.36.9.tar.xz"
download_dep "libxml2-2.9.7" "https://archive.archlinux.org/packages/l/libxml2/libxml2-2.9.7%2B4%2Bg72182550-2-x86_64.pkg.tar.xz"
download_dep "librsvg-2.42.2" "http://ftp.gnome.org/pub/gnome/sources/librsvg/2.42/librsvg-2.42.2.tar.xz"
download_dep "libpng-1.6.9" "https://archive.archlinux.org/packages/l/libpng/libpng-1.6.9-1-x86_64.pkg.tar.xz"
Expand All @@ -90,8 +100,10 @@ unpack_dep "glib-2.56.1"
build_dep "icu-60.2" "--prefix=/usr --disable-dyload --enable-rpath --disable-draft --disable-extras --disable-tools --disable-tests --disable-samples" "cd source"
PYTHON=python2 build_dep "gtk-3.22.30" "--prefix=/usr --disable-rpath --enable-x11-backend --disable-cups --disable-papi --disable-cloudprint --enable-introspection=yes"
build_dep "librsvg-2.42.2" "--prefix=/usr --disable-rpath --disable-static --enable-introspection=yes --disable-tools"
build_dep "libpcre-8.42" "--prefix=/usr --enable-rpath --disable-cpp --disable-static"
build_dep "libpcre-8.42" "--prefix=/usr --disable-rpath --disable-cpp --disable-static"
build_dep "gdk-pixbuf-2.36.9" "--prefix=/usr --disable-rpath --disable-static --enable-introspection=yes --without-libtiff --with-x11 --with-included-loaders=png,jpeg"
unpack_dep "gir-1.56.1"
unpack_gi "pango-1.42.1"
unpack_dep "libxml2-2.9.7"
unpack_dep "libpng-1.6.9"
unpack_dep "libepoxy-1.5.1"
Expand Down
23 changes: 14 additions & 9 deletions scripts/appimage-AppRun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ function run_and_die() {
exit 1
}

# Check dependencies 1st
python2 -c "pass" \
|| dependency_check_failed "Please, install python package using"
python2 -c 'import gi; gi.require_version("Gtk", "3.0"); from gi.repository import Gtk' \
|| dependency_check_failed "Syncthing-GTK requires GTK and gobject-introspection packages.\n Please, install GTK3 and gobject-introspection packages using your package manager"
python2 -c 'import cairo;' \
|| dependency_check_failed "Cairo library is missing.\n Please, install cairo package using your package manager"

# Start
python2 ${APPDIR}/usr/bin/syncthing-gtk $@
if [ "x$1" == "xbash" ] ; then
cd "${APPDIR}"
bash
else
# Check dependencies 1st
python2 -c "pass" \
|| dependency_check_failed "Please, install python package using"
python2 -c 'import gi; gi.require_version("Gtk", "3.0"); from gi.repository import Gtk' \
|| dependency_check_failed "Syncthing-GTK requires GTK and gobject-introspection packages.\n Please, install GTK3 and gobject-introspection packages using your package manager"
python2 -c 'import cairo;' \
|| dependency_check_failed "Cairo library is missing.\n Please, install cairo package using your package manager"

python2 ${APPDIR}/usr/bin/syncthing-gtk $@
fi

0 comments on commit 7ad421b

Please sign in to comment.