2022-05-10 12:48:48 +02:00
|
|
|
{ stdenv, lib, fetchurl, autoPatchelfHook, dpkg, wrapGAppsHook, makeWrapper, nixosTests
|
2022-02-11 15:07:44 +01:00
|
|
|
, gtk3, atk, at-spi2-atk, cairo, pango, gdk-pixbuf, glib, freetype, fontconfig
|
2018-06-01 14:53:30 +02:00
|
|
|
, dbus, libX11, xorg, libXi, libXcursor, libXdamage, libXrandr, libXcomposite
|
2021-06-10 04:57:09 +02:00
|
|
|
, libXext, libXfixes, libXrender, libXtst, libXScrnSaver, nss, nspr, alsa-lib
|
2021-04-09 10:50:31 +02:00
|
|
|
, cups, expat, libuuid, at-spi2-core, libappindicator-gtk3, mesa
|
2020-08-23 21:46:37 +02:00
|
|
|
# Runtime dependencies:
|
2022-02-17 13:01:47 +01:00
|
|
|
, systemd, libnotify, libdbusmenu, libpulseaudio, xdg-utils
|
2017-11-07 13:26:45 +01:00
|
|
|
}:
|
2018-06-01 14:53:30 +02:00
|
|
|
|
2022-06-30 16:27:38 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2020-01-17 22:51:06 +01:00
|
|
|
pname = "signal-desktop";
|
2022-11-03 21:56:23 +01:00
|
|
|
version = "5.63.0"; # Please backport all updates to the stable channel.
|
2020-01-17 22:51:06 +01:00
|
|
|
# All releases have a limited lifetime and "expire" 90 days after the release.
|
|
|
|
# When releases "expire" the application becomes unusable until an update is
|
|
|
|
# applied. The expiration date for the current release can be extracted with:
|
|
|
|
# $ grep -a "^{\"buildExpiration" "${signal-desktop}/lib/Signal/resources/app.asar"
|
|
|
|
# (Alternatively we could try to patch the asar archive, but that requires a
|
|
|
|
# few additional steps and might not be the best idea.)
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
|
2022-11-03 21:56:23 +01:00
|
|
|
sha256 = "sha256-f8gQUnmI/VU0FteoMVY0k0RK1R7Ho7JRx+WoMhKki4s=";
|
2020-01-17 22:51:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
|
|
|
dpkg
|
2022-05-10 16:03:29 +02:00
|
|
|
(wrapGAppsHook.override { inherit makeWrapper; })
|
2020-01-17 22:51:06 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-06-10 04:57:09 +02:00
|
|
|
alsa-lib
|
2018-11-27 20:03:36 +01:00
|
|
|
at-spi2-atk
|
2019-09-05 23:49:47 +02:00
|
|
|
at-spi2-core
|
2020-01-17 22:51:06 +01:00
|
|
|
atk
|
2017-11-07 13:26:45 +01:00
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2019-05-22 13:03:39 +02:00
|
|
|
gdk-pixbuf
|
2017-11-07 13:26:45 +01:00
|
|
|
glib
|
2018-06-01 02:50:37 +02:00
|
|
|
gtk3
|
2017-11-07 13:26:45 +01:00
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXtst
|
2020-01-17 22:51:06 +01:00
|
|
|
libappindicator-gtk3
|
|
|
|
libnotify
|
|
|
|
libuuid
|
2021-04-09 10:50:31 +02:00
|
|
|
mesa # for libgbm
|
2017-11-07 13:26:45 +01:00
|
|
|
nspr
|
|
|
|
nss
|
2020-01-17 22:51:06 +01:00
|
|
|
pango
|
|
|
|
systemd
|
2018-03-13 11:16:03 +01:00
|
|
|
xorg.libxcb
|
2021-05-12 19:38:31 +02:00
|
|
|
xorg.libxshmfence
|
2017-11-07 13:26:45 +01:00
|
|
|
];
|
|
|
|
|
2020-01-17 22:51:06 +01:00
|
|
|
runtimeDependencies = [
|
2020-08-12 20:13:30 +02:00
|
|
|
(lib.getLib systemd)
|
2022-06-27 01:40:31 +02:00
|
|
|
libappindicator-gtk3
|
2020-02-12 23:31:31 +01:00
|
|
|
libnotify
|
2020-08-23 21:46:37 +02:00
|
|
|
libdbusmenu
|
2022-02-17 13:01:47 +01:00
|
|
|
xdg-utils
|
2020-01-17 22:51:06 +01:00
|
|
|
];
|
2017-11-07 13:26:45 +01:00
|
|
|
|
2018-06-01 14:53:30 +02:00
|
|
|
unpackPhase = "dpkg-deb -x $src .";
|
2017-11-07 13:26:45 +01:00
|
|
|
|
2020-01-17 22:51:06 +01:00
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontPatchELF = true;
|
2020-01-24 13:21:04 +01:00
|
|
|
# We need to run autoPatchelf manually with the "no-recurse" option, see
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/78413 for the reasons.
|
|
|
|
dontAutoPatchelf = true;
|
2017-11-07 13:26:45 +01:00
|
|
|
|
2020-01-17 22:51:06 +01:00
|
|
|
installPhase = ''
|
2021-04-13 13:42:44 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-01-17 22:51:06 +01:00
|
|
|
mkdir -p $out/lib
|
2017-11-07 13:26:45 +01:00
|
|
|
|
2020-01-17 22:51:06 +01:00
|
|
|
mv usr/share $out/share
|
2020-01-24 13:21:04 +01:00
|
|
|
mv opt/Signal $out/lib/Signal
|
|
|
|
|
|
|
|
# Note: The following path contains bundled libraries:
|
|
|
|
# $out/lib/Signal/resources/app.asar.unpacked/node_modules/sharp/vendor/lib/
|
|
|
|
# We run autoPatchelf with the "no-recurse" option to avoid picking those
|
|
|
|
# up, but resources/app.asar still requires them.
|
2018-06-01 14:53:30 +02:00
|
|
|
|
|
|
|
# Symlink to bin
|
|
|
|
mkdir -p $out/bin
|
2021-08-16 13:02:11 +02:00
|
|
|
ln -s $out/lib/Signal/signal-desktop $out/bin/signal-desktop
|
2021-04-13 13:42:44 +02:00
|
|
|
|
signal-desktop: Fix "Failed to load GLES library: libGLESv2.so.2"
A new symlink is required to fix the following error:
[3744707:0100/000000.911609:ERROR:egl_util.cc(74)] Failed to load GLES library: libGLESv2.so.2: libGLESv2.so.2: cannot open shared object file: No such file or directory
zsh: segmentation fault (core dumped) signal-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland
The GPU acceleration still fails (not sure if it worked before) but at least
"signal-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland"
launches again (without "--disable-gpu"):
[40492:0115/184719.611780:ERROR:gpu_process_host.cc(968)] GPU process exited unexpectedly: exit_code=139
[40492:0115/184720.256775:ERROR:gpu_process_host.cc(968)] GPU process exited unexpectedly: exit_code=139
[40492:0115/184720.892093:ERROR:gpu_process_host.cc(968)] GPU process exited unexpectedly: exit_code=139
[40620:0115/184721.033949:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
[40620:0115/184721.069600:ERROR:gl_utils.cc(318)] [.RendererMainThread-0x227200113f00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[40620:0115/184721.133265:ERROR:gl_utils.cc(318)] [.RendererMainThread-0x227200113f00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[40620:0115/184721.158341:ERROR:gl_utils.cc(318)] [.RendererMainThread-0x227200113f00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
(After three GPU process crashes Chromium should automatically fall back
to software rendering.)
Fix #155050 (it only fixes the crashes though, not the underlying
issue, but that's likely all we can do for the moment as other Linux
distributions are affected as well; Ozone/Wayland is just not stable yet)
2022-01-13 21:06:30 +01:00
|
|
|
# Create required symlinks:
|
|
|
|
ln -s libGLESv2.so $out/lib/Signal/libGLESv2.so.2
|
|
|
|
|
2021-04-13 13:42:44 +02:00
|
|
|
runHook postInstall
|
2020-01-17 22:51:06 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
2021-01-15 06:42:41 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ] }"
|
2022-09-23 21:19:37 +02:00
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
|
2022-02-17 13:01:47 +01:00
|
|
|
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
|
2020-01-17 22:51:06 +01:00
|
|
|
)
|
2017-11-07 13:26:45 +01:00
|
|
|
|
2018-06-01 14:53:30 +02:00
|
|
|
# Fix the desktop link
|
|
|
|
substituteInPlace $out/share/applications/signal-desktop.desktop \
|
|
|
|
--replace /opt/Signal/signal-desktop $out/bin/signal-desktop
|
2020-01-24 13:21:04 +01:00
|
|
|
|
|
|
|
autoPatchelf --no-recurse -- $out/lib/Signal/
|
2021-05-26 15:09:14 +02:00
|
|
|
patchelf --add-needed ${libpulseaudio}/lib/libpulse.so $out/lib/Signal/resources/app.asar.unpacked/node_modules/ringrtc/build/linux/libringrtc-x64.node
|
2018-06-01 14:53:30 +02:00
|
|
|
'';
|
|
|
|
|
2020-04-28 13:59:05 +02:00
|
|
|
# Tests if the application launches and waits for "Link your phone to Signal Desktop":
|
|
|
|
passthru.tests.application-launch = nixosTests.signal-desktop;
|
|
|
|
|
2018-06-01 14:53:30 +02:00
|
|
|
meta = {
|
|
|
|
description = "Private, simple, and secure messenger";
|
|
|
|
longDescription = ''
|
|
|
|
Signal Desktop is an Electron application that links with your
|
|
|
|
"Signal Android" or "Signal iOS" app.
|
|
|
|
'';
|
2020-03-05 11:57:38 +01:00
|
|
|
homepage = "https://signal.org/";
|
|
|
|
changelog = "https://github.com/signalapp/Signal-Desktop/releases/tag/v${version}";
|
2021-04-13 13:42:44 +02:00
|
|
|
license = lib.licenses.agpl3Only;
|
2022-03-06 17:57:44 +01:00
|
|
|
maintainers = with lib.maintainers; [ mic92 equirosa ];
|
2018-06-01 14:53:30 +02:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2022-06-13 19:43:07 +02:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
2018-06-01 14:53:30 +02:00
|
|
|
};
|
|
|
|
}
|