Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/bin
/node_modules
/pkg
/pub
/pub
*.swp
*.snap
18 changes: 18 additions & 0 deletions snap/hooks/configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

set -e

# case "$1" in
# configure)
# Recursively create the system-wide manifest directories in case they don't exist.
mkdir -p /var/lib/snapd/hostfs/etc/opt/chrome/native-messaging-hosts
mkdir -p /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts
touch /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts/touchy

# Copy the manifest files.
cp $SNAP/usr/lib/readup/resources/app/content/linux/chrome/it.reallyread.mobile.browser_extension_app.json /var/lib/snapd/hostfs/etc/opt/chrome/native-messaging-hosts/
cp $SNAP/usr/lib/readup/resources/app/content/linux/firefox/it.reallyread.mobile.browser_extension_app.json /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts/
#;;
#esac

exit 0
59 changes: 59 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: readup
version: '1.0.6'
summary: A little description for the app.
description: The world's best reading app.
grade: stable
# confinement: classic
confinement: devmode
base: core18

parts:
readup:
plugin: dump
source: ./pkg/readup_1.0.6_amd64.deb
source-type: deb
stage-packages:
- libasound2
- libnotify4
- libnspr4
- libnss3
- libpcre3
- libpulse0
- libxss1
- libxtst6
override-pull: |
snapcraftctl pull
cd usr/lib/readup/resources/app/content/linux/
# point the native messaging manifests to the readup.browserextension app exposed by this snap
sed -ri 's/\/usr\/lib\/readup\/resources\/app\/content\/linux\/BrowserExtensionApp/\/snap\/bin\/readup.browserextensionapp/' firefox/it.reallyread.mobile.browser_extension_app.json
sed -ri 's/\/usr\/lib\/readup\/resources\/app\/content\/linux\/BrowserExtensionApp/\/snap\/bin\/readup.browserextensionapp/' chrome/it.reallyread.mobile.browser_extension_app.json
# make the browser ext app world-readable and executable (required)
chmod a+rx BrowserExtensionApp
# restore cwd
cd ../../../../../../..
# fix the .desktop icon reference to be relative to the prime dir (https://forum.snapcraft.io/t/desktop-files-for-menu-integration/13115#heading--desktop-key)
sed -ri 's|Icon=readup|Icon=/usr/lib/readup/resources/app/content/images/icon.svg|g' usr/share/applications/readup.desktop

plugs:
native-messaging-integration:
interface: system-files
read:
- /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts
write:
- /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts/touchy
- /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts/it.reallyread.mobile.browser_extension_app.json

hooks:
configure:
plugs: [native-messaging-integration]
apps:
readup:
extensions: [gnome-3-34]
command: "bin/desktop-launch $SNAP/usr/lib/readup/Readup"
desktop: usr/share/applications/readup.desktop
# Correct the TMPDIR path for Chromium Framework/Electron to ensure
# libappindicator has readable resources.
environment:
TMPDIR: $XDG_RUNTIME_DIR
browserextensionapp:
command: usr/lib/readup/resources/app/content/linux/BrowserExtensionApp