summary refs log tree commit diff
path: root/modules/packages/nheko-git.nix
blob: dac42c991a63e85588dc14bb51d5e4e79c0aee36 (plain) (blame)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# This file was copied from NUR: https://github.com/nix-community/nur-combined/blob/master/repos/deeunderscore/pkgs/nheko/default.nix#L93
# This file is a modified version of nixpkgs/pkgs/applications/networking/instant-messengers/nheko/default.nix (copied at 2e896fce)

{ lib
, stdenv
, fetchFromGitHub
, cmake
#, wrapQtAppsHook
, asciidoctor
, qt6
, qt6Packages
#, qtmultimedia
#, qtimageformats
#, qtkeychain
, cmark
, coeurl
, curl
, libevent
, lmdb
, lmdbxx
#, mtxclient
, nlohmann_json
, olm
, pkg-config
, re2
, spdlog
, httplib
, voipSupport ? true
, gst_all_1
, libnice
, pkgs
, nhekoSrc
, mtxclientSrc
}:

stdenv.mkDerivation {
  pname = "nheko";
  version = "git+master";
  src = nhekoSrc;

  nativeBuildInputs = [
    lmdbxx
    cmake
    pkg-config
    asciidoctor
    qt6.wrapQtAppsHook
  ];

  buildInputs = [
    qt6.qtbase
    qt6.qttools
    qt6.qtsvg
    qt6.qtmultimedia
    qt6.qtimageformats
    qt6Packages.qtkeychain
    cmark
    coeurl
    curl
    libevent
    lmdb
    (pkgs.callPackage ./mtxclient-git.nix { inherit mtxclientSrc; })
    nlohmann_json
    olm
    re2
    spdlog
    httplib
  ] ++ lib.optionals voipSupport (with gst_all_1; [
    gstreamer
    gst-plugins-base
    (gst-plugins-good.override { qt5Support = true; })
    gst-plugins-bad
    libnice
  ]);

  LC_ALL = lib.optionalString (!stdenv.isDarwin) "C.UTF-8";

  cmakeFlags = [
    "-DCOMPILE_QML=ON" # see https://github.com/Nheko-Reborn/nheko/issues/389
    "-DCMAKE_BUILD_TYPE=Release"
    "-DBUILD_SHARED_LIBS=OFF"
  ];


  preFixup = lib.optionalString voipSupport ''
    # add gstreamer plugins path to the wrapper
    qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
  '';

  meta = with lib; {
    description = "Desktop client for the Matrix protocol";
    homepage = "https://github.com/Nheko-Reborn/nheko";
    platforms = platforms.all;
    license = licenses.gpl3Plus;
  };
}