about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/jami
diff options
context:
space:
mode:
authorlinsui <linsui555@gmail.com>2023-02-19 12:04:13 +0800
committerlinsui <linsui555@gmail.com>2023-02-19 12:04:29 +0800
commitefe1c91cc1d68025c5d6bfebb408b722fddc2d66 (patch)
tree1a8debac672cc2a24933ccff6574fcf45c14586b /pkgs/applications/networking/instant-messengers/jami
parenta3c24f953573af4e6964f2f0099a34a9dc4ba236 (diff)
jami: 20221220.0956.79e1207 -> 20230206.0
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/jami')
-rw-r--r--pkgs/applications/networking/instant-messengers/jami/client.nix77
-rw-r--r--pkgs/applications/networking/instant-messengers/jami/daemon.nix89
-rw-r--r--pkgs/applications/networking/instant-messengers/jami/default.nix218
-rwxr-xr-xpkgs/applications/networking/instant-messengers/jami/update.sh61
4 files changed, 167 insertions, 278 deletions
diff --git a/pkgs/applications/networking/instant-messengers/jami/client.nix b/pkgs/applications/networking/instant-messengers/jami/client.nix
deleted file mode 100644
index 80efff68e65f0..0000000000000
--- a/pkgs/applications/networking/instant-messengers/jami/client.nix
+++ /dev/null
@@ -1,77 +0,0 @@
-{ version
-, src
-, jami-meta
-, lib
-, stdenv
-, pkg-config
-, cmake
-, networkmanager # for libnm
-, python3
-, qttools # for translations
-, wrapQtAppsHook
-, ffmpeg_5
-, 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";
-
-  preConfigure = ''
-    echo 'const char VERSION_STRING[] = "${version}";' > src/app/version.h
-  '';
-
-  nativeBuildInputs = [
-    wrapQtAppsHook
-    pkg-config
-    cmake
-    python3
-    qttools
-  ];
-
-  buildInputs = [
-    ffmpeg_5
-    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;
-  };
-}
diff --git a/pkgs/applications/networking/instant-messengers/jami/daemon.nix b/pkgs/applications/networking/instant-messengers/jami/daemon.nix
deleted file mode 100644
index bf2392f631535..0000000000000
--- a/pkgs/applications/networking/instant-messengers/jami/daemon.nix
+++ /dev/null
@@ -1,89 +0,0 @@
-{ src
-, version
-, jami-meta
-, stdenv
-, autoreconfHook
-, pkg-config
-, perl # for pod2man
-, alsa-lib
-, asio
-, dbus
-, dbus_cplusplus
-, ffmpeg_5
-, fmt
-, gmp
-, gnutls
-, http-parser
-, jack
-, jsoncpp
-, libarchive
-, libgit2
-, libnatpmp
-, libpulseaudio
-, libupnp
-, yaml-cpp
-, msgpack
-, opendht-jami
-, openssl
-, pjsip-jami
-, restinio
-, secp256k1
-, speex
-, udev
-, webrtc-audio-processing
-, zlib
-}:
-
-stdenv.mkDerivation {
-  pname = "jami-daemon";
-  inherit src version;
-  sourceRoot = "source/daemon";
-
-  nativeBuildInputs = [
-    autoreconfHook
-    pkg-config
-    perl
-  ];
-
-  buildInputs = [
-    alsa-lib
-    asio
-    dbus
-    dbus_cplusplus
-    fmt
-    ffmpeg_5
-    gmp
-    gnutls
-    http-parser
-    jack
-    jsoncpp
-    libarchive
-    libgit2
-    libnatpmp
-    libpulseaudio
-    libupnp
-    yaml-cpp
-    msgpack
-    opendht-jami
-    openssl
-    pjsip-jami
-    restinio
-    secp256k1
-    speex
-    udev
-    webrtc-audio-processing
-    zlib
-  ];
-
-  doCheck = false; # The tests fail to compile due to missing headers.
-
-  enableParallelBuilding = true;
-
-  passthru = {
-    updateScript = ./update.sh;
-  };
-
-  meta = jami-meta // {
-    description = "The daemon" + jami-meta.description;
-  };
-}
diff --git a/pkgs/applications/networking/instant-messengers/jami/default.nix b/pkgs/applications/networking/instant-messengers/jami/default.nix
index 497616a6c0388..1c9f581d463b3 100644
--- a/pkgs/applications/networking/instant-messengers/jami/default.nix
+++ b/pkgs/applications/networking/instant-messengers/jami/default.nix
@@ -1,73 +1,95 @@
 { stdenv
 , lib
-, callPackage
+, pkg-config
+, fetchFromGitLab
+, gitUpdater
+, ffmpeg_5
+
+# for daemon
+, autoreconfHook
+, perl # for pod2man
+, alsa-lib
+, asio
+, dbus
+, dbus_cplusplus
+, fmt
+, gmp
+, gnutls
+, http-parser
+, jack
+, jsoncpp
+, libarchive
+, libgit2
+, libnatpmp
+, libpulseaudio
+, libupnp
+, yaml-cpp
+, msgpack
+, openssl
+, restinio
+, secp256k1
+, speex
+, udev
+, webrtc-audio-processing
+, zlib
+
+# for client
+, cmake
+, networkmanager # for libnm
+, python3
+, qttools # for translations
+, wrapQtAppsHook
+, libnotify
+, qt5compat
+, qtbase
+, qtdeclarative
+, qrencode
+, qtmultimedia
+, qtnetworkauth
+, qtsvg
+, qtwebengine
+, qtwebchannel
+, withWebengine ? true
+
+# for pjsip
 , fetchFromGitHub
-, fetchzip
-, fetchpatch
 , pjsip
+
+# for opendht
 , opendht
-, jack
-, udev
-, qt6Packages
 }:
 
 let
-  version = "20221220.0956.79e1207";
-
-  src = fetchzip {
-    url = "https://dl.jami.net/release/tarballs/jami_${version}.tar.gz";
-    hash = "sha256-AQgz2GqueFG+yK42zJ9MzvP4BddGt0BFb+cIoA6Fif8=";
-
-    stripRoot = false;
-    postFetch = ''
-      cd $out
-      mv jami-project/daemon ./
-      mv jami-project/client-qt ./
-      mv jami-project/COPYING ./
-      rm -r jami-project.rst jami-project
-      rm daemon/contrib/tarballs/*
-    '';
-  };
+  readLinesToList = with builtins; file: filter (s: isString s && stringLength s > 0) (split "\n" (readFile file));
+in
+stdenv.mkDerivation rec {
+  pname = "jami";
+  version = "20230206.0";
 
-  jami-meta = with lib; {
-    homepage = "https://jami.net/";
-    description = " for Jami, the free and universal communication platform that respects the privacy and freedoms of its users";
-    license = licenses.gpl3Plus;
-    platforms = platforms.linux;
-    maintainers = [ maintainers.linsui ];
+  src = fetchFromGitLab {
+    domain = "git.jami.net";
+    owner = "savoirfairelinux";
+    repo = "jami-client-qt";
+    rev = "stable/${version}";
+    hash = "sha256-MQ28UJUvgJoPk65neUgMrG+SxOcfnUl803urEFQ7468=";
+    fetchSubmodules = true;
   };
 
-  readLinesToList = with builtins; file: filter (s: isString s && stringLength s > 0) (split "\n" (readFile file));
-in
-rec {
   pjsip-jami = pjsip.overrideAttrs (old:
     let
       patch-src = src + "/daemon/contrib/src/pjproject/";
     in
     rec {
-      version = "eae25732568e600d248aa8c226271ff6b81df170";
+      version = "3b78ef1c48732d238ba284cdccb04dc6de79c54f";
 
       src = fetchFromGitHub {
         owner = "savoirfairelinux";
         repo = "pjproject";
         rev = version;
-        sha256 = "sha256-N7jn4qen+PgFiVkTFi2HSWhx2QPHwAYMtnrpE/ptDVc=";
+        hash = "sha256-hrm5tDM2jknU/gWMeO6/FhqOvay8bajFid39OiEtAAQ=";
       };
 
-      patches = (map (x: patch-src + x) (readLinesToList ./config/pjsip_patches)) ++ [
-        (fetchpatch {
-          name = "CVE-2022-23537.patch";
-          url = "https://github.com/pjsip/pjproject/commit/d8440f4d711a654b511f50f79c0445b26f9dd1e1.patch";
-          sha256 = "sha256-7ueQCHIiJ7MLaWtR4+GmBc/oKaP+jmEajVnEYqiwLRA=";
-        })
-        (fetchpatch {
-          name = "CVE-2022-23547.patch";
-          url = "https://github.com/pjsip/pjproject/commit/bc4812d31a67d5e2f973fbfaf950d6118226cf36.patch";
-          sha256 = "sha256-bpc8e8VAQpfyl5PX96G++6fzkFpw3Or1PJKNPKl7N5k=";
-        })
-      ];
-
-      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);
@@ -78,11 +100,105 @@ rec {
     enablePushNotifications = true;
   };
 
-  jami-daemon = callPackage ./daemon.nix {
-    inherit version src udev jack jami-meta pjsip-jami opendht-jami;
+  daemon = stdenv.mkDerivation {
+    pname = "jami-daemon";
+    inherit src version meta;
+    sourceRoot = "source/daemon";
+
+    nativeBuildInputs = [
+      autoreconfHook
+      pkg-config
+      perl
+    ];
+
+    buildInputs = [
+      alsa-lib
+      asio
+      dbus
+      dbus_cplusplus
+      fmt
+      ffmpeg_5
+      gmp
+      gnutls
+      http-parser
+      jack
+      jsoncpp
+      libarchive
+      libgit2
+      libnatpmp
+      libpulseaudio
+      libupnp
+      yaml-cpp
+      msgpack
+      opendht-jami
+      openssl
+      pjsip-jami
+      restinio
+      secp256k1
+      speex
+      udev
+      webrtc-audio-processing
+      zlib
+    ];
+
+    enableParallelBuilding = true;
+  };
+
+  preConfigure = ''
+    echo 'const char VERSION_STRING[] = "${version}";' > src/app/version.h
+  '';
+
+  nativeBuildInputs = [
+    wrapQtAppsHook
+    pkg-config
+    cmake
+    python3
+    qttools
+  ];
+
+  buildInputs = [
+    daemon
+    ffmpeg_5
+    libnotify
+    networkmanager
+    qtbase
+    qt5compat
+    qrencode
+    qtnetworkauth
+    qtdeclarative
+    qtmultimedia
+    qtsvg
+    qtwebchannel
+  ] ++ lib.optionals withWebengine [
+    qtwebengine
+  ];
+
+  cmakeFlags = [
+    "-DLIBJAMI_INCLUDE_DIR=${daemon}/include/jami"
+    "-DLIBJAMI_XML_INTERFACES_DIR=${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"
+  ];
+
+  postInstall = ''
+    # Make the jamid d-bus services available
+    ln -s ${daemon}/share/dbus-1 $out/share
+  '';
+
+  passthru.updateScript = gitUpdater {
+    rev-prefix = "stable/";
   };
 
-  jami-client = qt6Packages.callPackage ./client.nix {
-    inherit version src jami-meta;
+  meta = with lib; {
+    homepage = "https://jami.net/";
+    description = "The free and universal communication platform that respects the privacy and freedoms of its users";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.linsui ];
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/jami/update.sh b/pkgs/applications/networking/instant-messengers/jami/update.sh
deleted file mode 100755
index 27472d568c28b..0000000000000
--- a/pkgs/applications/networking/instant-messengers/jami/update.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env nix-shell
-#!nix-shell -i bash -p coreutils curl gnused common-updater-scripts nix-prefetch
-
-set -e
-
-jami_dir=$(readlink -e $(dirname "${BASH_SOURCE[0]}"))
-
-cd $jami_dir/../../../../..
-
-# Update src version and hash
-version=$(curl -s 'https://dl.jami.net/release/tarballs/?C=M;O=D' | sed -n -E 's/^.*jami_([0-9.a-f]+)\.tar\.gz.*$/\1/p' | head -n 1)
-echo "Latest version: ${version}"
-
-update-source-version jami-daemon "$version" --file=$jami_dir/default.nix
-
-src=$(nix-build --no-out-link -A jami-daemon.src)
-
-config_dir="$jami_dir/config"
-mkdir -p $config_dir
-
-ffmpeg_rules="${src}/daemon/contrib/src/ffmpeg/rules.mak"
-
-# Update FFmpeg patches
-ffmpeg_patches=$(sed -n '/^ffmpeg:/,/^$/p' ${ffmpeg_rules} | sed -n -E 's/.*ffmpeg\/(.*patch).*/\1/p')
-echo -e "Patches for FFmpeg:\n${ffmpeg_patches}\n"
-echo "${ffmpeg_patches}" > "$config_dir/ffmpeg_patches"
-
-# Update FFmpeg args
-ffmpeg_args_common=$(sed -n '/#disable everything/,/#platform specific options/p' ${ffmpeg_rules} | sed -n -E 's/.*(--[0-9a-z=_-]+).*/\1/p')
-echo -e "Common args for FFmpeg:\n${ffmpeg_args_common}\n"
-echo "${ffmpeg_args_common}" > "$config_dir/ffmpeg_args_common"
-
-ffmpeg_args_linux1=$(sed -n '/ifdef HAVE_LINUX/,/ifdef HAVE_ANDROID/p' ${ffmpeg_rules} | sed -n -E 's/.*(--[0-9a-z=_-]+).*/\1/p')
-ffmpeg_args_linux2=$(sed -n '/# Desktop Linux/,/i386 x86_64/p' ${ffmpeg_rules} | sed -n -E 's/.*(--[0-9a-z=_-]+).*/\1/p')
-echo -e "Linux args for FFmpeg:\n${ffmpeg_args_linux1}\n${ffmpeg_args_linux2}\n"
-echo "${ffmpeg_args_linux1}" > "$config_dir/ffmpeg_args_linux"
-echo "${ffmpeg_args_linux2}" >> "$config_dir/ffmpeg_args_linux"
-
-ffmpeg_args_x86=$(sed -n '/i386 x86_64/,/# End Desktop Linux:/p' ${ffmpeg_rules} | sed -n -E 's/.*(--[0-9a-z=_-]+).*/\1/p')
-echo -e "x86 args for FFmpeg:\n${ffmpeg_args_x86}\n"
-echo "${ffmpeg_args_x86}" > "$config_dir/ffmpeg_args_x86"
-
-# Update pjsip patches
-pjsip_patches=$(sed -n '/UNPACK/,/HAVE_ANDROID/p' ${src}/daemon/contrib/src/pjproject/rules.mak | sed -n -E 's/.*pjproject\/(00.*patch).*/\1/p')
-echo -e "Patches for pjsip:\n${pjsip_patches}\n"
-echo "${pjsip_patches}" > "$config_dir/pjsip_patches"
-
-# Update pjsip version
-pjsip_version=$(sed -n -E 's/.*PJPROJECT_VERSION := ([0-9a-f]+).*/\1/p' ${src}/daemon/contrib/src/pjproject/rules.mak)
-update-source-version jami.pjsip-jami "$pjsip_version" --file=$jami_dir/default.nix
-
-pjsip_rules="${src}/daemon/contrib/src/pjproject/rules.mak"
-
-# Update pjsip args
-pjsip_args_common=$(sed -n '/PJPROJECT_OPTIONS :=/,/with-gnutls/p' ${pjsip_rules} | sed -n -E 's/.*(--[0-9a-z=_-]+).*\\/\1/p')
-echo -e "Common args for pjsip:\n${pjsip_args_common}\n"
-echo "${pjsip_args_common}" > "$config_dir/pjsip_args_common"
-
-pjsip_args_linux=$(sed -n '/HAVE_LINUX/,/endif/p' ${pjsip_rules} | sed -n -E 's/.*(--[0-9a-z=_-]+).*/\1/p')
-echo -e "Linux args for pjsip:\n${pjsip_args_linux}\n"
-echo "${pjsip_args_linux}" > "$config_dir/pjsip_args_linux"