about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/instant-messengers/jami/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/instant-messengers/jami/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/networking/instant-messengers/jami/default.nix86
1 files changed, 57 insertions, 29 deletions
diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/jami/default.nix b/nixpkgs/pkgs/applications/networking/instant-messengers/jami/default.nix
index 87f65e6d05aa..5dac8dfe703a 100644
--- a/nixpkgs/pkgs/applications/networking/instant-messengers/jami/default.nix
+++ b/nixpkgs/pkgs/applications/networking/instant-messengers/jami/default.nix
@@ -2,7 +2,6 @@
 , lib
 , pkg-config
 , fetchFromGitLab
-, fetchpatch
 , gitUpdater
 , ffmpeg_6
 
@@ -66,14 +65,14 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "jami";
-  version = "20230619.1";
+  version = "20231201.0";
 
   src = fetchFromGitLab {
     domain = "git.jami.net";
     owner = "savoirfairelinux";
     repo = "jami-client-qt";
     rev = "stable/${version}";
-    hash = "sha256-gOl4GtGmEvhM8xtlyFvTwXrUsbocUKULnVy9cnCNAM0=";
+    hash = "sha256-A38JwjqdQVy03d738p2tpTFA6EWRSPNiesS5wZfti7Y=";
     fetchSubmodules = true;
   };
 
@@ -82,24 +81,16 @@ stdenv.mkDerivation rec {
       patch-src = src + "/daemon/contrib/src/pjproject/";
     in
     rec {
-      version = "e4b83585a0bdf1523e808a4fc1946ec82ac733d0";
+      version = "311bd018fc07aaf62d4c2d2494e08b5ee97e6846";
 
       src = fetchFromGitHub {
         owner = "savoirfairelinux";
         repo = "pjproject";
         rev = version;
-        hash = "sha256-QeD2o6uz9r5vc3Scs1oRKYZ+aNH+01TSxLBj71ssfj4=";
+        hash = "sha256-pZiOSOUxAXzMY4c1/AyKcwa7nyIJC/ZVOqDg9/QO/Nk=";
       };
 
-      patches = (map (x: patch-src + x) (readLinesToList ./config/pjsip_patches)) ++ [
-        (fetchpatch {
-          name = "CVE-2023-27585.patch";
-          url = "https://github.com/pjsip/pjproject/commit/d1c5e4da5bae7f220bc30719888bb389c905c0c5.patch";
-          hash = "sha256-+yyKKTKG2FnfyLWnc4S80vYtDzmiu9yRmuqb5eIulPg=";
-        })
-      ];
-
-      patchFlags = [ "-p1" "-l" ];
+      patches = (map (x: patch-src + x) (readLinesToList ./config/pjsip_patches));
 
       configureFlags = (readLinesToList ./config/pjsip_args_common)
         ++ lib.optionals stdenv.isLinux (readLinesToList ./config/pjsip_args_linux);
@@ -110,6 +101,52 @@ stdenv.mkDerivation rec {
     enablePushNotifications = true;
   };
 
+  dhtnet = stdenv.mkDerivation {
+    pname = "dhtnet";
+    version = "unstable-2023-11-23";
+
+    src = fetchFromGitLab {
+      domain = "git.jami.net";
+      owner = "savoirfairelinux";
+      repo = "dhtnet";
+      rev = "b1bcdecbac2a41de3941ef5a34faa6fbe4472535";
+      hash = "sha256-EucSsUuHXbVqr7drrTLK0f+WZT2k9Tx/LV+IBldTQO8=";
+    };
+
+    nativeBuildInputs = [
+      cmake
+      pkg-config
+    ];
+
+    buildInputs = [
+      asio
+      fmt
+      gnutls
+      http-parser
+      jsoncpp
+      libupnp
+      msgpack
+      opendht-jami
+      openssl
+      pjsip-jami
+      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;
@@ -125,6 +162,7 @@ stdenv.mkDerivation rec {
       alsa-lib
       asio
       dbus
+      dhtnet
       sdbus-cpp
       fmt
       ffmpeg_6
@@ -154,13 +192,12 @@ stdenv.mkDerivation rec {
     enableParallelBuilding = true;
   };
 
-  postPatch = ''
-    substituteInPlace src/app/commoncomponents/ModalTextEdit.qml \
-      --replace 'required property string placeholderText' 'property string placeholderText: ""'
-  '';
-
   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
   '';
 
   nativeBuildInputs = [
@@ -172,7 +209,6 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
-    daemon
     ffmpeg_6
     libnotify
     networkmanager
@@ -189,10 +225,7 @@ stdenv.mkDerivation rec {
     qtwebengine
   ];
 
-  cmakeFlags = [
-    "-DLIBJAMI_INCLUDE_DIR=${daemon}/include/jami"
-    "-DLIBJAMI_XML_INTERFACES_DIR=${daemon}/share/dbus-1/interfaces"
-  ] ++ lib.optionals (!withWebengine) [
+  cmakeFlags = lib.optionals (!withWebengine) [
     "-DWITH_WEBENGINE=false"
   ];
 
@@ -201,11 +234,6 @@ stdenv.mkDerivation rec {
     "--set-default QT_QPA_PLATFORM xcb"
   ];
 
-  postInstall = ''
-    # Make the jamid d-bus services available
-    ln -s ${daemon}/share/dbus-1 $out/share
-  '';
-
   passthru.updateScript = gitUpdater {
     rev-prefix = "stable/";
   };