vscode-extensions.saoudrizwan.claude-dev: 3.1.11 -> 3.2.5 (#375877)
[NixPkgs.git] / pkgs / applications / networking / instant-messengers / jami / default.nix
blobba1c6d69c01c4cbe395973128ffee55d55e178d4
2   stdenv,
3   lib,
4   pkg-config,
5   fetchFromGitLab,
6   gitUpdater,
7   ffmpeg_6,
9   # for daemon
10   autoreconfHook,
11   perl, # for pod2man
12   alsa-lib,
13   asio,
14   dbus,
15   sdbus-cpp,
16   fmt,
17   gmp,
18   gnutls,
19   llhttp,
20   jack,
21   jsoncpp,
22   libarchive,
23   libgit2,
24   libnatpmp,
25   libpulseaudio,
26   libupnp,
27   msgpack-cxx,
28   openssl,
29   restinio,
30   secp256k1,
31   speex,
32   udev,
33   webrtc-audio-processing,
34   yaml-cpp,
35   zlib,
37   # for dhtnet
38   expected-lite,
40   # for client
41   cmake,
42   git,
43   networkmanager, # for libnm
44   python3,
45   qttools, # for translations
46   wrapQtAppsHook,
47   libnotify,
48   qt5compat,
49   qtbase,
50   qtdeclarative,
51   qrencode,
52   qtmultimedia,
53   qtnetworkauth,
54   qtpositioning,
55   qtsvg,
56   qtwebengine,
57   qtwebchannel,
58   wrapGAppsHook3,
59   withWebengine ? true,
61   # for pjsip
62   fetchFromGitHub,
63   pjsip,
65   # for opendht
66   opendht,
69 stdenv.mkDerivation rec {
70   pname = "jami";
71   version = "20241031.0";
73   src = fetchFromGitLab {
74     domain = "git.jami.net";
75     owner = "savoirfairelinux";
76     repo = "jami-client-qt";
77     rev = "stable/${version}";
78     hash = "sha256-LKezdzM+ltUSgW4GmTXICyufx9mI1AVbdEcwSp6tmao=";
79     fetchSubmodules = true;
80   };
82   pjsip-jami = pjsip.overrideAttrs (old: rec {
83     version = "8fc165b833eea6e3c88d67a541385424b129fd3f";
85     src = fetchFromGitHub {
86       owner = "savoirfairelinux";
87       repo = "pjproject";
88       rev = version;
89       hash = "sha256-uA6ZJYUgAu3cK4CKCGtqaI0KPM/0szExPS2pCOflz5A=";
90     };
92     configureFlags = [
93       "--disable-sound"
94       "--enable-video"
95       "--enable-ext-sound"
96       "--disable-speex-aec"
97       "--disable-g711-codec"
98       "--disable-l16-codec"
99       "--disable-gsm-codec"
100       "--disable-g722-codec"
101       "--disable-g7221-codec"
102       "--disable-speex-codec"
103       "--disable-ilbc-codec"
104       "--disable-opencore-amr"
105       "--disable-silk"
106       "--disable-sdl"
107       "--disable-ffmpeg"
108       "--disable-v4l2"
109       "--disable-openh264"
110       "--disable-resample"
111       "--disable-libwebrtc"
112       "--with-gnutls=yes"
113     ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "--enable-epoll" ];
115     buildInputs = old.buildInputs ++ [ gnutls ];
116   });
118   opendht-jami =
119     (opendht.overrideAttrs {
120       src = fetchFromGitHub {
121         owner = "savoirfairelinux";
122         repo = "opendht";
123         rev = "074e05cc3254d5d73b0d96ee772a6e01bb3113e5";
124         hash = "sha256-WuaURlC7eDDxvnM3YuyU9CNrwnE4WBQUIEw3z/0zjN8=";
125       };
126     }).override
127       {
128         enableProxyServerAndClient = true;
129         enablePushNotifications = true;
130       };
132   dhtnet = stdenv.mkDerivation {
133     pname = "dhtnet";
134     version = "unstable-2024-07-22";
136     src = fetchFromGitLab {
137       domain = "git.jami.net";
138       owner = "savoirfairelinux";
139       repo = "dhtnet";
140       rev = "8cd00200669fa5b7632faa447ba206c3847e2879";
141       hash = "sha256-SGidaCi5z7hO0ePJIZIkcWAkb+cKsZTdksVS7ldpjME=";
142     };
144     postPatch = ''
145       substituteInPlace dependencies/build.py \
146         --replace-fail \
147         "wget https://raw.githubusercontent.com/martinmoene/expected-lite/master/include/nonstd/expected.hpp -O" \
148         "cp ${expected-lite}/include/nonstd/expected.hpp"
149     '';
151     nativeBuildInputs = [
152       cmake
153       pkg-config
154     ];
156     buildInputs = [
157       asio
158       fmt
159       gnutls
160       llhttp
161       jsoncpp
162       libupnp
163       msgpack-cxx
164       opendht-jami
165       openssl
166       pjsip-jami
167       python3
168       restinio
169     ];
171     cmakeFlags = [
172       "-DBUILD_SHARED_LIBS=Off"
173       "-DBUILD_BENCHMARKS=Off"
174       "-DBUILD_TOOLS=Off"
175       "-DBUILD_TESTING=Off"
176       "-DBUILD_DEPENDENCIES=Off"
177       "-DBUILD_EXAMPLE=Off"
178     ];
180     meta = with lib; {
181       description = "Lightweight Peer-to-Peer Communication Library";
182       license = licenses.gpl3Only;
183       platforms = platforms.linux;
184       maintainers = [ maintainers.linsui ];
185     };
186   };
188   daemon = stdenv.mkDerivation {
189     pname = "jami-daemon";
190     inherit src version meta;
191     sourceRoot = "${src.name}/daemon";
193     # Fix for libgit2 breaking changes
194     postPatch = ''
195       substituteInPlace src/jamidht/conversationrepository.cpp \
196         --replace-fail "git_commit* const" "const git_commit*"
197     '';
199     nativeBuildInputs = [
200       autoreconfHook
201       pkg-config
202       perl
203     ];
205     buildInputs = [
206       alsa-lib
207       asio
208       dbus
209       dhtnet
210       sdbus-cpp
211       fmt
212       ffmpeg_6
213       gmp
214       gnutls
215       llhttp
216       jack
217       jsoncpp
218       libarchive
219       libgit2
220       libnatpmp
221       libpulseaudio
222       libupnp
223       msgpack-cxx
224       opendht-jami
225       openssl
226       pjsip-jami
227       restinio
228       secp256k1
229       speex
230       udev
231       webrtc-audio-processing
232       yaml-cpp
233       zlib
234     ];
236     enableParallelBuilding = true;
237   };
239   qwindowkit = fetchFromGitHub {
240     owner = "stdware";
241     repo = "qwindowkit";
242     rev = "79b1f3110754f9c21af2d7dacbd07b1a9dbaf6ef";
243     hash = "sha256-iZfmv3ADVjHf47HPK/FdrfeAzrXbxbjH3H5MFVg/ZWE=";
244     fetchSubmodules = true;
245   };
247   postPatch = ''
248     sed -i -e '/GIT_REPOSITORY/,+1c SOURCE_DIR ''${CMAKE_CURRENT_SOURCE_DIR}/qwindowkit' extras/build/cmake/contrib_tools.cmake
249     sed -i -e 's/if(DISTRO_NEEDS_QMSETUP_PATCH)/if(TRUE)/' CMakeLists.txt
250     cp -R --no-preserve=mode,ownership ${qwindowkit} qwindowkit
251   '';
253   preConfigure = ''
254     echo 'const char VERSION_STRING[] = "${version}";' > src/app/version.h
255     # Currently the daemon is still built seperately but jami expects it in CMAKE_INSTALL_PREFIX
256     # This can be removed in future versions when JAMICORE_AS_SUBDIR is on
257     mkdir -p $out
258     ln -s ${daemon} $out/daemon
259   '';
261   dontWrapGApps = true;
263   nativeBuildInputs = [
264     wrapGAppsHook3
265     wrapQtAppsHook
266     pkg-config
267     cmake
268     git
269     python3
270     qttools
271   ];
273   buildInputs = [
274     ffmpeg_6
275     libnotify
276     networkmanager
277     qtbase
278     qt5compat
279     qrencode
280     qtnetworkauth
281     qtdeclarative
282     qtmultimedia
283     qtpositioning
284     qtsvg
285     qtwebchannel
286   ] ++ lib.optionals withWebengine [ qtwebengine ];
288   cmakeFlags = lib.optionals (!withWebengine) [ "-DWITH_WEBENGINE=false" ];
290   qtWrapperArgs = [
291     # With wayland the titlebar is not themed and the wmclass is wrong.
292     "--set-default QT_QPA_PLATFORM xcb"
293   ];
295   preFixup = ''
296     qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
297   '';
299   passthru.updateScript = gitUpdater { rev-prefix = "stable/"; };
301   meta = with lib; {
302     homepage = "https://jami.net/";
303     description = "Free and universal communication platform that respects the privacy and freedoms of its users";
304     mainProgram = "jami";
305     license = licenses.gpl3Plus;
306     platforms = platforms.linux;
307     maintainers = [ maintainers.linsui ];
308   };