1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
7 inherit desktop python-single-r1 xdg
9 MY_P_AMD64="${P}-linux-x86_64"
10 MY_P_X86="${P}-linux-i486"
12 DESCRIPTION="Research management tool for desktop and web"
13 HOMEPAGE="https://www.mendeley.com/"
15 amd64? ( ${MY_P_AMD64}.tar.bz2 )
16 x86? ( ${MY_P_X86}.tar.bz2 )
17 amd64-linux? ( ${MY_P_AMD64}.tar.bz2 )
18 x86-linux? ( ${MY_P_X86}.tar.bz2 )"
20 LICENSE="Mendeley-terms"
22 KEYWORDS="~amd64 ~x86"
24 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
26 RESTRICT="bindist fetch"
30 RDEPEND="${PYTHON_DEPS}
32 dev-qt/qtdeclarative:5
35 dev-qt/qtpositioning:5
36 dev-qt/qtprintsupport:5
38 dev-qt/qtwebengine:5[widgets]
46 QA_PREBUILT="/opt/mendeleydesktop/.*"
49 "${FILESDIR}"/${PN}-1.17.8-libdir.patch
50 "${FILESDIR}"/${PN}-1.17.8-qt5plugins.patch
51 "${FILESDIR}"/${PN}-1.17.8-unix-distro-build.patch
55 elog "Please download ${A} from:"
56 elog "http://www.mendeley.com/download-mendeley-desktop/"
57 elog "and move it to your DISTDIR directory."
63 cd "${WORKDIR}" || die
65 if use amd64 || use amd64-linux ; then
66 mv -f "${MY_P_AMD64}" "${P}" || die
68 mv -f "${MY_P_X86}" "${P}" || die
75 # remove bundled Qt libraries
76 rm -r lib/mendeleydesktop/plugins \
77 || die "failed to remove plugin directory"
81 sed -e "s:/usr/lib/qt5/plugins:${EROOT}/usr/$(get_libdir)/qt5/plugins:g" \
82 -i bin/mendeleydesktop || die
85 sed -e "s:lib/mendeleydesktop:$(get_libdir)/mendeleydesktop:g" \
86 -e "s:MENDELEY_BASE'] + \"/lib/\":MENDELEY_BASE'] + \"/$(get_libdir)/\":g" \
87 -i bin/mendeleydesktop || die
92 domenu share/applications/${PN}.desktop
94 # install application icons
95 insinto /usr/share/icons
96 doins -r share/icons/hicolor
98 # install default icon
99 insinto /usr/share/pixmaps
100 doins share/icons/hicolor/48x48/apps/${PN}.png
102 # install documentation, but no license file
103 dodoc share/doc/${PN}/Readme.txt
106 python_fix_shebang bin/${PN}
111 dolib.so lib/lib*.so*
113 # remove qtconf and qt-5.10 workaround
114 rm lib/mendeleydesktop/libexec/qt.conf
115 rm "lib/mendeleydesktop/libexec/QtWebEngineProcess --type=zygote --lang=en-US"
118 exeinto /opt/mendeleydesktop/$(get_libdir)/mendeleydesktop/libexec
119 doexe lib/mendeleydesktop/libexec/*
121 # install shared files
122 insinto /opt/${PN}/share
123 doins -r share/mendeleydesktop
125 # symlink launch script
126 dosym ../mendeleydesktop/bin/mendeleydesktop /opt/bin/mendeleydesktop