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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
|
{ stdenv
, lib
, pkg-config
, fetchFromGitLab
, gitUpdater
, ffmpeg_6
# for daemon
, autoreconfHook
, perl # for pod2man
, alsa-lib
, asio
, dbus
, sdbus-cpp
, fmt
, gmp
, gnutls
, http-parser
, jack
, jsoncpp
, libarchive
, libgit2
, libnatpmp
, libpulseaudio
, libupnp
, yaml-cpp
, msgpack-cxx
, openssl
, restinio
, secp256k1
, speex
, udev
, webrtc-audio-processing
, zlib
# for client
, cmake
, git
, networkmanager # for libnm
, python3
, qttools # for translations
, wrapQtAppsHook
, libnotify
, qt5compat
, qtbase
, qtdeclarative
, qrencode
, qtmultimedia
, qtnetworkauth
, qtpositioning
, qtsvg
, qtwebengine
, qtwebchannel
, wrapGAppsHook3
, withWebengine ? true
# for pjsip
, fetchFromGitHub
, pjsip
# for opendht
, opendht
}:
stdenv.mkDerivation rec {
pname = "jami";
version = "20240430.0";
src = fetchFromGitLab {
domain = "git.jami.net";
owner = "savoirfairelinux";
repo = "jami-client-qt";
rev = "stable/${version}";
hash = "sha256-v7558m2h3RqvLLhf3BdYO9LKCFKuMTtPIXgH6OXiiY4=";
fetchSubmodules = true;
};
pjsip-jami = pjsip.overrideAttrs (old: rec {
version = "797f1a38cc1066acc4adc9561aa1288afabe72d5";
src = fetchFromGitHub {
owner = "savoirfairelinux";
repo = "pjproject";
rev = version;
hash = "sha256-lTDbJF09R2G+EIkMj1YyKa4XokH9LlcIG+RhRJhzUes=";
};
configureFlags = [
"--disable-sound"
"--enable-video"
"--enable-ext-sound"
"--disable-speex-aec"
"--disable-g711-codec"
"--disable-l16-codec"
"--disable-gsm-codec"
"--disable-g722-codec"
"--disable-g7221-codec"
"--disable-speex-codec"
"--disable-ilbc-codec"
"--disable-opencore-amr"
"--disable-silk"
"--disable-sdl"
"--disable-ffmpeg"
"--disable-v4l2"
"--disable-openh264"
"--disable-resample"
"--disable-libwebrtc"
"--with-gnutls=yes"
]
++ lib.optionals stdenv.isLinux [
"--enable-epoll"
];
buildInputs = old.buildInputs ++ [ gnutls ];
});
opendht-jami = (opendht.overrideAttrs {
src = fetchFromGitHub {
owner = "savoirfairelinux";
repo = "opendht";
rev = "f2cee8e9ce24746caa7dee1847829c526d340284";
hash = "sha256-ZnIrlybF3MCiXxxv80tRzCJ5CJ54S42prGUjq1suJNA=";
};
}).override {
enableProxyServerAndClient = true;
enablePushNotifications = true;
};
dhtnet = stdenv.mkDerivation {
pname = "dhtnet";
version = "unstable-2022-04-26";
src = fetchFromGitLab {
domain = "git.jami.net";
owner = "savoirfairelinux";
repo = "dhtnet";
rev = "d7976982d24867c6faaf8103504ec8a10d932fa0";
hash = "sha256-vazFDMIu/3AWeOz0LZhZD9NFO8cd5AK41zBpqpQrqnc=";
};
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
asio
fmt
gnutls
http-parser
jsoncpp
libupnp
msgpack-cxx
opendht-jami
openssl
pjsip-jami
python3
restinio
];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=Off"
"-DBUILD_BENCHMARKS=Off"
"-DBUILD_TOOLS=Off"
"-DBUILD_TESTING=Off"
];
meta = with lib; {
description = "Lightweight Peer-to-Peer Communication Library";
license = licenses.gpl3Only;
platforms = platforms.linux;
maintainers = [ maintainers.linsui ];
};
};
daemon = stdenv.mkDerivation {
pname = "jami-daemon";
inherit src version meta;
sourceRoot = "${src.name}/daemon";
nativeBuildInputs = [
autoreconfHook
pkg-config
perl
];
buildInputs = [
alsa-lib
asio
dbus
dhtnet
sdbus-cpp
fmt
ffmpeg_6
gmp
gnutls
http-parser
jack
jsoncpp
libarchive
libgit2
libnatpmp
libpulseaudio
libupnp
yaml-cpp
msgpack-cxx
opendht-jami
openssl
pjsip-jami
restinio
secp256k1
speex
udev
webrtc-audio-processing
zlib
];
enableParallelBuilding = true;
};
qwindowkit = fetchFromGitHub {
owner = "stdware";
repo = "qwindowkit";
rev = "79b1f3110754f9c21af2d7dacbd07b1a9dbaf6ef";
hash = "sha256-iZfmv3ADVjHf47HPK/FdrfeAzrXbxbjH3H5MFVg/ZWE=";
fetchSubmodules = true;
};
postPatch = ''
sed -i -e '/GIT_REPOSITORY/,+1c SOURCE_DIR ''${CMAKE_CURRENT_SOURCE_DIR}/qwindowkit' extras/build/cmake/contrib_tools.cmake
sed -i -e 's/if(DISTRO_NEEDS_QMSETUP_PATCH)/if(TRUE)/' CMakeLists.txt
cp -R --no-preserve=mode,ownership ${qwindowkit} qwindowkit
'';
preConfigure = ''
echo 'const char VERSION_STRING[] = "${version}";' > src/app/version.h
# Currently the daemon is still built seperately but jami expects it in CMAKE_INSTALL_PREFIX
# This can be removed in future versions when JAMICORE_AS_SUBDIR is on
mkdir -p $out
ln -s ${daemon} $out/daemon
'';
dontWrapGApps = true;
nativeBuildInputs = [
wrapGAppsHook3
wrapQtAppsHook
pkg-config
cmake
git
python3
qttools
];
buildInputs = [
ffmpeg_6
libnotify
networkmanager
qtbase
qt5compat
qrencode
qtnetworkauth
qtdeclarative
qtmultimedia
qtpositioning
qtsvg
qtwebchannel
] ++ lib.optionals withWebengine [
qtwebengine
];
cmakeFlags = 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"
];
preFixup = ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
passthru.updateScript = gitUpdater {
rev-prefix = "stable/";
};
meta = with lib; {
homepage = "https://jami.net/";
description = "The free and universal communication platform that respects the privacy and freedoms of its users";
mainProgram = "jami";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = [ maintainers.linsui ];
};
}
|