diff options
author | Que Quotion | 2018-03-14 03:00:46 +0900 |
---|---|---|
committer | Que Quotion | 2018-03-14 03:00:46 +0900 |
commit | fe4f7734571331717b4059ce302f7fe5cb6d0087 (patch) | |
tree | dc9906253d05d1f54823695d561f616957d9f117 | |
parent | 7b37f21aabb9a195d48abc2f5774d99a3d87fe07 (diff) | |
download | aur-fe4f7734571331717b4059ce302f7fe5cb6d0087.tar.gz |
Include epiphany-sync: Synchronize browser profile to shared memory for faster loading
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 25 | ||||
-rw-r--r-- | epiphany-sync | 68 | ||||
-rw-r--r-- | epiphany-sync.service | 11 | ||||
-rw-r--r-- | webkit-update.patch | 11 |
5 files changed, 100 insertions, 22 deletions
@@ -1,7 +1,7 @@ pkgbase = epiphany-pantheon-bzr pkgdesc = A GNOME web browser based on the WebKit rendering engine, with Elementary OS patches pkgver = 3.27.90.1ubuntu1.r19 - pkgrel = 1 + pkgrel = 2 url = http://www.gnome.org/projects/epiphany/ arch = i686 arch = x86_64 @@ -22,12 +22,17 @@ pkgbase = epiphany-pantheon-bzr depends = libhttpseverywhere depends = libdazzle provides = epiphany + provides = epiphany-sync conflicts = epiphany replaces = epiphany source = bzr+lp:~elementary-os/elementaryos/os-patch-epiphany-browser-bionic source = pluginsdir.diff + source = epiphany-sync + source = epiphany-sync.service sha256sums = SKIP sha256sums = 3e648118d7d45fc1cce04d45c7443ed0cc54e3a65aefcb4fb12ce5e01014c53e + sha256sums = bb8c06dadcba9c9f0ba887dc0a65283c26282f7db75c22dade209fcaa6f72f72 + sha256sums = ce1ac321d7bf9d88638634a141dfcb99119fc59ee44c4892e0874608e85006ba pkgname = epiphany-pantheon-bzr @@ -6,7 +6,7 @@ pkgname=$_pkgname-pantheon-bzr ephyver=3.27.90-1ubuntu1 ubunturel=bionic pkgver=3.27.90.1ubuntu1.r19 -pkgrel=1 +pkgrel=2 pkgdesc="A GNOME web browser based on the WebKit rendering engine, with Elementary OS patches" url="http://www.gnome.org/projects/epiphany/" arch=('i686' 'x86_64') @@ -16,34 +16,39 @@ makedepends=(meson docbook-xml startup-notification lsb-release gobject-introspection yelp-tools autoconf-archive appstream-glib git) groups=(pantheon-unstable pantheon-qq) replaces=(epiphany) -provides=(epiphany) +provides=(epiphany epiphany-sync) conflicts=(epiphany) -source=("bzr+lp:~elementary-os/elementaryos/os-patch-epiphany-browser-$ubunturel" - "pluginsdir.diff") +source=("bzr+lp:~elementary-os/elementaryos/os-patch-epiphany-browser-${ubunturel}" + "pluginsdir.diff" + epiphany-sync{,.service}) sha256sums=('SKIP' - '3e648118d7d45fc1cce04d45c7443ed0cc54e3a65aefcb4fb12ce5e01014c53e') + '3e648118d7d45fc1cce04d45c7443ed0cc54e3a65aefcb4fb12ce5e01014c53e' + 'bb8c06dadcba9c9f0ba887dc0a65283c26282f7db75c22dade209fcaa6f72f72' + 'ce1ac321d7bf9d88638634a141dfcb99119fc59ee44c4892e0874608e85006ba') pkgver() { - cd "os-patch-epiphany-browser-$ubunturel" + cd "os-patch-epiphany-browser-${ubunturel}" echo "${ephyver/-/.}.r$(bzr revno)" } prepare() { - cd "os-patch-epiphany-browser-$ubunturel" + cd "os-patch-epiphany-browser-${ubunturel}" msg2 "Plugins Directory" #patch -Np1 < ../pluginsdir.diff } build() { - cd "os-patch-epiphany-browser-$ubunturel" + cd "os-patch-epiphany-browser-${ubunturel}" [ -d build ] && rm -rf build - meson build --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib/$_pkgname --buildtype=release -Denable_https_everywhere=true + meson build --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib/"${_pkgname}" --buildtype=release -Denable_https_everywhere=true ninja -C build } package() { cd "os-patch-epiphany-browser-$ubunturel" - DESTDIR=${pkgdir} ninja -C build install + DESTDIR="${pkgdir}" ninja -C build install + install -Dm 644 {"${srcdir}","${pkgdir}"/usr/bin}/epiphany-sync + install -Dm 644 {"${srcdir}","${pkgdir}"/usr/lib/systemd/user}/epiphany-sync.service } diff --git a/epiphany-sync b/epiphany-sync new file mode 100644 index 000000000000..f3e32d83291f --- /dev/null +++ b/epiphany-sync @@ -0,0 +1,68 @@ +#!/bin/bash +STATIC=main +LINK=epiphany +VOLATILE=/dev/shm/$USER/epiphany +PROFDIR=~/.config/ + +usage() +{ + echo "Usage: epiphany-sync [-dh] [-p profile-basename]" +} + +longhelp() +{ + usage + cat <<EOF + +This program syncs your Epiphany profile to a ramdisk (/dev/shm) and back. + +-h prints this help message +-d prints the default profile directory +-p [dir] set the profile basename +-r restores on-disk profile (use only before uninstalling epiphany-sync) +EOF +exit 0 +} + +while getopts dhp: options +do +case $options in + d) echo "default profile directory is "$PROFDIR"$LINK" + exit 0;; + h) longhelp;; + p) LINK="$OPTARG";; + r) mv "$VOLATILE" "$PROFDIR$LINK-copy" + mv "$PROFDIR$LINK"{,-trash} + mv "$PROFDIR$STATIC"{,-trash} + mv "$PROFDIR$LINK"{-copy,} + rm -rf "$PROFDIR"{"$LINK","$STATIC"}-trash;; + ?) usage + exit 0;; + esac +done + +if [ -z "$LINK" ]; then + echo "Profile directory not set. Try the -p option" > /dev/stderr + exit 1 +fi + +[[ -r $VOLATILE ]] || install -dm700 $VOLATILE + +cd "$PROFDIR" + +if [ ! -e "$LINK" ]; then + echo "$PROFDIR$LINK does not exist" > /dev/stderr + exit 1 +fi + +if [[ `readlink $LINK` != $VOLATILE ]]; then + mv $LINK $STATIC + ln -s $VOLATILE $LINK +fi + +if [[ -e $LINK/.unpacked ]]; then + rsync -av --delete --exclude .unpacked ./$LINK/ ./$STATIC/ +else + rsync -av ./$STATIC/ ./$LINK/ + touch $LINK/.unpacked +fi diff --git a/epiphany-sync.service b/epiphany-sync.service new file mode 100644 index 000000000000..6de859c96947 --- /dev/null +++ b/epiphany-sync.service @@ -0,0 +1,11 @@ +[Unit] +Description=Synchronize tmpfs and on-disk Epiphany profiles + +[Service] +Type=idle +RemainAfterExit=true +ExecStart=/usr/bin/epiphany-sync +ExecStop=/usr/bin/epiphany-sync + +[Install] +WantedBy=default.target diff --git a/webkit-update.patch b/webkit-update.patch deleted file mode 100644 index 6f876ad80d24..000000000000 --- a/webkit-update.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/epiphany-3.18.5/embed/web-extension/ephy-web-overview.c 2016-03-15 08:21:57.000000000 +0900 -+++ src/epiphany-3.18.5/embed/web-extension/ephy-web-overview.c.new 2017-05-19 00:22:44.197874032 +0900 -@@ -144,7 +144,7 @@ - item->url = g_strdup (url->url); - - class_list = webkit_dom_element_get_class_list (webkit_dom_node_get_parent_element (WEBKIT_DOM_NODE (item->anchor))); -- if (class_list && webkit_dom_dom_token_list_contains (class_list, "overview-removed", NULL)) -+ if (class_list && webkit_dom_dom_token_list_contains (class_list, "overview-removed")) - webkit_dom_dom_token_list_remove (class_list, "overview-removed", NULL); - - webkit_dom_element_set_attribute (item->anchor, "href", url->url, NULL); |