@@ -0,0 +1,84 @@
1+{ stdenv, fetchurl, binutils, patchelf, makeWrapper, expat, xorg, gdk_pixbuf, glib, gnome2, cairo, atk, freetype, fontconfig, dbus, nss, nspr, gtk2-x11, alsaLib, cups, libpulseaudio, libudev }:
2+
3+stdenv.mkDerivation rec {
4+ name = "inboxer-${version}";
5+ version = "1.0.0";
6+
7+ meta = with stdenv.lib; {
8+ description = "Unofficial, free and open-source Google Inbox Desktop App";
9+ homepage = "https://denysdovhan.com/inboxer";
10+ maintainers = [ maintainers.mgttlinger ];
11+ license = licenses.mit;
12+ platforms = [ "x86_64-linux" ];
13+ };
14+
15+ src = fetchurl {
16+ url = "https://github.com/denysdovhan/inboxer/releases/download/v${version}/inboxer_${version}_amd64.deb";
17+ sha256 = "01384fi5vrfqpznk9389nf3bwpi2zjbnkg84g6z1css8f3gp5i1c";
18+ };
19+
20+ unpackPhase = ''
21+ ar p $src data.tar.xz | tar xJ
22+ '';
23+ buildInputs = [ binutils patchelf makeWrapper ];
24+
25+ preFixup = with stdenv.lib; let
26+ lpath = makeLibraryPath [
27+ alsaLib
28+ atk
29+ cairo
30+ cups
31+ dbus
32+ nss
33+ nspr
34+ freetype
35+ fontconfig
36+ gtk2-x11
37+ xorg.libX11
38+ xorg.libXcursor
39+ xorg.libXdamage
40+ xorg.libXi
41+ xorg.libXext
42+ xorg.libXfixes
43+ xorg.libXrandr
44+ xorg.libXrender
45+ xorg.libXcomposite
46+ xorg.libXtst
47+ xorg.libXScrnSaver
48+ xorg.libxcb
49+ gdk_pixbuf
50+ glib
51+ gnome2.pango
52+ gnome2.GConf
53+ expat
54+ stdenv.cc.cc.lib
55+ libpulseaudio
56+ libudev
57+ ];
58+ in ''
59+ patchelf \
60+ --set-rpath "$out/opt/Inboxer:${lpath}" \
61+ $out/opt/Inboxer/libnode.so
62+ patchelf \
63+ --set-rpath "$out/opt/Inboxer:${lpath}" \
64+ $out/opt/Inboxer/libffmpeg.so
65+
66+ patchelf \
67+ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
68+ --set-rpath "$out/opt/Inboxer:${lpath}" \
69+ $out/opt/Inboxer/inboxer
70+
71+ wrapProgram $out/opt/Inboxer/inboxer --set LD_LIBRARY_PATH "${xorg.libxkbfile}/lib:${lpath}"
72+ '';
73+
74+ installPhase = ''
75+ mkdir -p $out/bin
76+ cp -R usr/share opt $out/
77+ # fix the path in the desktop file
78+ substituteInPlace \
79+ $out/share/applications/inboxer.desktop \
80+ --replace /opt/ $out/opt/
81+ # symlink the binary to bin/
82+ ln -s $out/opt/Inboxer/inboxer $out/bin/inboxer
83+ '';
84+}