perlPackages.NetAsyncWebSocket: 0.13 -> 0.14 (#352432)
[NixPkgs.git] / pkgs / by-name / ro / rocketchat-desktop / package.nix
blob401b1c9f512faeed9dbfdb7568758d545007a661
2   lib,
3   stdenv,
4   pkgs,
5   fetchurl,
6   wrapGAppsHook3,
7 }:
8 let
9   libPathNative = { packages }: lib.makeLibraryPath packages;
11 stdenv.mkDerivation rec {
12   pname = "rocketchat-desktop";
13   version = "4.1.2";
15   src = fetchurl {
16     url = "https://github.com/RocketChat/Rocket.Chat.Electron/releases/download/${version}/rocketchat-${version}-linux-amd64.deb";
17     hash = "sha256-lcMxBEcZkJARFd+ZQTAdLQLVy4/SIi4ps8N798PomyM=";
18   };
20   nativeBuildInputs = [
21     wrapGAppsHook3 # to fully work with gnome also needs programs.dconf.enable = true in your configuration.nix
22   ];
24   buildInputs = with pkgs; [
25     gtk3
26     stdenv.cc.cc
27     zlib
28     glib
29     dbus
30     atk
31     pango
32     freetype
33     libgnome-keyring
34     fontconfig
35     gdk-pixbuf
36     cairo
37     cups
38     expat
39     libgpg-error
40     alsa-lib
41     nspr
42     nss
43     xorg.libXrender
44     xorg.libX11
45     xorg.libXext
46     xorg.libXdamage
47     xorg.libXtst
48     xorg.libXcomposite
49     xorg.libXi
50     xorg.libXfixes
51     xorg.libXrandr
52     xorg.libXcursor
53     xorg.libxkbfile
54     xorg.libXScrnSaver
55     systemd
56     libnotify
57     xorg.libxcb
58     at-spi2-atk
59     at-spi2-core
60     libdbusmenu
61     libdrm
62     mesa
63     xorg.libxshmfence
64     libxkbcommon
65   ];
67   dontBuild = true;
68   dontConfigure = true;
70   unpackPhase = ''
71     ar p $src data.tar.xz | tar xJ ./opt/ ./usr/
72   '';
74   installPhase = ''
75     runHook preInstall
76     mkdir -p $out/bin
77     mv opt $out
78     mv usr/share $out
79     ln -s $out/opt/Rocket.Chat/rocketchat-desktop $out/bin/rocketchat-desktop
80     runHook postInstall
81   '';
83   postFixup =
84     let
85       libpath = libPathNative { packages = buildInputs; };
86     in
87     ''
88       app=$out/opt/Rocket.Chat
89       patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
90         --set-rpath "${libpath}:$app" \
91         $app/rocketchat-desktop
92       sed -i -e "s|Exec=.*$|Exec=$out/bin/rocketchat-desktop|" $out/share/applications/rocketchat-desktop.desktop
93     '';
95   meta = with lib; {
96     description = "Official Desktop client for Rocket.Chat";
97     mainProgram = "rocketchat-desktop";
98     homepage = "https://github.com/RocketChat/Rocket.Chat.Electron";
99     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
100     license = licenses.mit;
101     maintainers = with maintainers; [ gbtb ];
102     platforms = [ "x86_64-linux" ];
103   };