diff --git a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix new file mode 100644 index 000000000000..0376fb79c9be --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix @@ -0,0 +1,88 @@ +{ stdenv, lib, fetchurl, dpkg, gnome2, atk, cairo, gdk_pixbuf, glib, freetype, +fontconfig, dbus, libX11, xlibs, 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 + gnome2.GConf + gnome2.gtk + gnome2.pango + libX11 + libXScrnSaver + libXcomposite + libXcursor + libXdamage + libXext + libXfixes + libXi + libXrandr + libXrender + libXtst + nspr + nss + stdenv.cc.cc + udev + xlibs.libxcb + ]; + +in + stdenv.mkDerivation rec { + name = "signal-desktop-${version}"; + + version = "1.0.35"; + + 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"; + sha256 = "d9f9d4d54f4121efc8eadf1cf0ff957828088b313e53b66dc540b851c44c1860"; + } + else + throw "Signal for Desktop is not currently supported on ${stdenv.system}"; + + phases = [ "unpackPhase" "installPhase" ]; + nativeBuildInputs = [ dpkg ]; + 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 + + # 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."; + homepage = https://signal.org/; + license = lib.licenses.gpl3; + platforms = [ + "x86_64-linux" + ]; + }; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 94522d50e46d..a99e007f7337 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4379,6 +4379,8 @@ with pkgs; sigil = libsForQt56.callPackage ../applications/editors/sigil { }; + signal-desktop = callPackage ../applications/networking/instant-messengers/signal-desktop { }; + # aka., pgp-tools signing-party = callPackage ../tools/security/signing-party { };