From 22fffb9cb3c32676fffe6a162f846b8a62d83d0c Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sat, 2 Sep 2017 23:30:56 +0200 Subject: [PATCH] Add liferea and all dependencies --- astronaut/astrohelp | 88 ++++++++++--------- astronaut/astronautpkg | 6 +- astronaut/pacman-astronaut | 2 +- astronaut/xbps-astronaut | 2 +- .../liferea-1.12-rc3-dont-hide-window.patch | 22 +++++ satellites/functions/compile/cmake.sh | 19 +++- satellites/functions/compile/configure.sh | 2 +- satellites/functions/compile/meson.sh | 38 ++++++++ satellites/functions/compile/perl.sh | 2 +- satellites/functions/compile/waf.sh | 2 +- satellites/functions/misc/debian.sh | 2 +- satellites/functions/vcs/git.sh | 6 +- satellites/functions/vcs/svn.sh | 2 +- satellites/json-glib.sat | 15 ++++ satellites/libpeas.sat | 15 ++++ satellites/libwebp.sat | 18 ++++ satellites/liferea.sat | 19 ++++ satellites/meson.sat | 18 ++++ satellites/python3-cairo.sat | 18 ++++ satellites/python3-gobject.sat | 15 ++++ satellites/webkit2gtk.sat | 41 +++++++++ 21 files changed, 295 insertions(+), 57 deletions(-) create mode 100644 satellites/extrafiles/liferea/liferea-1.12-rc3-dont-hide-window.patch create mode 100644 satellites/functions/compile/meson.sh create mode 100644 satellites/json-glib.sat create mode 100644 satellites/libpeas.sat create mode 100644 satellites/libwebp.sat create mode 100644 satellites/liferea.sat create mode 100644 satellites/meson.sat create mode 100644 satellites/python3-cairo.sat create mode 100644 satellites/python3-gobject.sat create mode 100644 satellites/webkit2gtk.sat diff --git a/astronaut/astrohelp b/astronaut/astrohelp index 3726c6a..dd1eb16 100755 --- a/astronaut/astrohelp +++ b/astronaut/astrohelp @@ -1,5 +1,5 @@ #!/bin/sh -set -e +set -eu # Helper functions for programs that work with satellite files. @@ -36,44 +36,52 @@ global="$(printf ' expr() { "%s" "$@"; } ' "$(basename "$satellite" .sat)" "$(dirname "$satellite")" "$(command -v cut)" "$(command -v expr)")" -if [ "$function" = "variable" ]; then - name="$3" - if [ ! "$name" ]; then +case "$function" in + variable) + if [ "$#" -lt 3 ]; then + show_help + exit 1 + fi + name="$3" + + printf "$global"' + _() { + variable="$%s" + [ "$variable" ] && echo "$variable" + exit $? + } + . %s + ' "$name" "$satellite" | PATH= /bin/sh 2> /dev/null + ;; + + downloads) + printf "$global"' + download() { + [ "$1" ] && echo "$1" + } + dlextract() { + [ "$1" ] && echo "$1" + } + dlfile() { + [ "$1" ] && echo "$1" + } + _() { exit 0; } + . %s + ' "$satellite" | PATH= /bin/sh 2> /dev/null + ;; + + options) + printf "$global"' + define_option() { + [ "$1" ] && echo "$1" + } + _() { exit 0; } + . %s + ' "$satellite" | PATH= /bin/sh 2> /dev/null + ;; + + *) show_help exit 1 - fi - - printf "$global"' - _() { - variable="$%s" - [ "$variable" ] && echo "$variable" - exit $? - } - . %s - ' "$name" "$satellite" | PATH= /bin/sh 2> /dev/null -elif [ "$function" = "downloads" ]; then - printf "$global"' - download() { - [ "$1" ] && echo "$1" - } - dlextract() { - [ "$1" ] && echo "$1" - } - dlfile() { - [ "$1" ] && echo "$1" - } - _() { exit 0; } - . %s - ' "$satellite" | PATH= /bin/sh 2> /dev/null -elif [ "$function" = "options" ]; then - printf "$global"' - define_option() { - [ "$1" ] && echo "$1" - } - _() { exit 0; } - . %s - ' "$satellite" | PATH= /bin/sh 2> /dev/null -else - show_help - exit 1 -fi + ;; +esac diff --git a/astronaut/astronautpkg b/astronaut/astronautpkg index 0403826..7c8baaa 100755 --- a/astronaut/astronautpkg +++ b/astronaut/astronautpkg @@ -1,5 +1,5 @@ #!/bin/sh -set -e +set -eu # A hacky script to generate .t?z files using satellites. # It's a fairly simple wrapper to astronaut, that generates pkgtools packages. @@ -131,8 +131,8 @@ EOF mkdir -p "$dir_install/install" cat >> "$dir_install/install/doinst.sh" << EOF if [ -e $dir_prefix/$dir_data/glib-2.0/schemas ]; then - if [ -x /$dir_prefix/$dir_data/glib-compile-schemas ]; then - /$dir_prefix/$dir_data/glib-compile-schemas $dir_prefix/$dir_data/glib-2.0/schemas >/dev/null 2>&1 + if [ -x /$dir_prefix/$dir_bin/glib-compile-schemas ]; then + /$dir_prefix/$dir_bin/glib-compile-schemas $dir_prefix/$dir_data/glib-2.0/schemas >/dev/null 2>&1 fi fi diff --git a/astronaut/pacman-astronaut b/astronaut/pacman-astronaut index a810401..0c48fab 100755 --- a/astronaut/pacman-astronaut +++ b/astronaut/pacman-astronaut @@ -1,5 +1,5 @@ #!/bin/sh -set -e +set -eu # A hacky script to generate .pkg.tar.?z files using satellites. # It's a fairly simple wrapper to astronaut, that generates pacman packages. diff --git a/astronaut/xbps-astronaut b/astronaut/xbps-astronaut index f945ec4..4011d59 100755 --- a/astronaut/xbps-astronaut +++ b/astronaut/xbps-astronaut @@ -1,5 +1,5 @@ #!/bin/sh -set -e +set -eu # A hacky script to generate .xbps files using satellites. # It's a fairly simple wrapper to astronaut, that generates xbps packages. diff --git a/satellites/extrafiles/liferea/liferea-1.12-rc3-dont-hide-window.patch b/satellites/extrafiles/liferea/liferea-1.12-rc3-dont-hide-window.patch new file mode 100644 index 0000000..df919f6 --- /dev/null +++ b/satellites/extrafiles/liferea/liferea-1.12-rc3-dont-hide-window.patch @@ -0,0 +1,22 @@ ++++ plugins/trayicon.py +@@ -110,8 +110,6 @@ + self.window = self.shell.get_window() + self.minimize_to_tray_delete_handler = self.window.connect("delete_event", + self.trayicon_minimize_on_close) +- self.minimize_to_tray_minimize_handler = self.window.connect("window-state-event", +- self.window_state_event_cb) + + # show the window if it is hidden when starting liferea + self.window.deiconify() +@@ -123,11 +121,6 @@ + self.feedlist_new_items_cb_id = sigid + self.feedlist = feedlist + +- def window_state_event_cb(self, widget, event): +- "Hide window when minimize" +- if event.changed_mask & event.new_window_state & Gdk.WindowState.ICONIFIED: +- self.window.hide() +- + def trayicon_click(self, widget, data = None): + self.window.deiconify() + self.window.show() diff --git a/satellites/functions/compile/cmake.sh b/satellites/functions/compile/cmake.sh index 4cef946..3a7318b 100644 --- a/satellites/functions/compile/cmake.sh +++ b/satellites/functions/compile/cmake.sh @@ -10,10 +10,20 @@ compile_cmake() { I) local noinstall=true ;; esac; done shift $(expr $OPTIND - 1) - [ "$1" = '--' ] && shift || true + [ "$#" -ge 1 ] && [ "$1" = '--' ] && shift || true + + local generator='Unix Makefiles' + if command -v ninja 2> /dev/null; then + local generator='Ninja' + fi + + case "$generator" in + 'Unix Makefiles') local make='make' ;; + 'Ninja') local make="ninja $NINJAFLAGS" ;; + esac mkdir -p "$builddir"; cd "$builddir" - cmake "$olddir" \ + cmake "$olddir" -G "$generator" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="/$dir_prefix" \ -DCMAKE_INSTALL_FULL_SYSCONFDIR="/$dir_prefix/$dir_sysconf" \ @@ -28,10 +38,11 @@ compile_cmake() { -DCMAKE_INSTALL_FULL_INFODIR="/$dir_prefix/$dir_info" \ -DCMAKE_INSTALL_FULL_LOCALEDIR="/$dir_prefix/$dir_locale" \ "$@" - make + + $make if [ "$noinstall" = false ]; then - make DESTDIR="$dir_install" install + DESTDIR="$dir_install" $make install fi cd "$olddir" diff --git a/satellites/functions/compile/configure.sh b/satellites/functions/compile/configure.sh index adb6aaf..0a65a50 100644 --- a/satellites/functions/compile/configure.sh +++ b/satellites/functions/compile/configure.sh @@ -17,7 +17,7 @@ compile_configure() { I) local noinstall=true ;; esac; done shift $(expr $OPTIND - 1) - [ "$1" = '--' ] && shift || true + [ "$#" -ge 1 ] && [ "$1" = '--' ] && shift || true if [ "$builddir" ]; then mkdir -p "$builddir" diff --git a/satellites/functions/compile/meson.sh b/satellites/functions/compile/meson.sh new file mode 100644 index 0000000..7e9a9e0 --- /dev/null +++ b/satellites/functions/compile/meson.sh @@ -0,0 +1,38 @@ +compile_meson() { + local olddir="$PWD" + local builddir='build' + local noinstall=false + + local OPTIND=1 + local opt + while getopts 'b:I' opt; do case "$opt" in + b) local builddir="$OPTARG" ;; + I) local noinstall=true ;; + esac; done + shift $(expr $OPTIND - 1) + [ "$#" -ge 1 ] && [ "$1" = '--' ] && shift || true + + mkdir -p "$builddir"; cd "$builddir" + meson "$olddir" \ + --buildtype=release \ + --prefix="/$dir_prefix" \ + --libdir="/$dir_prefix/$dir_lib" \ + --libexecdir="/$dir_prefix/$dir_libexec" \ + --bindir="/$dir_prefix/$dir_bin" \ + --sbindir="/$dir_prefix/$dir_sbin" \ + --includedir="/$dir_prefix/$dir_include" \ + --datadir="/$dir_prefix/$dir_data" \ + --mandir="/$dir_prefix/$dir_man" \ + --infodir="/$dir_prefix/$dir_info" \ + --localedir="/$dir_prefix/$dir_locale" \ + --sysconfdir="/$dir_prefix/$dir_sysconf" \ + "$@" + + ninja $NINJAFLAGS + + if [ "$noinstall" = false ]; then + DESTDIR="$dir_install" ninja $NINJAFLAGS install + fi + + cd "$olddir" +} diff --git a/satellites/functions/compile/perl.sh b/satellites/functions/compile/perl.sh index e0eb269..87cb5e3 100644 --- a/satellites/functions/compile/perl.sh +++ b/satellites/functions/compile/perl.sh @@ -7,7 +7,7 @@ compile_perl() { I) local noinstall=true ;; esac; done shift $(expr $OPTIND - 1) - [ "$1" = '--' ] && shift || true + [ "$#" -ge 1 ] && [ "$1" = '--' ] && shift || true perl Build.PL --create_packlist=0 \ --prefix="/$dir_prefix" \ diff --git a/satellites/functions/compile/waf.sh b/satellites/functions/compile/waf.sh index 2fa0f8f..df07278 100644 --- a/satellites/functions/compile/waf.sh +++ b/satellites/functions/compile/waf.sh @@ -7,7 +7,7 @@ compile_waf() { b) local binary="$OPTARG" ;; esac; done shift $(expr $OPTIND - 1) - [ "$1" = '--' ] && shift || true + [ "$#" -ge 1 ] && [ "$1" = '--' ] && shift || true $binary configure build install \ --prefix="/$dir_prefix" \ diff --git a/satellites/functions/misc/debian.sh b/satellites/functions/misc/debian.sh index 524995d..f1d4bdf 100644 --- a/satellites/functions/misc/debian.sh +++ b/satellites/functions/misc/debian.sh @@ -17,7 +17,7 @@ misc_debian_download() { V) local updver=false ;; esac; done shift $(expr $OPTIND - 1) - [ "$1" = '--' ] && shift || true + [ "$#" -ge 1 ] && [ "$1" = '--' ] && shift || true # Get the short name case "$deb_name" in diff --git a/satellites/functions/vcs/git.sh b/satellites/functions/vcs/git.sh index 566726c..5318939 100644 --- a/satellites/functions/vcs/git.sh +++ b/satellites/functions/vcs/git.sh @@ -11,7 +11,7 @@ vcs_git() { C) local clone=false ;; esac; done shift $(expr $OPTIND - 1) - [ "$1" = '--' ] && shift || true + [ "$#" -ge 1 ] && [ "$1" = '--' ] && shift || true local reponame="$(basename "$1")" local dir="$dir_source/$name/$reponame" @@ -60,11 +60,11 @@ vcs_git_clone() { r) local rev="$OPTARG" ;; esac; done shift $(expr $OPTIND - 1) - [ "$1" = '--' ] && shift || true + [ "$#" -ge 1 ] && [ "$1" = '--' ] && shift || true local reponame="$(basename "$1")" local dir="$dir_source/$name/$reponame" - [ "$2" ] && local dest="$2" || local dest="$reponame" + [ "$#" -ge 2 ] && local dest="$2" || local dest="$reponame" mkdir -p "$dest" git clone "$dir" "$dest" 2> /dev/null diff --git a/satellites/functions/vcs/svn.sh b/satellites/functions/vcs/svn.sh index b442581..c8e2ae1 100644 --- a/satellites/functions/vcs/svn.sh +++ b/satellites/functions/vcs/svn.sh @@ -9,7 +9,7 @@ vcs_svn() { r) local revision="-r $OPTARG" ;; esac; done shift $(expr $OPTIND - 1) - [ "$1" = '--' ] && shift || true + [ "$#" -ge 1 ] && [ "$1" = '--' ] && shift || true local reponame="$(basename "$1")" local dir="$dir_source/$name/$reponame" diff --git a/satellites/json-glib.sat b/satellites/json-glib.sat new file mode 100644 index 0000000..1cd447f --- /dev/null +++ b/satellites/json-glib.sat @@ -0,0 +1,15 @@ +import 'compile/meson' + +name=json-glib +majver=1.3 +version=$majver.2 +update_url="https://download.gnome.org/sources/$name/cache.json" + +dlextract "https://download.gnome.org/sources/$name/$majver/$name-$version.tar.xz" \ + 'ff8469fe2f6243dc7e7ffd17a3641618' +_ + +cd "$name-$version" +compile_meson + +# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/libpeas.sat b/satellites/libpeas.sat new file mode 100644 index 0000000..6876782 --- /dev/null +++ b/satellites/libpeas.sat @@ -0,0 +1,15 @@ +import 'compile/configure' + +name=libpeas +majver=1.21 +version=$majver.0 +update_url="https://download.gnome.org/sources/$name/cache.json" + +dlextract "https://download.gnome.org/sources/$name/$majver/$name-$version.tar.xz" \ + '2ee1b1507bd0a9da864970ab3f977f33' +_ + +cd "$name-$version" +compile_configure + +# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/libwebp.sat b/satellites/libwebp.sat new file mode 100644 index 0000000..77e5026 --- /dev/null +++ b/satellites/libwebp.sat @@ -0,0 +1,18 @@ +import 'compile/configure' + +name=libwebp +version=0.6.0 +update_url='https://developers.google.com/speed/webp/download' + +dlextract "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/$name-$version.tar.gz" \ + '19a6e926ab1721268df03161b84bb4a0' +_ + +cd "$name-$version" +compile_configure -- --disable-static \ + --enable-libwebpmux \ + --enable-libwebpdemux \ + --enable-libwebpdecoder \ + --enable-libwebpextras + +# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/liferea.sat b/satellites/liferea.sat new file mode 100644 index 0000000..4463fc6 --- /dev/null +++ b/satellites/liferea.sat @@ -0,0 +1,19 @@ +import 'compile/configure' + +name=liferea +version=1.12-rc3 +update_url="https://github.com/lwindolf/$name/releases" + +define_option '!patch: Apply some custom patches' + +dlextract "https://github.com/lwindolf/$name/releases/download/v$version/$name-$version.tar.bz2" \ + '7a42afc775ac7b78ea324730052f649a' +option patch extrafile "$name-$version-dont-hide-window.patch" +_ + +cd "$name-$version" +option patch patch -p0 -i "../$name-$version-dont-hide-window.patch" + +compile_configure -- --disable-schemas-compile + +# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/meson.sat b/satellites/meson.sat new file mode 100644 index 0000000..c5a25f7 --- /dev/null +++ b/satellites/meson.sat @@ -0,0 +1,18 @@ +import 'compile/python' + +name=meson +version=0.42.0 +update_url="https://github.com/mesonbuild/$name/releases" + +dlextract "https://github.com/mesonbuild/$name/releases/download/$version/$name-$version.tar.gz" \ + 'b2518db2c56348f17a65d5edb04e0c60' +_ + +cd "$name-$version" + +# Fix paths +sed -i -e "/data_files=\[(/s/share\/man/$(safe_sed "$dir_man")/" setup.py + +compile_python 3 + +# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/python3-cairo.sat b/satellites/python3-cairo.sat new file mode 100644 index 0000000..f212d46 --- /dev/null +++ b/satellites/python3-cairo.sat @@ -0,0 +1,18 @@ +import 'compile/python' + +name=pycairo +version=1.15.1 +update_url="https://github.com/pygobject/$name/releases" + +dlextract "https://github.com/pygobject/$name/releases/download/v$version/$name-$version.tar.gz" \ + '29620ad9b0fa4a7052760e4fa4b71b4c' +_ + +cd "$name-$version" + +# Fix paths +sed -i -e "/libdir =/s/\"lib\"/\"$(safe_sed "$dir_lib")\"/" setup.py + +compile_python 3 + +# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/python3-gobject.sat b/satellites/python3-gobject.sat new file mode 100644 index 0000000..403a23f --- /dev/null +++ b/satellites/python3-gobject.sat @@ -0,0 +1,15 @@ +import 'compile/configure' + +name=pygobject +majver=3.25 +version=$majver.1 +update_url="https://download.gnome.org/sources/$name/cache.json" + +dlextract "https://download.gnome.org/sources/$name/$majver/$name-$version.tar.xz" \ + '493319f2a9f5931aee82429b02aba375' +_ + +cd "$name-$version" +compile_configure -- --without-common + +# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/webkit2gtk.sat b/satellites/webkit2gtk.sat new file mode 100644 index 0000000..30342ff --- /dev/null +++ b/satellites/webkit2gtk.sat @@ -0,0 +1,41 @@ +import 'compile/cmake' + +name=webkitgtk +version=2.16.6 +update_url='https://webkitgtk.org/' + +dlextract "https://webkitgtk.org/releases/$name-$version.tar.xz" \ + '0e2d142a586e4ff79cf0324f4fdbf20c' +_ + +cd "$name-$version" + +# This is configured to not to be used for a full-fledged web browser, +# but rather simple things such as a feed reader. +# As such, I've just went and disabled everything that is shown after configure +# except for a few performance-related options. +compile_cmake -- -DPORT=GTK \ + -DENABLE_ACCELERATED_2D_CANVAS=OFF \ + -DENABLE_DRAG_SUPPORT=OFF \ + -DENABLE_GEOLOCATION=OFF \ + -DENABLE_GLES2=OFF \ + -DENABLE_GTKDOC=OFF \ + -DENABLE_ICONDATABASE=OFF \ + -DENABLE_INTROSPECTION=OFF \ + -DENABLE_JIT=ON \ + -DENABLE_MEMORY_SAMPLER=OFF \ + -DENABLE_MINIBROWSER=OFF \ + -DENABLE_OPENGL=OFF \ + -DENABLE_PLUGIN_PROCESS_GTK2=OFF \ + -DENABLE_QUARTZ_TARGET=OFF \ + -DENABLE_SAMPLING_PROFILER=OFF \ + -DENABLE_SPELLCHECK=OFF \ + -DENABLE_TOUCH_EVENTS=OFF \ + -DENABLE_VIDEO=OFF \ + -DENABLE_WEB_AUDIO=OFF \ + -DUSE_LIBHYPHEN=OFF \ + -DUSE_LIBNOTIFY=OFF \ + -DUSE_LIBSECRET=OFF \ + -DUSE_SYSTEM_MALLOC=ON + +# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:Tools/Scripts/update-webkitgtk-libs