blast: fix and enable strictDeps (#366620)
[NixPkgs.git] / pkgs / by-name / zo / zotero-beta / package.nix
blob9b4f1eca9b576ea9d4d465a9e6f5921b2dcee788
2   lib,
3   stdenv,
4   fetchurl,
5   wrapGAppsHook3,
6   makeDesktopItem,
7   alsa-lib,
8   atk,
9   cairo,
10   dbus-glib,
11   gdk-pixbuf,
12   glib,
13   gtk3,
14   libGL,
15   xorg,
16   libgbm,
17   pango,
18   pciutils,
21 stdenv.mkDerivation rec {
22   pname = "zotero";
23   version = "7.0.0-beta.111+b4f6c050e";
25   src =
26     let
27       escapedVersion = lib.replaceStrings [ "+" ] [ "%2B" ] version;
28     in
29     fetchurl {
30       url = "https://download.zotero.org/client/beta/${escapedVersion}/Zotero-${escapedVersion}_linux-x86_64.tar.bz2";
31       hash = "sha256-pZsmS4gKCT8UAjz9IJg5C7n4kk7bWT/7H5ONF20CzPM=";
32     };
34   dontPatchELF = true;
35   nativeBuildInputs = [ wrapGAppsHook3 ];
37   libPath =
38     lib.makeLibraryPath [
39       alsa-lib
40       atk
41       cairo
42       dbus-glib
43       gdk-pixbuf
44       glib
45       gtk3
46       libGL
47       xorg.libX11
48       xorg.libXcomposite
49       xorg.libXcursor
50       xorg.libXdamage
51       xorg.libXext
52       xorg.libXfixes
53       xorg.libXi
54       xorg.libXrandr
55       xorg.libXtst
56       xorg.libxcb
57       libgbm
58       pango
59       pciutils
60     ]
61     + ":"
62     + lib.makeSearchPathOutput "lib" "lib64" [ stdenv.cc.cc ];
64   desktopItem = makeDesktopItem {
65     name = "zotero";
66     exec = "zotero -url %U";
67     icon = "zotero";
68     comment = meta.description;
69     desktopName = "Zotero";
70     genericName = "Reference Management";
71     categories = [
72       "Office"
73       "Database"
74     ];
75     startupNotify = true;
76     mimeTypes = [
77       "x-scheme-handler/zotero"
78       "text/plain"
79     ];
80   };
82   installPhase = ''
83     runHook preInstall
85     # Copy package contents to the output directory
86     mkdir -p "$prefix/usr/lib/zotero-bin-${version}"
87     cp -r * "$prefix/usr/lib/zotero-bin-${version}"
88     mkdir -p "$out/bin"
89     ln -s "$prefix/usr/lib/zotero-bin-${version}/zotero" "$out/bin/"
91     # Install desktop file and icons
92     mkdir -p $out/share/applications
93     cp ${desktopItem}/share/applications/* $out/share/applications/
94     for size in 32 64 128; do
95       install -Dm444 icons/icon''${size}.png \
96         $out/share/icons/hicolor/''${size}x''${size}/apps/zotero.png
97     done
98     install -Dm444 icons/symbolic.svg \
99       $out/share/icons/hicolor/symbolic/apps/zotero-symbolic.svg
101     runHook postInstall
102   '';
104   postFixup = ''
105     for executable in \
106       zotero-bin plugin-container updater vaapitest \
107       minidump-analyzer glxtest
108     do
109       if [ -e "$out/usr/lib/zotero-bin-${version}/$executable" ]; then
110         patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
111           "$out/usr/lib/zotero-bin-${version}/$executable"
112       fi
113     done
114     find . -executable -type f -exec \
115       patchelf --set-rpath "$libPath" \
116         "$out/usr/lib/zotero-bin-${version}/{}" \;
117   '';
119   meta = with lib; {
120     homepage = "https://www.zotero.org";
121     description = "Collect, organize, cite, and share your research sources";
122     mainProgram = "zotero";
123     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
124     license = licenses.agpl3Only;
125     platforms = [ "x86_64-linux" ];
126     maintainers = with maintainers; [
127       atila
128       justanotherariel
129     ];
130   };