3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/office/mendeley/default.nix

148 lines
3.2 KiB
Nix
Raw Normal View History

{ fetchurl, stdenv, dpkg, which
2017-05-17 20:26:11 +01:00
, makeWrapper
, alsaLib
, desktop-file-utils
, dbus
, libcap
, fontconfig
, freetype
, gcc
, gconf
, glib
, icu
, libxml2
, libxslt
, orc
, nss
, nspr
, qtbase
, qtsvg
, qtdeclarative
, qtwebchannel
, qtquickcontrols
, qtwebkit
, qtwebengine
, sqlite
, xorg
, 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
# Update script
, writeScript
}:
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";
2018-01-14 20:34:03 +00:00
shortVersion = "1.17.13-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
2018-01-14 20:34:03 +00:00
then "0q4x62k00whmq8lskphpcxc610cvclxzcr5k0v7pxjxs9sx5yx43"
else "01ylyily1hip35z0d4qkdpbzp5yn4r015psc5773xsqlgrnlwjm3";
2015-01-24 21:40:01 +00:00
deps = [
qtbase
qtsvg
qtdeclarative
qtwebchannel
qtquickcontrols
qtwebkit
qtwebengine
alsaLib
dbus
freetype
fontconfig
gcc.cc
gconf
glib
icu
libcap
libxml2
libxslt
nspr
nss
orc
sqlite
xorg.libX11
2018-03-13 10:16:03 +00:00
xorg.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 ];
buildInputs = [ dpkg which ] ++ deps;
2015-01-24 21:40:01 +00:00
propagatedUserEnvPkgs = [ gconf ];
2015-01-24 21:40:01 +00:00
unpackPhase = "true";
installPhase = ''
dpkg-deb -x $src $out
mv $out/opt/mendeleydesktop/{bin,lib,share} $out
2015-01-24 21:40:01 +00:00
interpreter=$(patchelf --print-interpreter $(readlink -f $(which patchelf)))
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 \
--add-flags "--unix-distro-build" \
${stdenv.lib.optionalString autorunLinkHandler # ignore errors installing the link handler
''--run "$out/bin/install-mendeley-link-handler.sh $out/bin/mendeleydesktop ||:"''}
# 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;
updateScript = import ./update.nix { inherit writeScript; };
meta = with stdenv.lib; {
2015-01-24 21:40:01 +00:00
homepage = http://www.mendeley.com;
2015-01-25 17:08:01 +00:00
description = "A reference manager and academic social network";
license = licenses.unfree;
platforms = platforms.linux;
maintainers = with maintainers; [ dtzWill ];
2015-01-24 21:40:01 +00:00
};
}