about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/jami/client.nix
blob: 2ce1aba4af55d4a7d757655cfcac06ddf567e5e2 (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
{ version
, src
, jami-meta
, lib
, fetchpatch
, stdenv
, pkg-config
, cmake
, networkmanager # for libnm
, python3
, qttools # for translations
, wrapQtAppsHook
, ffmpeg-jami
, jami-daemon
, libnotify
, qt5compat
, qtbase
, qtdeclarative
, qrencode
, qtmultimedia
, qtnetworkauth
, qtsvg
, qtwebengine
, qtwebchannel
, withWebengine ? true
}:

stdenv.mkDerivation {
  pname = "jami-client";
  inherit version src;

  sourceRoot = "source/client-qt";

  patches = [
    (fetchpatch {
      name = "fix-build-without-webengine.patch";
      url = "https://git.jami.net/savoirfairelinux/jami-client-qt/-/commit/9b2dbb64eaa9256f800dfa69d897545f4b0affd2.patch";
      hash = "sha256-lgDlSlXIjtdymBa7xSe1PabSK9DnSG5KnJggOLWyn+A=";
    })
  ];

  preConfigure = ''
    echo 'const char VERSION_STRING[] = "${version}";' > src/app/version.h
  '';

  nativeBuildInputs = [
    wrapQtAppsHook
    pkg-config
    cmake
    python3
    qttools
  ];

  buildInputs = [
    ffmpeg-jami
    jami-daemon
    libnotify
    networkmanager
    qtbase
    qt5compat
    qrencode
    qtnetworkauth
    qtdeclarative
    qtmultimedia
    qtsvg
    qtwebchannel
  ] ++ lib.optionals withWebengine [
    qtwebengine
  ];

  cmakeFlags = [
    "-DLIBJAMI_INCLUDE_DIR=${jami-daemon}/include/jami"
    "-DLIBJAMI_XML_INTERFACES_DIR=${jami-daemon}/share/dbus-1/interfaces"
  ] ++ lib.optionals (!withWebengine) [
    "-DWITH_WEBENGINE=false"
  ];

  qtWrapperArgs = [
    # With wayland the titlebar is not themed and the wmclass is wrong.
    "--set-default QT_QPA_PLATFORM xcb"
  ];

  meta = jami-meta // {
    description = "The client based on QT" + jami-meta.description;
  };
}