about summary refs log tree commit diff
path: root/pkgs/applications/office/mendeley
diff options
context:
space:
mode:
authorBadi' Abdul-Wahid <abdulwahidc@gmail.com>2015-01-24 16:40:01 -0500
committerBadi' Abdul-Wahid <abdulwahidc@gmail.com>2015-01-24 17:11:00 -0500
commit4291a1413374be4a49a70d97bc8a5f2424f9499e (patch)
tree4edd001587b1ac1dc4966c9f98b5188bf8dbd766 /pkgs/applications/office/mendeley
parentc457bbb2bbe1cef5ad56effc87cb7ff1ddd86509 (diff)
downloadnixlib-4291a1413374be4a49a70d97bc8a5f2424f9499e.tar
nixlib-4291a1413374be4a49a70d97bc8a5f2424f9499e.tar.gz
nixlib-4291a1413374be4a49a70d97bc8a5f2424f9499e.tar.bz2
nixlib-4291a1413374be4a49a70d97bc8a5f2424f9499e.tar.lz
nixlib-4291a1413374be4a49a70d97bc8a5f2424f9499e.tar.xz
nixlib-4291a1413374be4a49a70d97bc8a5f2424f9499e.tar.zst
nixlib-4291a1413374be4a49a70d97bc8a5f2424f9499e.zip
Add Mendeley desktop application
Diffstat (limited to 'pkgs/applications/office/mendeley')
-rw-r--r--pkgs/applications/office/mendeley/mendeley.nix65
1 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/applications/office/mendeley/mendeley.nix b/pkgs/applications/office/mendeley/mendeley.nix
new file mode 100644
index 000000000000..8074f57e75ac
--- /dev/null
+++ b/pkgs/applications/office/mendeley/mendeley.nix
@@ -0,0 +1,65 @@
+{ fetchurl, stdenv, dpkg, makeWrapper, which
+,gcc, xlibs, qt4, zlib
+, ...}:
+
+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";
+
+  shortVersion = "1.13.1-stable";
+
+  version = "${shortVersion}_${arch}";
+
+  url = "http://desktop-download.mendeley.com/download/apt/pool/main/m/mendeleydesktop/mendeleydesktop_${version}.deb";
+  sha256 = if stdenv.system == arch32
+    then "21491da1608daf58da23e7e5eb7619b494b10192acc0f81575daff2a38720f50"
+    else "8db101b26dd2978e991421260a2e55d849014f64005930b2528080bbbaa78600";
+
+  deps = [
+    gcc.gcc
+    qt4
+    xlibs.libX11
+    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;
+    description = "Mendeley is a free reference manager and academic social network.";
+    license = stdenv.lib.licenses.unfree;
+  };
+
+}