summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lass2020-09-30 20:01:41 +0200
committerMichael Lass2020-09-30 21:40:03 +0200
commit2a2e9f02ff1fada3eb3991e160c9f0266e68588f (patch)
treefd0040ae500320ff356ad69edf9adb9088dc208a
parentc25948d8507e29ba6f35365e1d106f8ce62bd0de (diff)
downloadaur-2a2e9f02ff1fada3eb3991e160c9f0266e68588f.tar.gz
Fix compatibility with browser extensions
Also, we can remove our custom gradle upgrade since gradle 6.3 is used by default in JabRef 5.1
-rw-r--r--.SRCINFO4
-rw-r--r--0001-Fix-locating-jabref-in-jabrefHost.py.patch35
-rw-r--r--PKGBUILD26
3 files changed, 57 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 23b7b8a6e32f..d432bfea2a33 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = jabref
pkgdesc = Graphical Java application for managing BibTeX and biblatex (.bib) databases
pkgver = 5.1
- pkgrel = 1
+ pkgrel = 2
url = https://www.jabref.org/
arch = any
license = MIT
@@ -13,9 +13,11 @@ pkgbase = jabref
source = jabref-5.1.tar.gz::https://github.com/JabRef/jabref/archive/v5.1.tar.gz
source = jabref.sh
source = jabref.desktop
+ source = 0001-Fix-locating-jabref-in-jabrefHost.py.patch
sha256sums = c98ec9a7b4113945a27f9b49c9176bb6e5fa50c933562866dc0cc39dd18b7402
sha256sums = 0d5ca38d2c4a5c60b0778f36317794d2fb13f20b13d8473f69b41a6caebcb839
sha256sums = e499b4af1fc45223fdafd801a4dd8a1c3c59384c71bc2e6985ab701da97df717
+ sha256sums = 1f01194665bfd91faaaa5a177b408d5af5f9dc3357795af4388eb61d2cad9f7c
pkgname = jabref
diff --git a/0001-Fix-locating-jabref-in-jabrefHost.py.patch b/0001-Fix-locating-jabref-in-jabrefHost.py.patch
new file mode 100644
index 000000000000..7b5ffb56b1b4
--- /dev/null
+++ b/0001-Fix-locating-jabref-in-jabrefHost.py.patch
@@ -0,0 +1,35 @@
+From b672b6c3d959e24364b67d7fca6ae42e2f9a8dbc Mon Sep 17 00:00:00 2001
+From: Michael Lass <bevan@bi-co.net>
+Date: Wed, 30 Sep 2020 20:23:56 +0200
+Subject: [PATCH] Fix locating jabref in jabrefHost.py
+
+shutil.which() returns an str and not a pathlib.Path. Therefore, we need
+to check if which() actually returns something and if so, we should
+convert it to a pathlib.Path such that JABREF_PATH is always of the same
+type.
+---
+ buildres/linux/jabrefHost.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/buildres/linux/jabrefHost.py b/buildres/linux/jabrefHost.py
+index e1343e232..14c341a30 100755
+--- a/buildres/linux/jabrefHost.py
++++ b/buildres/linux/jabrefHost.py
+@@ -19,10 +19,10 @@ script_dir = Path(__file__).resolve().parent.parent
+ JABREF_PATH = script_dir / "bin/JabRef"
+ if not JABREF_PATH.exists():
+ JABREF_PATH = shutil.which("jabref")
+-
+-if not JABREF_PATH.exists():
+- logging.error("Could not determine JABREF_PATH")
+- sys.exit(-1)
++ if not JABREF_PATH:
++ logging.error("Could not determine JABREF_PATH")
++ sys.exit(-1)
++ JABREF_PATH = Path(JABREF_PATH)
+
+ logging_dir = Path.home() / ".mozilla/native-messaging-hosts/"
+ if not logging_dir.exists():
+--
+2.28.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 7e2e33f6caa5..cd29db9a4ba7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@
pkgname=jabref
pkgver=5.1
-pkgrel=1
+pkgrel=2
pkgdesc="Graphical Java application for managing BibTeX and biblatex (.bib) databases"
arch=(any)
url="https://www.jabref.org/"
@@ -18,23 +18,29 @@ makedepends=('java-environment>=13')
options=(!strip !emptydirs)
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/JabRef/jabref/archive/v${pkgver}.tar.gz
jabref.sh
- jabref.desktop)
+ jabref.desktop
+ 0001-Fix-locating-jabref-in-jabrefHost.py.patch)
sha256sums=('c98ec9a7b4113945a27f9b49c9176bb6e5fa50c933562866dc0cc39dd18b7402'
'0d5ca38d2c4a5c60b0778f36317794d2fb13f20b13d8473f69b41a6caebcb839'
- 'e499b4af1fc45223fdafd801a4dd8a1c3c59384c71bc2e6985ab701da97df717')
+ 'e499b4af1fc45223fdafd801a4dd8a1c3c59384c71bc2e6985ab701da97df717'
+ '1f01194665bfd91faaaa5a177b408d5af5f9dc3357795af4388eb61d2cad9f7c')
+
+prepare() {
+ cd ${pkgname}-${pkgver}
+
+ # https://github.com/JabRef/jabref/pull/6963/
+ patch -p1 < "${srcdir}"/0001-Fix-locating-jabref-in-jabrefHost.py.patch
+}
build() {
cd ${pkgname}-${pkgver}
- mkdir -p ${srcdir}/gradle
+ mkdir -p "${srcdir}"/gradle
export GRADLE_USER_HOME=${srcdir}/gradle
export JAVA_HOME=$(archlinux-java-run -a 13 -f jdk -j)
echo "Using JDK from $JAVA_HOME to build JabRef."
- # Use gradle 6.3 for support with JDK 14
- sed -i 's/gradle-6.2.1-bin.zip/gradle-6.3-bin.zip/g' gradle/wrapper/gradle-wrapper.properties
-
./gradlew \
--no-daemon \
-PprojVersion="${pkgver}" \
@@ -51,6 +57,12 @@ package() {
install -Dm644 LICENSE.md "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE.md
install -Dm644 src/main/resources/icons/jabref.svg "${pkgdir}"/usr/share/pixmaps/${pkgname}.svg
+ # script to support browser extensions
+ install -Dm755 buildres/linux/jabrefHost.py "${pkgdir}"/opt/jabref/lib/jabrefHost.py
+
+ # lowercase alias (for convenience and required for browser extensions)
+ ln -sf /usr/bin/JabRef "${pkgdir}"/usr/bin/jabref
+
cd build
cp -r resources "${pkgdir}"/usr/share/java/${pkgname}
tar xf distributions/JabRef-${pkgver}.tar -C "${pkgdir}"/usr/share/java/${pkgname} JabRef-${pkgver}/lib --strip-components=1