2017-03-06 18:45:38 +00:00
|
|
|
{ fetchurl, stdenv, dpkg, which
|
2017-05-17 20:26:11 +01:00
|
|
|
, makeWrapper
|
2017-03-06 18:45:38 +00:00
|
|
|
, alsaLib
|
|
|
|
, desktop_file_utils
|
|
|
|
, dbus
|
|
|
|
, libcap
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, gcc
|
|
|
|
, gconf
|
|
|
|
, glib
|
|
|
|
, icu
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
, orc
|
|
|
|
, nss
|
|
|
|
, nspr
|
|
|
|
, qt5
|
|
|
|
, sqlite
|
|
|
|
, xorg
|
|
|
|
, xlibs
|
|
|
|
, zlib
|
|
|
|
# The provided wrapper does this, but since we don't use it
|
|
|
|
# we emulate the behavior. The downside is that this
|
|
|
|
# will leave entries on your system after uninstalling mendeley.
|
|
|
|
# (they can be removed by running '$out/bin/install-mendeley-link-handler.sh -u')
|
|
|
|
, autorunLinkHandler ? true
|
|
|
|
}:
|
2015-01-24 21:40:01 +00:00
|
|
|
|
|
|
|
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
|
|
|
|
|
|
|
let
|
|
|
|
arch32 = "i686-linux";
|
|
|
|
arch64 = "x86_64-linux";
|
|
|
|
|
|
|
|
arch = if stdenv.system == arch32
|
|
|
|
then "i386"
|
|
|
|
else "amd64";
|
|
|
|
|
2017-09-19 23:18:49 +01:00
|
|
|
shortVersion = "1.17.11-stable";
|
2015-01-24 21:40:01 +00:00
|
|
|
|
|
|
|
version = "${shortVersion}_${arch}";
|
|
|
|
|
|
|
|
url = "http://desktop-download.mendeley.com/download/apt/pool/main/m/mendeleydesktop/mendeleydesktop_${version}.deb";
|
|
|
|
sha256 = if stdenv.system == arch32
|
2017-09-19 23:18:49 +01:00
|
|
|
then "033855ix5qj1gwd3pa6qws5k94hgbp6rvibrrxl3rn5bvhrvvbkq"
|
|
|
|
else "09h6br8qhvphkvzy28y1pnh7dhyigb3w41w3kjwqj6027i46chi7";
|
2015-01-24 21:40:01 +00:00
|
|
|
|
|
|
|
deps = [
|
2017-03-06 18:45:38 +00:00
|
|
|
qt5.qtbase
|
|
|
|
qt5.qtsvg
|
|
|
|
qt5.qtdeclarative
|
|
|
|
qt5.qtwebchannel
|
|
|
|
qt5.qtquickcontrols
|
|
|
|
qt5.qtwebkit
|
|
|
|
qt5.qtwebengine
|
|
|
|
alsaLib
|
|
|
|
dbus
|
|
|
|
freetype
|
|
|
|
fontconfig
|
2015-02-04 06:12:35 +00:00
|
|
|
gcc.cc
|
2017-03-06 18:45:38 +00:00
|
|
|
gconf
|
|
|
|
glib
|
|
|
|
icu
|
|
|
|
libcap
|
|
|
|
libxml2
|
|
|
|
libxslt
|
|
|
|
nspr
|
|
|
|
nss
|
2016-12-18 11:42:57 +00:00
|
|
|
orc
|
2017-03-06 18:45:38 +00:00
|
|
|
sqlite
|
2015-09-15 10:26:18 +01:00
|
|
|
xorg.libX11
|
2017-03-06 18:45:38 +00:00
|
|
|
xlibs.xcbutilkeysyms
|
|
|
|
xorg.libxcb
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXtst
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.xcbutilimage
|
2015-01-24 21:40:01 +00:00
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "mendeley-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = url;
|
|
|
|
sha256 = sha256;
|
|
|
|
};
|
|
|
|
|
2017-05-17 20:26:11 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2017-03-06 18:45:38 +00:00
|
|
|
buildInputs = [ dpkg which ] ++ deps;
|
2015-01-24 21:40:01 +00:00
|
|
|
|
|
|
|
unpackPhase = "true";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
dpkg-deb -x $src $out
|
2017-03-06 18:45:38 +00:00
|
|
|
mv $out/opt/mendeleydesktop/{bin,lib,share} $out
|
2015-01-24 21:40:01 +00:00
|
|
|
|
|
|
|
interpreter=$(patchelf --print-interpreter $(readlink -f $(which patchelf)))
|
2017-03-06 18:45:38 +00:00
|
|
|
patchelf --set-interpreter $interpreter \
|
|
|
|
--set-rpath ${stdenv.lib.makeLibraryPath deps}:$out/lib \
|
|
|
|
$out/bin/mendeleydesktop
|
|
|
|
paxmark m $out/bin/mendeleydesktop
|
|
|
|
|
2017-05-17 20:26:11 +01:00
|
|
|
wrapProgram $out/bin/mendeleydesktop \
|
2017-03-06 18:45:38 +00:00
|
|
|
--add-flags "--unix-distro-build" \
|
2017-06-28 21:27:14 +01:00
|
|
|
${stdenv.lib.optionalString autorunLinkHandler # ignore errors installing the link handler
|
|
|
|
''--run "$out/bin/install-mendeley-link-handler.sh $out/bin/mendeleydesktop ||:"''}
|
2017-03-06 18:45:38 +00:00
|
|
|
|
|
|
|
# Remove bundled qt bits
|
|
|
|
rm -rf $out/lib/qt
|
|
|
|
rm $out/bin/qt* $out/bin/Qt*
|
|
|
|
|
|
|
|
# Patch up link handler script
|
|
|
|
wrapProgram $out/bin/install-mendeley-link-handler.sh \
|
|
|
|
--prefix PATH ':' ${stdenv.lib.makeBinPath [ which gconf desktop_file_utils ] }
|
2015-01-24 21:40:01 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchElf = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://www.mendeley.com;
|
2015-01-25 17:08:01 +00:00
|
|
|
description = "A reference manager and academic social network";
|
2015-01-24 21:40:01 +00:00
|
|
|
license = stdenv.lib.licenses.unfree;
|
2015-01-25 17:27:53 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2015-01-24 21:40:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|