summaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/libquotient/default.nix
blob: bc65f028b7499549e98fc5ebd0f02748ab8cf365 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
  stdenv,
  lib,
  fetchFromGitHub,
  fetchpatch,
  cmake,
  olm,
  openssl,
  qtbase,
  qtmultimedia,
  qtkeychain,
}:

stdenv.mkDerivation rec {
  pname = "libquotient";
  version = "0.9.6.1";

  outputs = [
    "out"
    "dev"
  ];

  src = fetchFromGitHub {
    owner = "quotient-im";
    repo = "libQuotient";
    rev = version;
    hash = "sha256-ea7vOxmc4S7KizbwYp21NryW3BGh+Jn0HOR4qsA1roE=";
  };

  nativeBuildInputs = [ cmake ];

  propagatedBuildInputs = [
    qtbase
    qtkeychain
    olm
    openssl
    qtmultimedia
  ];

  cmakeFlags = [
    "-DQuotient_ENABLE_E2EE=ON"
  ];

  # https://github.com/quotient-im/libQuotient/issues/551
  postPatch = ''
    substituteInPlace Quotient.pc.in \
      --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
      --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
  '';

  dontWrapQtApps = true;

  postInstall = ''
    # causes cyclic dependency but is not used
    rm $out/share/ndk-modules/Android.mk
  '';

  meta = {
    description = "Qt5/Qt6 library to write cross-platform clients for Matrix";
    homepage = "https://quotient-im.github.io/libQuotient/";
    license = lib.licenses.lgpl21;
    maintainers = with lib.maintainers; [
      matthiasbeyer
    ];
  };
}