From b5e300f9c15640090c82225ca13c25bd54eb0ed4 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 7 Feb 2023 10:08:06 -0500 Subject: gnu: jami: Update to 20230206.0. * gnu/packages/jami.scm (jami): Update to 20230206.0. (%jami-version): Update version. (%jami-sources): Adjust URI. Streamline snippet. (jami-apply-custom-patches): Use a wildcard to match the top-level directory, which now includes the version. (%ffmpeg-default-configure-flags): Adjust URL in top comment. * gnu/packages/patches/jami-libjami-headers-search.patch: Adjust file names for new tarball layout. --- gnu/packages/jami.scm | 47 +++++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) (limited to 'gnu/packages/jami.scm') diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index b74cdff0c7..e425a6547a 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2019 Pierre Neidhardt ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2019, 2020 Jan Wielkiewicz -;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer +;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -69,31 +69,24 @@ (define-module (gnu packages jami) #:use-module (guix packages) #:use-module (guix utils)) -(define %jami-version "20221220.0956.79e1207") +(define %jami-version "20230206.0") (define %jami-sources ;; Return an origin object of the tarball release sources archive of the ;; Jami project. (origin (method url-fetch) - (uri (string-append "https://dl.jami.net/release/tarballs/jami_" - %jami-version - ".tar.gz")) + (uri (string-append "https://dl.jami.net/release/tarballs/jami-" + %jami-version ".tar.gz")) (modules '((guix build utils))) (snippet - `(begin - ;; Delete multiple MiBs of bundled tarballs. The contrib directory - ;; contains the custom patches for pjproject and other libraries used - ;; by Jami. - (delete-file-recursively "daemon/contrib/tarballs") - ;; Remove the git submodule directories of unused Jami clients. - (for-each delete-file-recursively '("client-android" - "client-ios" - "client-macosx" - "plugins")))) + ;; Delete multiple MiBs of bundled tarballs. The daemon/contrib + ;; directory contains the custom patches for pjproject and other + ;; libraries used by Jami. + '(delete-file-recursively "daemon/contrib/tarballs")) (sha256 (base32 - "0g5709rmb9944s0ij9g4pm1b871f5z0s5nawvm10z14wx3y1np8m")) + "1fx7c6q8j0x3q8cgzzd4kpsw3npqggsi1n493cv1jg7v5d01d3jz")) (patches (search-patches "jami-disable-integration-tests.patch" "jami-libjami-headers-search.patch")))) @@ -107,14 +100,12 @@ (define jami-apply-custom-patches (invoke "tar" "-xvf" #$%jami-sources "-C" patches-directory "--strip-components=5" - (string-append "jami-project/daemon/contrib/src/" - dep-name)) - (for-each - (lambda (file) - (invoke "patch" "--force" "--ignore-whitespace" "-p1" "-i" - (string-append patches-directory "/" - file ".patch"))) - patches)))) + "--wildcards" + (string-append "jami-*/daemon/contrib/src/" dep-name)) + (for-each (lambda (f) + (invoke "patch" "--force" "--ignore-whitespace" "-p1" "-i" + (string-append patches-directory "/" f ".patch"))) + patches)))) (define-public pjproject-jami (let ((commit "513a3f14c44b2c2652f9219ec20dea64b236b713") @@ -153,10 +144,10 @@ (define-public pjproject-jami '("0009-add-config-site"))))))))))) ;; The following variables are configure flags used by ffmpeg-jami. They're -;; from the jami-project/daemon/contrib/src/ffmpeg/rules.mak file. We try to -;; keep it as close to the official Jami package as possible, to provide all -;; the codecs and extra features that are expected (see: -;; https://review.jami.net/plugins/gitiles/ring-daemon/+/refs/heads/master/contrib/src/ffmpeg/rules.mak) +;; from the jami/daemon/contrib/src/ffmpeg/rules.mak file. We try to keep it +;; as close to the official Jami package as possible, to provide all the +;; codecs and extra features that are expected (see: +;; https://review.jami.net/plugins/gitiles/jami-daemon/+/refs/heads/master/contrib/src/ffmpeg/rules.mak) (define %ffmpeg-default-configure-flags '("--disable-everything" "--enable-zlib" -- cgit v1.2.3 From d09b1805aa2ea6350c9bc96c5393fc5bd043ae37 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 7 Feb 2023 16:46:49 -0500 Subject: gnu: ffmpeg-jami: Really honor custom configuration flags. Because the substitute-keyword-arguments pattern was (#:configure-flags '()) rather than (#:configure-flags _ '()), the replacement was not triggered. * gnu/packages/jami.scm (%ffmpeg-default-configure-flags): Comment that the fnnvcodec-related options are left out. (%ffmpeg-linux-x86-configure-flags): Delete variable. (ffmpeg-compose-configure-flags): Streamline and use gexps. (ffmpeg-jami) [arguments]: Fix configure-flags pattern, and adjust to use gexps. Add the "--disable-static" and "--enable-shared" flags to produce shared objects with the correct RUNPATH. --- gnu/packages/jami.scm | 42 ++++++++++++------------------------------ 1 file changed, 12 insertions(+), 30 deletions(-) (limited to 'gnu/packages/jami.scm') diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index e425a6547a..a98e64bb86 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -147,7 +147,9 @@ (define-public pjproject-jami ;; from the jami/daemon/contrib/src/ffmpeg/rules.mak file. We try to keep it ;; as close to the official Jami package as possible, to provide all the ;; codecs and extra features that are expected (see: -;; https://review.jami.net/plugins/gitiles/jami-daemon/+/refs/heads/master/contrib/src/ffmpeg/rules.mak) +;; https://review.jami.net/plugins/gitiles/jami-daemon/+/refs/heads/master/contrib/src/ffmpeg/rules.mak). +;; An exception are the ffnvcodec-related switches, which is not packaged in +;; Guix and would not work with Mesa. (define %ffmpeg-default-configure-flags '("--disable-everything" "--enable-zlib" @@ -339,34 +341,12 @@ (define %ffmpeg-linux-configure-flags "--enable-encoder=mjpeg_vaapi" "--enable-encoder=hevc_vaapi")) -;; ffnvcodec is not supported on ARM; enable it only for the i386 and x86_64 -;; architectures. -(define %ffmpeg-linux-x86-configure-flags - '("--arch=x86" - "--enable-cuvid" - "--enable-ffnvcodec" - "--enable-nvdec" - "--enable-nvenc" - "--enable-hwaccel=h264_nvdec" - "--enable-hwaccel=hevc_nvdec" - "--enable-hwaccel=vp8_nvdec" - "--enable-hwaccel=mjpeg_nvdec" - "--enable-encoder=h264_nvenc" - "--enable-encoder=hevc_nvenc")) - -;; This procedure composes the configure flags list for ffmpeg-jami. (define (ffmpeg-compose-configure-flags) - (define (system=? s) - (string-prefix? s (%current-system))) - - `(,@%ffmpeg-default-configure-flags - ,@(if (string-contains (%current-system) "linux") - (if (or (system=? "i686") - (system=? "x86_64")) - (append %ffmpeg-linux-configure-flags - %ffmpeg-linux-x86-configure-flags) - %ffmpeg-linux-configure-flags) - '()))) + "Compose the configure flag lists of ffmpeg-jami." + #~(append '#$%ffmpeg-default-configure-flags + (if (string-contains #$(%current-system) "linux") + '#$%ffmpeg-linux-configure-flags + '()))) (define-public ffmpeg-jami (package @@ -384,8 +364,10 @@ (define-public ffmpeg-jami "0yq0jcdc4qm5znrzylj3dsicrkk2n3n8bv28vr0a506fb7iglbpg")))) (arguments (substitute-keyword-arguments (package-arguments ffmpeg-5) - ((#:configure-flags '()) - (ffmpeg-compose-configure-flags)) + ((#:configure-flags _ '()) + #~(cons* "--disable-static" + "--enable-shared" + #$(ffmpeg-compose-configure-flags))) ((#:phases phases) #~(modify-phases #$phases (add-after 'unpack 'apply-patches -- cgit v1.2.3 From c0106ea5c9f783da0b982bbf18ae81ad8065d7b7 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 7 Feb 2023 16:52:54 -0500 Subject: gnu: ffmpeg-jami: Add a debug output. * gnu/packages/jami.scm (ffmpeg-jami) [outputs]: New field. [configure-flags]: Add "--disable-stripping". --- gnu/packages/jami.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu/packages/jami.scm') diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index a98e64bb86..b5b939c21c 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -362,11 +362,13 @@ (define-public ffmpeg-jami (sha256 (base32 "0yq0jcdc4qm5znrzylj3dsicrkk2n3n8bv28vr0a506fb7iglbpg")))) + (outputs '("out" "debug")) (arguments (substitute-keyword-arguments (package-arguments ffmpeg-5) ((#:configure-flags _ '()) #~(cons* "--disable-static" "--enable-shared" + "--disable-stripping" #$(ffmpeg-compose-configure-flags))) ((#:phases phases) #~(modify-phases #$phases -- cgit v1.2.3 From aef75942fc24fdb753978848b5471c5da21f23b7 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 7 Feb 2023 20:45:59 -0500 Subject: gnu: libjami: Move jamid daemon to a "bin" output. * gnu/packages/jami.scm (libjami) [outputs]: Add a "bin" output. [arguments]: Add a move-jamid phase. * gnu/services/telephony.scm (jami-configuration->command-line-arguments): Refer to the "bin" output of libjami. (jami-shepherd-services): Likewise. --- gnu/packages/jami.scm | 21 ++++++++++++++++++--- gnu/services/telephony.scm | 8 +++++--- 2 files changed, 23 insertions(+), 6 deletions(-) (limited to 'gnu/packages/jami.scm') diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index b5b939c21c..64a4c53c9c 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -402,7 +402,7 @@ (define-public libjami (name "libjami") (version %jami-version) (source %jami-sources) - (outputs '("out" "debug")) + (outputs '("out" "bin" "debug")) ;"bin' contains jamid (build-system gnu-build-system) (arguments (list @@ -425,7 +425,20 @@ (define-public libjami (lambda _ (for-each delete-file (find-files (string-append #$output "/lib") - "\\.a$"))))))) + "\\.a$")))) + (add-after 'install 'move-jamid + ;; This nearly halves the size of the main output (from 1566.2 MiB + ;; to 833.6 MiB), due to not depending on dbus-c++ and its large + ;; dependencies. + (lambda* (#:key outputs #:allow-other-keys) + (let ((libexec (string-append #$output:bin "/libexec")) + (share (string-append #$output:bin "/share"))) + (mkdir-p libexec) + (rename-file (search-input-file outputs "libexec/jamid") + (string-append libexec "/jamid")) + (mkdir-p share) + (rename-file (search-input-directory outputs "share/dbus-1") + (string-append share "/dbus-1")))))))) (inputs (list alsa-lib asio @@ -461,7 +474,9 @@ (define-public libjami Jami core functionality. Jami is a secure and distributed voice, video and chat communication platform that requires no centralized server and leaves the power of privacy in the hands of the user. It supports the SIP and IAX -protocols, as well as decentralized calling using P2P-DHT.") +protocols, as well as decentralized calling using P2P-DHT. The @samp{\"bin\"} +output contains the D-Bus daemon (@command{jamid}) as well as the Jami D-Bus +service definitions.") (home-page "https://jami.net/") (license license:gpl3+))) diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm index b66c7a8563..23ccb8d403 100644 --- a/gnu/services/telephony.scm +++ b/gnu/services/telephony.scm @@ -267,7 +267,7 @@ (define (jami-configuration->command-line-arguments config) CONFIG, a object." (match-record config (libjami dbus enable-logging? debug? auto-answer?) - `(,(file-append libjami "/libexec/jamid") + `(,#~(string-append #$libjami:bin "/libexec/jamid") "--persistent" ;stay alive after client quits ,@(if enable-logging? '() ;logs go to syslog by default @@ -524,7 +524,8 @@ (define disable-account-action #:environment-variables ;; This is so that the cx.ring.Ring service D-Bus ;; definition is found by dbus-daemon. - (list (string-append "XDG_DATA_DIRS=" #$libjami "/share")))) + (list (string-append "XDG_DATA_DIRS=" + #$libjami:bin "/share")))) (stop #~(make-kill-destructor))) (shepherd-service @@ -595,7 +596,8 @@ (define (delete-file-recursively/safe file) ;; Start the daemon. (define daemon-pid ((make-forkexec-constructor/container - '#$(jami-configuration->command-line-arguments config) + (list #$@(jami-configuration->command-line-arguments + config)) #:mappings (list (file-system-mapping (source "/dev/log") ;for syslog -- cgit v1.2.3 From 20059f92a97726b40d4d74e67463a64c98d1da0d Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 7 Feb 2023 20:13:10 -0500 Subject: gnu: jami: Remove unused native inputs. * gnu/packages/jami.scm (jami) [native-inputs]: Remove doxygen, graphviz and gsettings-desktop-schemas. --- gnu/packages/jami.scm | 3 --- 1 file changed, 3 deletions(-) (limited to 'gnu/packages/jami.scm') diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index 64a4c53c9c..92a4e55606 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -543,9 +543,6 @@ (define-public jami pkg-config python qttools - doxygen - graphviz - gsettings-desktop-schemas ;for tests vulkan-headers)) (inputs (list ffmpeg-jami -- cgit v1.2.3