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 <christoph@c8h4.io>
This commit is contained in:
Christoph Heiss
2024-11-08 11:12:32 +01:00
parent b5394df77e
commit 13d4678f73
+12 -5
View File
@@ -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;