2018-06-01 13:22:07 +01:00
|
|
|
{ stdenv, lib, fetchurl, dpkg, wrapGAppsHook, gnome3, gtk3, atk, cairo, pango, gdk_pixbuf, glib, freetype,
|
2018-03-13 10:16:03 +00:00
|
|
|
fontconfig, dbus, libX11, xorg, libXi, libXcursor, libXdamage, libXrandr,
|
2017-11-07 12:26:45 +00:00
|
|
|
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-05-28 11:53:20 +01:00
|
|
|
gnome3.gconf
|
2018-06-01 01:50:37 +01:00
|
|
|
gtk3
|
2018-05-28 11:53:20 +01:00
|
|
|
pango
|
2017-11-07 12:26:45 +00:00
|
|
|
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
|
2017-11-07 12:26:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "signal-desktop-${version}";
|
|
|
|
|
2018-06-01 01:50:37 +01:00
|
|
|
version = "1.12.0";
|
2017-11-07 12:26:45 +00:00
|
|
|
|
|
|
|
src =
|
|
|
|
if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
|
|
|
url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
|
2018-06-01 01:50:37 +01:00
|
|
|
sha256 = "19c9pilx2qkpyqw3p167bfcizrpd4np5jxdcwqmpbcfibmrpmcsk";
|
2017-11-07 12:26:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
throw "Signal for Desktop is not currently supported on ${stdenv.system}";
|
|
|
|
|
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
2018-06-01 13:22:07 +01:00
|
|
|
nativeBuildInputs = [ dpkg wrapGAppsHook ];
|
2017-11-07 12:26:45 +00:00
|
|
|
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
|
2018-06-01 13:22:07 +01:00
|
|
|
wrapProgram $out/libexec/signal-desktop \
|
|
|
|
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
|
|
|
"''${gappsWrapperArgs[@]}"
|
2017-11-07 12:26:45 +00:00
|
|
|
|
|
|
|
# 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 = "Signal Private Messenger for the Desktop.";
|
2017-11-22 22:57:36 +00:00
|
|
|
homepage = https://signal.org/;
|
|
|
|
license = lib.licenses.gpl3;
|
2018-05-02 19:57:11 +01:00
|
|
|
maintainers = with lib.maintainers; [ ixmatus primeos ];
|
2017-11-22 22:57:36 +00:00
|
|
|
platforms = [
|
2017-11-07 12:26:45 +00:00
|
|
|
"x86_64-linux"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|