2021-01-11 07:54:33 +00:00
|
|
|
{ fetchurl, lib, stdenv, mkDerivation, dpkg, which
|
2017-05-17 20:26:11 +01:00
|
|
|
, makeWrapper
|
2017-03-06 18:45:38 +00:00
|
|
|
, alsaLib
|
2018-02-25 02:23:58 +00:00
|
|
|
, desktop-file-utils
|
2017-03-06 18:45:38 +00:00
|
|
|
, dbus
|
|
|
|
, libcap
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, gcc
|
|
|
|
, gconf
|
|
|
|
, glib
|
|
|
|
, icu
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
, orc
|
|
|
|
, nss
|
|
|
|
, nspr
|
2018-01-03 20:27:09 +00:00
|
|
|
, qtbase
|
|
|
|
, qtsvg
|
|
|
|
, qtdeclarative
|
|
|
|
, qtwebchannel
|
|
|
|
, qtquickcontrols
|
|
|
|
, qtwebkit
|
|
|
|
, qtwebengine
|
2017-03-06 18:45:38 +00:00
|
|
|
, 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
|
2018-01-14 19:58:15 +00:00
|
|
|
# Update script
|
|
|
|
, writeScript
|
2019-02-26 11:45:54 +00:00
|
|
|
, runtimeShell
|
2017-03-06 18:45:38 +00:00
|
|
|
}:
|
2015-01-24 21:40:01 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
arch32 = "i686-linux";
|
|
|
|
|
2018-08-20 20:11:29 +01:00
|
|
|
arch = if stdenv.hostPlatform.system == arch32
|
2015-01-24 21:40:01 +00:00
|
|
|
then "i386"
|
|
|
|
else "amd64";
|
|
|
|
|
2019-05-08 23:02:01 +01:00
|
|
|
shortVersion = "1.19.5-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";
|
2018-08-20 20:11:29 +01:00
|
|
|
sha256 = if stdenv.hostPlatform.system == arch32
|
2019-05-08 23:02:01 +01:00
|
|
|
then "01x83a44qlxi937b128y8y0px0q4w37g72z652lc42kv50dhyy3f"
|
|
|
|
else "1cagqq0xziznaj97z30bqfhrwjv3a4h83ckhwigq35nhk1ggq1ry";
|
2015-01-24 21:40:01 +00:00
|
|
|
|
|
|
|
deps = [
|
2018-01-03 20:27:09 +00:00
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qtdeclarative
|
|
|
|
qtwebchannel
|
|
|
|
qtquickcontrols
|
|
|
|
qtwebkit
|
|
|
|
qtwebengine
|
2017-03-06 18:45:38 +00:00
|
|
|
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
|
2018-03-13 10:16:03 +00:00
|
|
|
xorg.xcbutilkeysyms
|
2017-03-06 18:45:38 +00:00
|
|
|
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
|
|
|
|
|
2019-11-13 08:55:06 +00:00
|
|
|
mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "mendeley";
|
|
|
|
inherit version;
|
2015-01-24 21:40:01 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2018-01-03 20:17:33 +00:00
|
|
|
propagatedUserEnvPkgs = [ gconf ];
|
|
|
|
|
2019-06-19 16:45:34 +01:00
|
|
|
dontUnpack = true;
|
2015-01-24 21:40:01 +00:00
|
|
|
|
2019-11-14 00:03:45 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2015-01-24 21:40:01 +00:00
|
|
|
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 \
|
2021-01-15 05:42:41 +00:00
|
|
|
--set-rpath ${lib.makeLibraryPath deps}:$out/lib \
|
2017-03-06 18:45:38 +00:00
|
|
|
$out/bin/mendeleydesktop
|
|
|
|
|
2019-11-14 00:03:45 +00:00
|
|
|
wrapQtApp $out/bin/mendeleydesktop \
|
2017-03-06 18:45:38 +00:00
|
|
|
--add-flags "--unix-distro-build" \
|
2021-01-15 05:42:41 +00:00
|
|
|
${lib.optionalString autorunLinkHandler # ignore errors installing the link handler
|
2017-06-28 21:27:14 +01:00
|
|
|
''--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 \
|
2021-01-15 05:42:41 +00:00
|
|
|
--prefix PATH ':' ${lib.makeBinPath [ which gconf desktop-file-utils ] }
|
2015-01-24 21:40:01 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
2019-07-23 11:32:11 +01:00
|
|
|
dontPatchELF = true;
|
2015-01-24 21:40:01 +00:00
|
|
|
|
2019-06-16 20:59:06 +01:00
|
|
|
updateScript = import ./update.nix { inherit writeScript runtimeShell; };
|
2018-01-14 19:58:15 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-02 21:01:48 +01:00
|
|
|
homepage = "https://www.mendeley.com";
|
2015-01-25 17:08:01 +00:00
|
|
|
description = "A reference manager and academic social network";
|
2018-01-14 19:58:15 +00:00
|
|
|
license = licenses.unfree;
|
2018-05-03 06:58:11 +01:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2018-01-14 19:58:15 +00:00
|
|
|
maintainers = with maintainers; [ dtzWill ];
|
2015-01-24 21:40:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|