3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/instant-messengers/rocketchat-desktop/default.nix

97 lines
2.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, pkgs, fetchurl, wrapGAppsHook }:
2021-10-11 14:06:14 +01:00
let
libPathNative = { packages }: lib.makeLibraryPath packages;
in
stdenv.mkDerivation rec {
pname = "rocketchat-desktop";
2022-01-01 05:28:38 +00:00
version = "3.7.4";
2021-10-11 14:06:14 +01:00
src = fetchurl {
url = "https://github.com/RocketChat/Rocket.Chat.Electron/releases/download/${version}/rocketchat_${version}_amd64.deb";
2022-01-01 05:28:38 +00:00
sha256 = "sha256-yYUMVMSGUMAXbBm40jNCaFusWsWxoIgLDeAwNqSewX8=";
2021-10-11 14:06:14 +01:00
};
nativeBuildInputs = [
wrapGAppsHook #to fully work with gnome also needs programs.dconf.enable = true in your configuration.nix
];
2021-11-17 12:29:43 +00:00
2021-10-11 14:06:14 +01:00
buildInputs = with pkgs; [
gtk3
stdenv.cc.cc
zlib
glib
dbus
atk
pango
freetype
libgnome-keyring3
fontconfig
gdk-pixbuf
cairo
cups
expat
libgpg-error
2021-10-11 14:06:14 +01:00
alsa-lib
nspr
nss
xorg.libXrender
xorg.libX11
xorg.libXext
xorg.libXdamage
xorg.libXtst
xorg.libXcomposite
xorg.libXi
xorg.libXfixes
xorg.libXrandr
xorg.libXcursor
xorg.libxkbfile
xorg.libXScrnSaver
systemd
libnotify
xorg.libxcb
at-spi2-atk
at-spi2-core
libdbusmenu
libdrm
mesa
xorg.libxshmfence
libxkbcommon
];
dontBuild = true;
dontConfigure = true;
unpackPhase = ''
ar p $src data.tar.xz | tar xJ ./opt/ ./usr/
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mv opt $out
mv usr/share $out
ln -s $out/opt/Rocket.Chat/rocketchat-desktop $out/bin/rocketchat-desktop
runHook postInstall
'';
postFixup =
let
libpath = libPathNative { packages = buildInputs; };
in
''
app=$out/opt/Rocket.Chat
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${libpath}:$app" \
$app/rocketchat-desktop
sed -i -e "s|Exec=.*$|Exec=$out/bin/rocketchat-desktop|" $out/share/applications/rocketchat-desktop.desktop
'';
meta = with lib; {
description = "Official Desktop client for Rocket.Chat";
homepage = "https://github.com/RocketChat/Rocket.Chat.Electron";
license = licenses.mit;
maintainers = with maintainers; [ gbtb ];
platforms = platforms.x86_64;
};
}