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

94 lines
2.3 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, dpkg, wrapGAppsHook
2018-07-09 23:34:32 +01:00
, gnome2, gtk3, atk, cairo, pango, gdk_pixbuf, glib, freetype, fontconfig
, dbus, libX11, xorg, libXi, libXcursor, libXdamage, libXrandr, libXcomposite
, libXext, libXfixes, libXrender, libXtst, libXScrnSaver, nss, nspr, alsaLib
, cups, expat, udev
}:
let
rpath = lib.makeLibraryPath [
alsaLib
atk
cairo
cups
dbus
expat
fontconfig
freetype
gdk_pixbuf
glib
2018-07-09 23:34:32 +01:00
gnome2.GConf
2018-06-01 01:50:37 +01:00
gtk3
pango
libX11
libXScrnSaver
libXcomposite
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXtst
nspr
nss
stdenv.cc.cc
udev
2018-03-13 10:16:03 +00:00
xorg.libxcb
];
in stdenv.mkDerivation rec {
name = "signal-desktop-${version}";
2018-07-14 18:58:46 +01:00
version = "1.14.1";
src = fetchurl {
url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
2018-07-14 18:58:46 +01:00
sha256 = "1f54azqdfqa2yrzlp9b7pz7nswl5n3pgln38yxcvb3y5k6x0ljqp";
};
phases = [ "unpackPhase" "installPhase" ];
nativeBuildInputs = [ dpkg wrapGAppsHook ];
unpackPhase = "dpkg-deb -x $src .";
installPhase = ''
mkdir -p $out
cp -R opt $out
mv ./usr/share $out/share
mv $out/opt/Signal $out/libexec
rmdir $out/opt
chmod -R g-w $out
# Patch signal
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath ${rpath}:$out/libexec $out/libexec/signal-desktop
wrapProgram $out/libexec/signal-desktop \
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
"''${gappsWrapperArgs[@]}"
# Symlink to bin
mkdir -p $out/bin
ln -s $out/libexec/signal-desktop $out/bin/signal-desktop
# Fix the desktop link
substituteInPlace $out/share/applications/signal-desktop.desktop \
--replace /opt/Signal/signal-desktop $out/bin/signal-desktop
'';
meta = {
description = "Private, simple, and secure messenger";
longDescription = ''
Signal Desktop is an Electron application that links with your
"Signal Android" or "Signal iOS" app.
'';
homepage = https://signal.org/;
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ ixmatus primeos ];
platforms = [ "x86_64-linux" ];
};
}