Unverified Commit 13d4678f authored by Christoph Heiss's avatar Christoph Heiss
Browse files

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: default avatarChristoph Heiss <christoph@c8h4.io>
parent b5394df7
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildGoModule,
  fetchFromGitHub,
  fetchpatch,
@@ -32,13 +33,19 @@ buildGoModule rec {
    })
  ];

  buildInputs = (lib.optional (!withGoolm) olm) ++ [
  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;