1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 cmake,
6 olm,
7 openssl,
8 qtbase,
9 qtmultimedia,
10 qtkeychain,
11}:
12
13let
14 isQt6 = lib.versions.major qtbase.version == "6";
15in
16stdenv.mkDerivation rec {
17 pname = "libquotient";
18 version = "0.9.1";
19
20 outputs = [
21 "out"
22 "dev"
23 ];
24
25 src = fetchFromGitHub {
26 owner = "quotient-im";
27 repo = "libQuotient";
28 rev = version;
29 hash = "sha256-R9ms3sYGdHaYKUMnZyBjw5KCik05k93vlvXMRtAXh5Y=";
30 };
31
32 nativeBuildInputs = [ cmake ];
33
34 propagatedBuildInputs = [
35 qtbase
36 qtkeychain
37 olm
38 openssl
39 qtmultimedia
40 ];
41
42 cmakeFlags = [
43 "-DQuotient_ENABLE_E2EE=ON"
44 (lib.cmakeBool "BUILD_WITH_QT6" isQt6)
45 ];
46
47 # https://github.com/quotient-im/libQuotient/issues/551
48 postPatch = ''
49 substituteInPlace Quotient.pc.in \
50 --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
51 --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
52 '';
53
54 dontWrapQtApps = true;
55
56 postInstall = ''
57 # causes cyclic dependency but is not used
58 rm $out/share/ndk-modules/Android.mk
59 '';
60
61 meta = with lib; {
62 description = "Qt5/Qt6 library to write cross-platform clients for Matrix";
63 homepage = "https://quotient-im.github.io/libQuotient/";
64 license = licenses.lgpl21;
65 maintainers = with maintainers; [
66 colemickens
67 matthiasbeyer
68 ];
69 };
70}