Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capitalize path properly #5883

Closed
wants to merge 1 commit into from

Conversation

joelostblom
Copy link

@joelostblom joelostblom commented Jan 28, 2020

I installed jabref-latest via pacman in Arch and then installed the JabFox extension through Mozilla's addon website. The addon would get stuck on Send to JabRef... and in Firefox in the JabFox preferences, I would see Error: Attempt to postMessage on disconnected port.

I had to make the change indicated in this PR and set executable bit of /opt/JabRef/lib/jabrefHost.py manually (I noticed this is already the case in this repo, but it was not in the file installed on my system).

Related to JabRef/JabRef-Browser-Extension#127, JabRef/JabRef-Browser-Extension#110, and JabRef/JabRef-Browser-Extension#75.

@tobiasdiez
Copy link
Member

Thanks for your PR!

As noted by @LyzardKing in JabRef/JabRef-Browser-Extension#127 (comment), the deb and rpm packages do install JabRef in the folder opt/jabref (lowercase). Thus, this change would result in problems when JabRef is installed this way. I guess the easiest way is to fix the AUR install script. @j0hannes, you are currently maintaining it?

@joelostblom
Copy link
Author

I see, thanks! I didn't think of that the PKBUILD might have different path capitalization compared to the rpm and deb, but it makes sense. I will close this PR then.

@j0hannes I took a look at your PKBUILD and I believe that these are the changes needed to be made, not sure if they would affect something else though:

diff --git a/PKGBUILD-jabref b/PKGBUILD-jabref-lower-case-path
index 9c39d2c..85489cf 100644
--- a/PKGBUILD-jabref
+++ b/PKGBUILD-jabref-lower-case-path
@@ -36,11 +36,12 @@ pkgver() {
 
 package() {
   cd ${srcdir}
-  install -Dm755 JabRef/bin/JabRef ${pkgdir}/opt/JabRef/bin/JabRef
+  install -Dm755 JabRef/bin/JabRef ${pkgdir}/opt/jabref/bin/JabRef
   find JabRef/lib -type f -exec install -Dm644 "{}" "${pkgdir}/opt/{}" \;
-  chmod +x ${pkgdir}/opt/JabRef/lib/runtime/bin/*
-  chmod +x ${pkgdir}/opt/JabRef/lib/runtime/lib/jexec
-  chmod +x ${pkgdir}/opt/JabRef/lib/runtime/lib/jspawnhelper
+  chmod +x ${pkgdir}/opt/jabref/lib/runtime/bin/*
+  chmod +x ${pkgdir}/opt/jabref/lib/runtime/lib/jexec
+  chmod +x ${pkgdir}/opt/jabref/lib/runtime/lib/jspawnhelper
+  chmod +x ${pkgdir}/opt/jabref/lib/jabrefHost.py
   install -Dm755 jabref.sh ${pkgdir}/usr/bin/jabref
   install -Dm755 JabRef.svg ${pkgdir}/usr/share/pixmaps/JabRef.svg
   install -Dm644 JabRef.desktop ${pkgdir}/usr/share/applications/JabRef.desktop

@j0hannes
Copy link

The camelcase JabRef path is taken from the .tar.gz file, the changes proposed by @joelostblom unfortunately break the PKGBUILD. If I rename the directory JabRef to jabref, JabRef won't run because of this error:

Error occurred during initialization of boot layer
java.lang.module.FindException: Two versions of module org.jabref found in /opt/jabref/lib/app/mods (JabRef-5.0.30001.jar and JabRef-5.0.0.jar)

@j0hannes
Copy link

I guess the easiest way is to fix the AUR install script. @j0hannes, you are currently maintaining it?

Yes

@tobiasdiez
Copy link
Member

I guess one of the JabRef-5.0.X.jar files was there already from a previous installation. The mods folder can be safely deleted anyways (refs #5771 )

@joelostblom
Copy link
Author

Thanks for the reply @j0hannes, I just tried either renaming the archived folder or using mv to rename the directory in the pkg and both approaches work for me. Installing and running the application goes well for me. It looks like your error might be from a previous file lying around?

This is the full diff for the changes I made to your PKGBUILD when using mv to rename (not sure if this is bad practice and it is better to rename the archive).

diff --git a/PKGBUILD b/PKGBUILD
index 8f07fb5..4f19285 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -35,13 +35,14 @@ pkgver() {
 }
 
 package() {
+  mv JabRef jabref
   cd ${srcdir}
-  install -Dm755 JabRef/bin/JabRef ${pkgdir}/opt/JabRef/bin/JabRef
-  find JabRef/lib -type f -exec install -Dm644 "{}" "${pkgdir}/opt/{}" \;
-  chmod +x ${pkgdir}/opt/JabRef/lib/runtime/bin/*
-  chmod +x ${pkgdir}/opt/JabRef/lib/runtime/lib/jexec
-  chmod +x ${pkgdir}/opt/JabRef/lib/runtime/lib/jspawnhelper
-  chmod +x ${pkgdir}/opt/JabRef/lib/jabrefHost.py
+  install -Dm755 jabref/bin/JabRef ${pkgdir}/opt/jabref/bin/JabRef
+  find jabref/lib -type f -exec install -Dm644 "{}" "${pkgdir}/opt/{}" \;
+  chmod +x ${pkgdir}/opt/jabref/lib/runtime/bin/*
+  chmod +x ${pkgdir}/opt/jabref/lib/runtime/lib/jexec
+  chmod +x ${pkgdir}/opt/jabref/lib/runtime/lib/jspawnhelper
+  chmod +x ${pkgdir}/opt/jabref/lib/jabrefHost.py
   install -Dm755 jabref.sh ${pkgdir}/usr/bin/jabref
   install -Dm755 JabRef.svg ${pkgdir}/usr/share/pixmaps/JabRef.svg
   install -Dm644 JabRef.desktop ${pkgdir}/usr/share/applications/JabRef.desktop

I also made these changes to the launcher script.

diff --git a/jabref.sh b/jabref.sh
index edd6746..7bd7912 100755
--- a/jabref.sh
+++ b/jabref.sh
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-exec /opt/JabRef/bin/JabRef $@
+exec /opt/jabref/bin/JabRef $@

@j0hannes
Copy link

I guess one of the JabRef-5.0.X.jar files was there already from a previous installation. The mods folder can be safely deleted anyways (refs #5771 )

I removed the package completely, so the folder was removed. If I use JabRef it works, with jabref I get that error. The error is reproducible.

@j0hannes
Copy link

This is the full diff for the changes I made to your PKGBUILD when using mv to rename (not sure if this is bad practice and it is better to rename the archive).

That's exactly what I tried and what failed for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants