Skip to content

Commit

Permalink
Merge pull request #5422 from LyzardKing/master
Browse files Browse the repository at this point in the history
Add jabfox json file to snap package
  • Loading branch information
koppor authored Oct 11, 2019
2 parents 57ea7ac + e6e8c52 commit bd825a6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
9 changes: 9 additions & 0 deletions snap/hooks/connect-plug-browser-extension
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

if [ ! -d /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts ]; then
echo "Missing directory, create it manually then try again:"
echo "sudo mkdir -p /usr/lib/mozilla/native-messaging-hosts"
exit 1
fi

cp $SNAP/lib/org.jabref.jabref.json /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json
7 changes: 7 additions & 0 deletions snap/hooks/disconnect-plug-browser-extension
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

if [ ! -f /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json ]; then
exit 0
elif grep --quiet '"path": "/snap' /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json; then
rm /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json
fi
22 changes: 16 additions & 6 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: jabref
# adopt-info: jabref
version: 'master'
version-script: cat build.gradle | grep "^version =" | cut -d'"' -f2
adopt-info: jabref
icon: snap/gui/jabref.png
license: MIT
summary: Bibliography manager
Expand All @@ -14,6 +12,14 @@ license: MIT
architectures:
- build-on: amd64

plugs:
browser-extension:
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/org.jabref.jabref.json

apps:
jabref:
command: bin/JabRef
Expand All @@ -34,8 +40,12 @@ parts:
jabref:
plugin: dump
source: build/distribution/JabRef-portable_linux.tar.gz
# override-pull: |
# snapcraftctl pull
# snapcraftctl set-version "$(cat app/JabRef.cfg | grep "app.version=" | cut -d'=' -f2)"
# Use this source for debug purposes:
# source: https://builds.jabref.org/master/JabRef-portable_linux.tar.gz
stage-packages:
- x11-utils
override-build: |
snapcraftctl build
snapcraftctl set-version "$(cat $SNAPCRAFT_PART_INSTALL/lib/app/JabRef.cfg | grep "app.version=" | cut -d'=' -f2)"
sed -i 's|/opt/jabref/lib/jabrefHost.py|/snap/jabref/current/lib/jabrefHost.py|g' $SNAPCRAFT_PART_INSTALL/lib/org.jabref.jabref.json

0 comments on commit bd825a6

Please sign in to comment.