From 13d4678f73f10d199be768d05df55fb68ca94731 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Mon, 4 Nov 2024 17:26:36 +0100 Subject: [PATCH] mautrix-signal: fix build with goolm enabled When building with goolm support, libstdc++ must be linked, as libsignal-ffi depends on it being linked. When building with (deprecated) libolm, it's pulled in transitively, it seems -- and it that case, this is effectively a no-op. Signed-off-by: Christoph Heiss --- pkgs/servers/mautrix-signal/default.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pkgs/servers/mautrix-signal/default.nix b/pkgs/servers/mautrix-signal/default.nix index 0b21bd539d1d..2d657d23aeb5 100644 --- a/pkgs/servers/mautrix-signal/default.nix +++ b/pkgs/servers/mautrix-signal/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildGoModule, fetchFromGitHub, fetchpatch, @@ -32,13 +33,19 @@ buildGoModule rec { }) ]; - buildInputs = (lib.optional (!withGoolm) olm) ++ [ - # must match the version used in https://github.com/mautrix/signal/tree/main/pkg/libsignalgo - # see https://github.com/mautrix/signal/issues/401 - libsignal-ffi - ]; + buildInputs = + (lib.optional (!withGoolm) olm) + ++ (lib.optional withGoolm stdenv.cc.cc.lib) + ++ [ + # must match the version used in https://github.com/mautrix/signal/tree/main/pkg/libsignalgo + # see https://github.com/mautrix/signal/issues/401 + libsignal-ffi + ]; + tags = lib.optional withGoolm "goolm"; + CGO_LDFLAGS = lib.optional withGoolm [ "-lstdc++" ]; + vendorHash = "sha256-bKQKO5RqgMrWq7NyNF1rj2CLp5SeBP80HWxF8MWnZ1U="; doCheck = false;