2017-11-16 12:33:39 +01:00
|
|
|
{ stdenv, fetchurl, buildFHSUserEnv, makeDesktopItem, runCommand, bash, wrapGAppsHook, gsettings_desktop_schemas, gtk3, gnome3 }:
|
2014-12-04 16:35:48 +01:00
|
|
|
|
2014-03-27 00:24:20 +01:00
|
|
|
let
|
2017-11-15 13:59:33 +01:00
|
|
|
version = "5.0.25";
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://www.zotero.org;
|
|
|
|
description = "Collect, organize, cite, and share your research sources";
|
|
|
|
license = licenses.agpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
|
|
|
|
zoteroSrc = stdenv.mkDerivation rec {
|
2015-01-24 20:42:19 +01:00
|
|
|
inherit version;
|
2017-11-15 13:59:33 +01:00
|
|
|
name = "zotero-${version}-pkg";
|
2014-03-27 00:24:20 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-11-15 13:59:33 +01:00
|
|
|
url = "https://download.zotero.org/client/release/${version}/Zotero-${version}_linux-x86_64.tar.bz2";
|
|
|
|
sha256 = "1y3q5582xp4inpz137x0r9iscs1g0cjlqcfjpzl3klsq3yas688k";
|
2014-03-27 00:24:20 +01:00
|
|
|
};
|
|
|
|
|
2017-11-15 13:59:33 +01:00
|
|
|
buildInputs= [ wrapGAppsHook gsettings_desktop_schemas gtk3 gnome3.adwaita-icon-theme gnome3.dconf ];
|
|
|
|
phases = [ "unpackPhase" "installPhase" "fixupPhase"];
|
2015-01-24 20:42:19 +01:00
|
|
|
|
2014-03-27 00:24:20 +01:00
|
|
|
installPhase = ''
|
2017-11-15 13:59:33 +01:00
|
|
|
mkdir -p $out/data
|
|
|
|
cp -r * $out/data
|
|
|
|
mkdir $out/bin
|
|
|
|
ln -s $out/data/zotero $out/bin/zotero
|
2014-03-27 00:24:20 +01:00
|
|
|
'';
|
2017-11-15 13:59:33 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
fhsEnv = buildFHSUserEnv {
|
|
|
|
name = "zotero-fhs-env";
|
|
|
|
targetPkgs = pkgs: with pkgs; with xlibs; [
|
|
|
|
gtk3 dbus_glib
|
|
|
|
libXt nss
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2017-11-16 12:33:39 +01:00
|
|
|
desktopItem = makeDesktopItem rec {
|
|
|
|
name = "zotero-${version}";
|
|
|
|
exec = "zotero -url %U";
|
|
|
|
icon = "zotero";
|
|
|
|
type = "Application";
|
|
|
|
comment = meta.description;
|
|
|
|
desktopName = "Zotero";
|
|
|
|
genericName = "Reference Management";
|
|
|
|
categories = "Office;Database;";
|
|
|
|
startupNotify = "true";
|
|
|
|
};
|
|
|
|
|
|
|
|
in runCommand "zotero-${version}" { inherit meta; } ''
|
|
|
|
mkdir -p $out/bin $out/share/applications
|
|
|
|
cat >$out/bin/zotero <<EOF
|
|
|
|
#!${bash}/bin/bash
|
|
|
|
${fhsEnv}/bin/zotero-fhs-env ${zoteroSrc}/bin/zotero
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/zotero
|
|
|
|
|
|
|
|
cp ${desktopItem}/share/applications/* $out/share/applications/
|
|
|
|
|
|
|
|
for size in 16 32 48 256; do
|
|
|
|
install -Dm444 ${zoteroSrc}/data/chrome/icons/default/default$size.png \
|
|
|
|
$out/share/icons/hicolor/''${size}x''${size}/apps/zotero.png
|
|
|
|
done
|
|
|
|
''
|