nixpkgs/pkgs/applications/office/mendeley/default.nix

68 lines
1.6 KiB
Nix
Raw Normal View History

2015-01-24 21:40:01 +00:00
{ fetchurl, stdenv, dpkg, makeWrapper, which
2016-08-29 09:35:30 +01:00
,gcc, liborc, xorg, qt4, zlib
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";
2016-09-12 13:19:18 +01:00
shortVersion = "1.16.3-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
2016-09-12 13:19:18 +01:00
then "14cxysn1l6s6z8awmqj1glm4146jif0852wiyhjg1dhhh25cvpbv"
else "1hdvawj8g4hpj36xy5ys27h1fa76xcdx8apsxa6hpg5xmxvcamqz";
2015-01-24 21:40:01 +00:00
deps = [
gcc.cc
2016-08-29 09:35:30 +01:00
liborc
2015-01-24 21:40:01 +00:00
qt4
xorg.libX11
2015-01-24 21:40:01 +00:00
zlib
];
in
stdenv.mkDerivation {
name = "mendeley-${version}";
src = fetchurl {
url = url;
sha256 = sha256;
};
buildInputs = [ dpkg makeWrapper which ];
unpackPhase = "true";
installPhase = ''
dpkg-deb -x $src $out
mv $out/opt/mendeleydesktop/{bin,lib,plugins,share} $out
interpreter=$(patchelf --print-interpreter $(readlink -f $(which patchelf)))
patchelf --set-interpreter $interpreter $out/bin/mendeleydesktop
librarypath="${stdenv.lib.makeLibraryPath deps}:$out/lib:$out/lib/qt"
wrapProgram $out/bin/mendeleydesktop --prefix LD_LIBRARY_PATH : "$librarypath"
'';
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
};
}