bottom: add gpu recognition, new apple sdk, refactor (#360568)
[NixPkgs.git] / pkgs / development / libraries / libquotient / default.nix
blob7964b19391bbf0fc77b9f40724d721da15fa501f
2   stdenv,
3   lib,
4   fetchFromGitHub,
5   cmake,
6   olm,
7   openssl,
8   qtbase,
9   qtmultimedia,
10   qtkeychain,
13 let
14   isQt6 = lib.versions.major qtbase.version == "6";
16 stdenv.mkDerivation rec {
17   pname = "libquotient";
18   version = "0.9.1";
20   outputs = [
21     "out"
22     "dev"
23   ];
25   src = fetchFromGitHub {
26     owner = "quotient-im";
27     repo = "libQuotient";
28     rev = version;
29     hash = "sha256-R9ms3sYGdHaYKUMnZyBjw5KCik05k93vlvXMRtAXh5Y=";
30   };
32   nativeBuildInputs = [ cmake ];
34   propagatedBuildInputs = [
35     qtbase
36     qtkeychain
37     olm
38     openssl
39     qtmultimedia
40   ];
42   cmakeFlags = [
43     "-DQuotient_ENABLE_E2EE=ON"
44     (lib.cmakeBool "BUILD_WITH_QT6" isQt6)
45   ];
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   '';
54   dontWrapQtApps = true;
56   postInstall = ''
57     # causes cyclic dependency but is not used
58     rm $out/share/ndk-modules/Android.mk
59   '';
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   };