sci-misc/mendeleydesktop: Revbump with fixed launcher (thanks Marius Brehler, bug...
authorMichael Weber <xmw@gentoo.org>
Thu, 9 Mar 2017 18:28:13 +0000 (19:28 +0100)
committerMichael Weber <xmw@gentoo.org>
Thu, 9 Mar 2017 18:28:27 +0000 (19:28 +0100)
Package-Manager: Portage-2.3.4, Repoman-2.3.2

sci-misc/mendeleydesktop/files/mendeleydesktop-1.17.8-libdir.patch [new file with mode: 0644]
sci-misc/mendeleydesktop/files/mendeleydesktop-1.17.8-qt5plugins.patch [new file with mode: 0644]
sci-misc/mendeleydesktop/files/mendeleydesktop-1.17.8-unix-distro-build.patch [new file with mode: 0644]
sci-misc/mendeleydesktop/mendeleydesktop-1.17.8-r1.ebuild [moved from sci-misc/mendeleydesktop/mendeleydesktop-1.17.8.ebuild with 80% similarity]

diff --git a/sci-misc/mendeleydesktop/files/mendeleydesktop-1.17.8-libdir.patch b/sci-misc/mendeleydesktop/files/mendeleydesktop-1.17.8-libdir.patch
new file mode 100644 (file)
index 0000000..67ba57f
--- /dev/null
@@ -0,0 +1,19 @@
+Patch to find libstdc++.
+
+https://bugs.funtoo.org/browse/FL-3519
+--- a/bin/mendeleydesktop
++++ b/bin/mendeleydesktop
+@@ -29,6 +29,13 @@ def library_paths():
+     paths.append("/usr/lib/x86_64-linux-gnu")
+     paths.append("/usr/lib/i386-linux-gnu")
++    gcc_libpath = subprocess.Popen(
++        '/usr/bin/gcc-config -L', shell=True, stdout=subprocess.PIPE,
++    ).stdout.read().decode('utf-8').replace('\n', '').split(':')
++    for path in gcc_libpath:
++        if len(path) > 0:
++            paths.append(path)
++
+     return paths
+ def library_version_from_path(lib_path):
diff --git a/sci-misc/mendeleydesktop/files/mendeleydesktop-1.17.8-qt5plugins.patch b/sci-misc/mendeleydesktop/files/mendeleydesktop-1.17.8-qt5plugins.patch
new file mode 100644 (file)
index 0000000..49395a4
--- /dev/null
@@ -0,0 +1,15 @@
+Patch to find qt5 plugins.
+
+Patch by Marius Brehler <marbre@linux.sungazer.de>
+--- a/bin/mendeleydesktop
++++ b/bin/mendeleydesktop
+@@ -75,7 +83,7 @@ def get_paths():
+         else:
+             results['MENDELEY_BIN'] = results['MENDELEY_BASE'] + "/lib/mendeleydesktop/libexec/mendeleydesktop.i486"
+-        results['MENDELEY_BUNDLED_QT_PLUGIN'] = results['MENDELEY_BASE'] + "/lib/mendeleydesktop/plugins/"
++        results['MENDELEY_BUNDLED_QT_PLUGIN'] = "/usr/lib/qt5/plugins"
+     # Path to Mendeley Desktop and PDFNet libraries
+     results['MENDELEY_LIB'] = results['MENDELEY_BASE'] + "/lib/"
diff --git a/sci-misc/mendeleydesktop/files/mendeleydesktop-1.17.8-unix-distro-build.patch b/sci-misc/mendeleydesktop/files/mendeleydesktop-1.17.8-unix-distro-build.patch
new file mode 100644 (file)
index 0000000..dffd69d
--- /dev/null
@@ -0,0 +1,16 @@
+Patch to force --unix-distro-build.
+
+Patch by Marius Brehler <marbre@linux.sungazer.de>
+--- a/bin/mendeleydesktop
++++ b/bin/mendeleydesktop
+@@ -159,10 +167,7 @@ def mendeley_desktop_arguments():
+     """ Returns a list with the argumetns to be appended to Mendeley Desktop. """
+     extra_args = sys.argv[1:]
+-    if is_linux_distro_build():
+-        # Enable Linux distro specific changes (eg. in auto-update
+-        # handling)
+-        extra_args = extra_args + ["--unix-distro-build"]
++    extra_args = extra_args + ["--unix-distro-build"]
+     use_debugger = sys.argv.count("--debug") > 0
similarity index 80%
rename from sci-misc/mendeleydesktop/mendeleydesktop-1.17.8.ebuild
rename to sci-misc/mendeleydesktop/mendeleydesktop-1.17.8-r1.ebuild
index 69eb1562274e7f63373ace0a886cd721b236945d..5cad0e09b5772a0679863df2946ab101c284f232 100644 (file)
@@ -45,6 +45,10 @@ RDEPEND="
 
 QA_PREBUILT="/opt/mendeleydesktop/.*"
 
+PATCHES=( "${FILESDIR}"/${PN}-1.17.8-libdir.patch
+       "${FILESDIR}"/${PN}-1.17.8-qt5plugins.patch
+       "${FILESDIR}"/${PN}-1.17.8-unix-distro-build.patch )
+
 pkg_nofetch() {
        elog "Please download ${A} from:"
        elog "http://www.mendeley.com/download-mendeley-desktop/"
@@ -64,22 +68,21 @@ src_unpack() {
 }
 
 src_prepare() {
+       default
+
        # remove bundled Qt libraries
        rm -r lib/mendeleydesktop/plugins \
                || die "failed to remove plugin directory"
-       rm -r lib/qt || die "failed to remove qt libraries"
+       rm -r lib/qt || die
 
-       # force use of system Qt libraries
-       sed -i "s:sys\.argv\.count(\"--force-system-qt\") > 0:True:" \
-               bin/mendeleydesktop || die "failed to patch startup script"
+       # fix qt library path
+       sed -e "s:/usr/lib/qt5/plugins:${EROOT}usr/$(get_libdir)/qt5/plugins:g" \
+               -i bin/mendeleydesktop || die
 
        # fix library paths
-       sed -i \
-               -e "s:lib/mendeleydesktop:$(get_libdir)/mendeleydesktop:g" \
-               -e "s:MENDELEY_BASE_PATH + \"/lib/\":MENDELEY_BASE_PATH + \"/$(get_libdir)/\":g" \
-               bin/mendeleydesktop || die "failed to patch library path"
-
-       default
+       sed -e "s:lib/mendeleydesktop:$(get_libdir)/mendeleydesktop:g" \
+               -e "s:MENDELEY_BASE'] + \"/lib/\":MENDELEY_BASE'] + \"/$(get_libdir)/\":g" \
+               -i bin/mendeleydesktop || die
 }
 
 src_install() {
@@ -113,9 +116,8 @@ src_install() {
        insinto /opt/${PN}/share
        doins -r share/mendeleydesktop
 
-       # install launch script
-       into /opt
-       make_wrapper ${PN} "/opt/${PN}/bin/${PN} --unix-distro-build"
+       # symlink launch script
+       dosym /opt/mendeleydesktop/bin/mendeleydesktop /opt/bin/mendeleydesktop
 }
 
 pkg_postinst() {