desktop/mendeleydesktop/PKGBUILD
2018-12-03 18:13:50 +01:00

63 lines
2.3 KiB
Bash

pkgname=mendeleydesktop
pkgver=1.19.3
pkgrel=1
pkgdesc="Academic software for managing and sharing research papers (desktop client)"
url=http://www.mendeley.com/release-notes/
arch=('x86_64')
depends=(qt5-webengine)
license=(custom:mendeley_eula)
source=("https://desktop-download.mendeley.com/download/linux/$pkgname-$pkgver-linux-x86_64.tar.bz2")
sha512sums=('2c2d92d45730797f93eec74b23ea8d7f654388fd778063dcd92705fe019939f6d557bcaac13a14b021fcc4d785938921b19a9c8b821dfe6c18fb5c213eaa8a26')
prepare() {
cd "$pkgname-$pkgver-linux-$CARCH"
# Using shared libraries so remove the bundled ones
rm -rf lib/cpp lib/qt lib/ssl lib/libpng12.so.0 lib/mendeleydesktop/plugins
rm -rf lib/mendeleydesktop/libexec/resources
rm -rf lib/mendeleydesktop/libexec/translations/qtwebengine_locales
# TODO Run install-mendeley-link-handler.sh for gconf or just remove it?
rm bin/install-mendeley-link-handler.sh
# # Remove unneeded lines if gconf is not installed.
# if ! which gconftool-2 &>/dev/null;then
# sed -i '/GCONF/d' \
# "$pkgdir"/opt/"$pkgname"/bin/install-mendeley-link-handler.sh
# fi
}
package() {
cd "$pkgname-$pkgver-linux-$CARCH"
# Link system Qt
ln -s /usr/share/qt/resources \
lib/mendeleydesktop/libexec/
ln -s /usr/share/qt/translations/qtwebengine_locales \
lib/mendeleydesktop/libexec/translations/
install -d "$pkgdir/opt/$pkgname/"
cp -a bin lib share "$pkgdir/opt/$pkgname/"
# Replace default python laucher with custom bash
cat <<'EOF' > "$pkgdir/opt/$pkgname/bin/mendeleydesktop"
#!/bin/bash
export LD_LIBRARY_PATH=/usr/lib/:/opt/mendeleydesktop/lib/:/usr/lib/qt/
export MENDELEY_BUNDLED_QT_PLUGIN_PATH=/lib/qt/plugins/
/opt/mendeleydesktop/lib/mendeleydesktop/libexec/mendeleydesktop.x86_64 "$@"
EOF
install -d "$pkgdir"/usr/bin
ln -s "/opt/$pkgname/bin/mendeleydesktop" \
"$pkgdir/usr/bin/mendeleydesktop"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 share/applications/mendeleydesktop.desktop \
"$pkgdir"/usr/share/applications/mendeleydesktop.desktop
cp -a "$pkgdir/opt/$pkgname/share/icons" "$pkgdir/usr/share/icons"
# Clean share from opt (don't remove mendeleydesktop)
rm -rf "$pkgdir/opt/$pkgname/share/"{applications,doc,icons}
}