From bc7713fa8878ab8a2158c8660d9b2bbb8fb2f77e Mon Sep 17 00:00:00 2001 From: John Kehayias Date: Sun, 17 Dec 2023 01:11:32 -0500 Subject: gnu: curl: Update to 8.5.0 [security fixes]. Fixes CVE-2023-46218 and CVE-2023-46219. See and respectively. * gnu/packages/curl.scm (curl): Update to 8.5.0. * gnu/packages/patches/curl-use-ssl-cert-env.patch: Update patch. Change-Id: Iaa6aa5de0f45576dc06bf5eca1eec502e5c83332 --- gnu/packages/patches/curl-use-ssl-cert-env.patch | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/curl-use-ssl-cert-env.patch b/gnu/packages/patches/curl-use-ssl-cert-env.patch index 24be6e31d9..c39c1f7e98 100644 --- a/gnu/packages/patches/curl-use-ssl-cert-env.patch +++ b/gnu/packages/patches/curl-use-ssl-cert-env.patch @@ -5,37 +5,37 @@ must be called when no other threads exist). This fixes network functionality in rust:cargo, and probably removes the need for other future workarounds. =================================================================== ---- curl-7.66.0.orig/lib/easy.c 2020-01-02 15:43:11.883921171 +0100 -+++ curl-7.66.0/lib/easy.c 2020-01-02 16:18:54.691882797 +0100 -@@ -134,6 +134,9 @@ - # pragma warning(default:4232) /* MSVC extension, dllimport identity */ +--- curl-8.5.0.orig/lib/easy.c 2023-12-17 00:36:32.400468561 -0500 ++++ curl-8.5.0/lib/easy.c 2023-12-17 00:39:08.898612331 -0500 +@@ -137,6 +137,9 @@ + static char *leakpointer; #endif - + +char * Curl_ssl_cert_dir = NULL; +char * Curl_ssl_cert_file = NULL; + /** * curl_global_init() globally initializes curl given a bitwise set of the * different features of what to initialize. -@@ -155,6 +158,9 @@ - #endif +@@ -163,6 +166,9 @@ + goto fail; } - + + Curl_ssl_cert_dir = curl_getenv("SSL_CERT_DIR"); + Curl_ssl_cert_file = curl_getenv("SSL_CERT_FILE"); + if(!Curl_ssl_init()) { DEBUGF(fprintf(stderr, "Error: Curl_ssl_init failed\n")); - return CURLE_FAILED_INIT; -@@ -260,6 +266,9 @@ + goto fail; +@@ -287,6 +293,9 @@ Curl_ssl_cleanup(); Curl_resolver_global_cleanup(); - + + free(Curl_ssl_cert_dir); + free(Curl_ssl_cert_file); + - #ifdef WIN32 - Curl_win32_cleanup(init_flags); + #ifdef _WIN32 + Curl_win32_cleanup(easy_init_flags); #endif diff -ur curl-7.66.0.orig/lib/url.c curl-7.66.0/lib/url.c --- curl-7.66.0.orig/lib/url.c 2020-01-02 15:43:11.883921171 +0100 -- cgit v1.2.3 From c61532c4b472f9c438c1837a423f3d8f024423d5 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 4 Jan 2024 15:02:50 +0100 Subject: gnu: emacs-ess: Update to 18.10.2-1.3691ecc. * gnu/packages/statistics.scm (emacs-ess): Update to 18.10.2-1.3691ecc. [arguments]: Skip failing tests. * gnu/packages/patches/emacs-ess-fix-obsolete-function-alias.patch: Delete file. * gnu/local.mk: Apply file removal. Change-Id: If8cd54c32c44cd2465f2cdb78317e8f8339f6bc3 --- gnu/local.mk | 1 - .../emacs-ess-fix-obsolete-function-alias.patch | 23 -------------- gnu/packages/statistics.scm | 35 +++++++++++++++++----- 3 files changed, 27 insertions(+), 32 deletions(-) delete mode 100644 gnu/packages/patches/emacs-ess-fix-obsolete-function-alias.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index ee25e1535e..f804f4ef5b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1111,7 +1111,6 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-deferred-fix-number-of-arguments.patch \ %D%/packages/patches/emacs-elpy-dup-test-name.patch \ %D%/packages/patches/emacs-exec-path.patch \ - %D%/packages/patches/emacs-ess-fix-obsolete-function-alias.patch \ %D%/packages/patches/emacs-git-email-missing-parens.patch \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ %D%/packages/patches/emacs-json-reformat-fix-tests.patch \ diff --git a/gnu/packages/patches/emacs-ess-fix-obsolete-function-alias.patch b/gnu/packages/patches/emacs-ess-fix-obsolete-function-alias.patch deleted file mode 100644 index f7b61391c3..0000000000 --- a/gnu/packages/patches/emacs-ess-fix-obsolete-function-alias.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 9cc5520e1998d03f5dec0fbb1fe71b7cdec38b65 Mon Sep 17 00:00:00 2001 -From: Alex Branham -Date: Wed, 6 Jan 2021 06:41:20 -0500 -Subject: [PATCH] Add required when to obsolete function alias - -Closes #1085 ---- - lisp/ess-r-package.el | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lisp/ess-r-package.el b/lisp/ess-r-package.el -index 260959955..397ce14e6 100644 ---- a/lisp/ess-r-package.el -+++ b/lisp/ess-r-package.el -@@ -577,7 +577,7 @@ package mode. Use this function if state of the buffer such as - (error "As of ESS 16.04, `ess-developer' is deprecated. Use `ess-r-set-evaluation-env' instead")) - - (defalias 'ess-toggle-developer 'ess-developer) --(define-obsolete-function-alias 'ess-r-devtools-check-package-buildwin 'ess-r-devtools-check-with-winbuilder) -+(define-obsolete-function-alias 'ess-r-devtools-check-package-buildwin 'ess-r-devtools-check-with-winbuilder "18.04") - (define-obsolete-function-alias 'ess-r-devtools-ask 'ess-r-devtools-execute-command "18.04") - - (make-obsolete-variable 'ess-developer "Please use `ess-developer-select-package' and `ess-r-set-evaluation-env' instead." "16.04") diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index c2cf68fca8..b3a2f44ecd 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -6757,11 +6757,9 @@ Java package that provides routines for various statistical distributions.") (license license:gpl2+))) (define-public emacs-ess - ;; Latest release is old. This is not the latest commit either due to bug - ;; reported here: . - (let ((commit "24da603184ce39246611dd5b8602e769d7ebd5bf") + (let ((commit "3691ecc642eab5d016887e42699648e0eeeef566") (version "18.10.2") - (revision "0")) + (revision "1")) (package (name "emacs-ess") (version (git-version version revision commit)) @@ -6772,7 +6770,7 @@ Java package that provides routines for various statistical distributions.") (url "https://github.com/emacs-ess/ESS") (commit commit))) (sha256 - (base32 "0j98lv07nzwzd54d4dgcfz01wy5gj48m0mnirxzh5r45ik2myh1r")) + (base32 "19p8djsbgvahpsx1w8i6h3qvpbdr4isjwm3wi82yk2648ri0qsq1")) (file-name (git-file-name name version)) (modules '((guix build utils))) (snippet @@ -6803,9 +6801,7 @@ Java package that provides routines for various statistical distributions.") "$(MAKE) -C lisp install; $(MAKE) -C doc install") (("\\$\\(INSTALL) -R \\./\\* \\$\\(ESSDESTDIR)/") "$(MAKE) -C etc install")) - #t)) - (patches - (search-patches "emacs-ess-fix-obsolete-function-alias.patch")))) + #t)))) (build-system gnu-build-system) (arguments (let ((base-directory "/share/emacs/site-lisp")) @@ -6819,6 +6815,29 @@ Java package that provides routines for various statistical distributions.") #:phases (modify-phases %standard-phases (delete 'configure) + (add-before 'check 'skip-failing-tests + ;; XXX: Skip 10 failing tests (out of 187). + (lambda _ + (let-syntax + ((disable-tests + (syntax-rules () + ((_ file ()) + (syntax-error "test names list must not be empty")) + ((_ file (test-name ...)) + (substitute* file + (((string-append "^\\(ert-deftest " test-name ".*") all) + (string-append all "(skip-unless nil)\n")) ...))))) + (disable-tests (list "test/ess-test-inf.el" "test/ess-test-r.el") + ("ess--derive-connection-path" + "ess-eval-line-test" + "ess-eval-region-test" + "ess-mock-remote-process" + "ess-r-load-ESSR-github-fetch-no" + "ess-r-load-ESSR-github-fetch-yes" + "ess-r-eval-ns-env-roxy-tracebug-test" + "ess-r-eval-sink-freeze-test" + "ess-set-working-directory-test" + "ess-test-r-startup-directory"))))) (replace 'check (lambda _ (invoke "make" "test"))))))) (native-inputs -- cgit v1.2.3 From 51d25c771cfb7e26f5bd0d675893f68a8cbb92dc Mon Sep 17 00:00:00 2001 From: Troy Figiel Date: Fri, 17 Nov 2023 21:48:02 +0100 Subject: gnu: python-uqbar: Update to 0.5.9. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/graphviz.scm (python-uqbar): Update to 0.5.9. [source]: Add patch for Python 3.10 compatibility. [arguments]: Remove outdated patch phase. Change-Id: I81d83efd69bd07fe12790981c48a6e82297908f0 Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + gnu/packages/graphviz.scm | 12 +++-------- gnu/packages/patches/python-uqbar-python3.10.patch | 23 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 gnu/packages/patches/python-uqbar-python3.10.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index f804f4ef5b..3548b5eb3d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1782,6 +1782,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-sphinx-prompt-docutils-0.19.patch \ %D%/packages/patches/python-telingo-fix-comparison.patch \ %D%/packages/patches/python-typeguard-python3.10.patch \ + %D%/packages/patches/python-uqbar-python3.10.patch \ %D%/packages/patches/python-wxwidgets-type-errors.patch \ %D%/packages/patches/qtdeclarative-5-disable-qmlcache.patch \ %D%/packages/patches/qtdeclarative-disable-qmlcache.patch \ diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm index b91c365e3c..c5507e036c 100644 --- a/gnu/packages/graphviz.scm +++ b/gnu/packages/graphviz.scm @@ -195,7 +195,7 @@ structure and layout algorithms.") (define-public python-uqbar (package (name "python-uqbar") - (version "0.5.6") + (version "0.5.9") (source (origin (method git-fetch) @@ -205,18 +205,12 @@ structure and layout algorithms.") (file-name (git-file-name name version)) (sha256 (base32 - "1ml3x2mf7nlnvrh9lari5yk0sz2mmg39jwsbjxnpzhnw4kcwpdrs")))) + "0c573nzpm51qgz2g296f8pw8ys0i3r6daynxk06zagk5l5fgw9ar")) + (patches (search-patches "python-uqbar-python3.10.patch")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'patch - (lambda _ - (substitute* "setup.py" - ;; Latest versions of sphink-rtd-theme require npm to build. - (("sphinx-rtd-theme >= 0.5.0") "sphinx-rtd-theme >= 0.2.4") - (("black") "black >= 19.10b0")) - #t)) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? diff --git a/gnu/packages/patches/python-uqbar-python3.10.patch b/gnu/packages/patches/python-uqbar-python3.10.patch new file mode 100644 index 0000000000..164f0c0c64 --- /dev/null +++ b/gnu/packages/patches/python-uqbar-python3.10.patch @@ -0,0 +1,23 @@ +Since Python 3.10 the output of a CLI program created with argparse +uses "options" instead of "optional arguments". This behaviour breaks +the tests in python-uqbar. + +--- a/tests/test_cli.py ++++ b/tests/test_cli.py +@@ -84,7 +84,7 @@ def test_call_help(): + + speak like a cat + +- optional arguments: ++ options: + -h, --help show this help message and exit + --version show program's version number and exit + --loud be adamant +@@ -101,6 +101,6 @@ def test_help(): + """ + usage: vox-aggregator [-h] [--version] {help,list,birds,mammals} ... + +- optional arguments: ++ options: + -h, --help show this help message and exit + --version show program's version number and exit -- cgit v1.2.3 From 51735eac1cc21356dc1cb59356ebe96a460b5b59 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sun, 24 Dec 2023 16:59:57 +0100 Subject: gnu: dtc: Update to 1.7.0. Enable the python bindings and switch to the meson build system that handles the python bindings better than the Makefile build system here. * gnu/packages/patches/dtc-meson-cell-overflow.patch: New file * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/bootloaders.scm (dtc): Update to 1.7.0. [build-system]: Switch to the meson-build-system. [arguments]: Remove #:make-flags. Add a new 'preparations phase. Do not edit the Makefile in the 'patch-pkg-config phase. Remove the 'configure phase. Change-Id: Ie61c920829ab3a8c32f4924c694dba6bda807711 Signed-off-by: Mathieu Othacehe --- gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 58 ++++++++++++++-------- gnu/packages/patches/dtc-meson-cell-overflow.patch | 32 ++++++++++++ 3 files changed, 71 insertions(+), 20 deletions(-) create mode 100644 gnu/packages/patches/dtc-meson-cell-overflow.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 3548b5eb3d..46da9a8adc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1092,6 +1092,7 @@ dist_patch_DATA = \ %D%/packages/patches/doxygen-hurd.patch \ %D%/packages/patches/dstat-fix-crash-when-specifying-delay.patch \ %D%/packages/patches/dstat-skip-devices-without-io.patch \ + %D%/packages/patches/dtc-meson-cell-overflow.patch \ %D%/packages/patches/dune-common-skip-failing-tests.patch \ %D%/packages/patches/dune-grid-add-missing-include-cassert.patch \ %D%/packages/patches/dune-istl-fix-solver-playground.patch \ diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index bd8b621e35..c73a0e665d 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -55,9 +55,12 @@ #:use-module (gnu packages man) #:use-module (gnu packages mtools) #:use-module (gnu packages ncurses) + #:use-module (gnu packages ninja) + #:use-module (gnu packages package-management) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-build) #:use-module (gnu packages python-crypto) #:use-module (gnu packages texinfo) #:use-module (gnu packages tls) @@ -71,6 +74,7 @@ #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (guix build-system gnu) + #:use-module (guix build-system meson) #:use-module (guix build-system pyproject) #:use-module (guix build-system trivial) #:use-module (guix download) @@ -631,7 +635,7 @@ The SUBDIR argument defaults to \"efi/Guix\", as it is also the case for (define-public dtc (package (name "dtc") - (version "1.6.1") + (version "1.7.0") (source (origin (method url-fetch) (uri (string-append @@ -639,42 +643,56 @@ The SUBDIR argument defaults to \"efi/Guix\", as it is also the case for "dtc-" version ".tar.gz")) (sha256 (base32 - "0xm38h31jb29xfh2sfyk48d8wdfq4b8lmb412zx9vjr35izjb9iq")))) - (build-system gnu-build-system) + "0cij9399snpn672pdbda8qbxljdkfg068kvv3g5811rz6yslx124")) + (patches + (search-patches "dtc-meson-cell-overflow.patch")))) + (build-system meson-build-system) (arguments (list - #:modules `(,@%gnu-build-system-modules (srfi srfi-26)) - #:make-flags - #~(list (string-append "CC=" #$(cc-for-target)) - ;; /bin/fdt{get,overlay,put} need help finding libfdt.so.1. - (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib") - (string-append "PREFIX=" #$output) - (string-append "SETUP_PREFIX=" #$output) - "INSTALL=install") + #:modules '((guix build meson-build-system) + (guix build utils) + (srfi srfi-26)) #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'patch-pkg-config + (add-after 'unpack 'preparations (lambda _ - (substitute* '("Makefile" - "tests/run_tests.sh") - (("pkg-config") - #$(pkg-config-for-target))))) - (delete 'configure) ;no configure script - (add-before 'build 'install-doc + ;; The version string is usually derived via setuptools-scm, but + ;; without the git metadata available this fails. + (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version) + + ;; Needed by setup.py. + (setenv "DESTDIR" "/") + + ;; Native gcc needed by run_test.sh. + (setenv "CC" "gcc") + + ;; /bin/fdt{get,overlay,put} need help finding libfdt.so.1. + (setenv "LDFLAGS" + (string-append "-Wl,-rpath=" #$output "/lib")))) + (add-after 'unpack 'install-doc (lambda _ (with-directory-excursion "Documentation" (for-each (cut install-file <> (string-append #$output "/share/doc/dtc/")) '("dts-format.txt" "dt-object-internal.txt" - "manual.txt")))))))) + "manual.txt"))))) + (add-after 'unpack 'patch-pkg-config + (lambda _ + (substitute* '("tests/run_tests.sh") + (("pkg-config") + #$(pkg-config-for-target)))))))) (native-inputs (append (list bison flex libyaml + ninja pkg-config - swig) + python + python-setuptools-scm + swig + which) (if (member (%current-system) (package-supported-systems valgrind)) (list valgrind) '()))) diff --git a/gnu/packages/patches/dtc-meson-cell-overflow.patch b/gnu/packages/patches/dtc-meson-cell-overflow.patch new file mode 100644 index 0000000000..1c319312f7 --- /dev/null +++ b/gnu/packages/patches/dtc-meson-cell-overflow.patch @@ -0,0 +1,32 @@ +Taken from upstream: +https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=32174a66efa4ad19fc6a2a6422e4af2ae4f055cb + +From 32174a66efa4ad19fc6a2a6422e4af2ae4f055cb Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Tue, 28 Feb 2023 10:33:58 +1100 +Subject: [PATCH] meson: Fix cell overflow tests when running from meson + +Because meson always builds out-of-tree we need to reference things in the +original source tree via $SRCDIR from run_tests.sh. We forgot a couple of +cases for the cell overflow tests. Fix them. + +Signed-off-by: David Gibson +--- + tests/run_tests.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/run_tests.sh b/tests/run_tests.sh +index 91350ad3..f899d8cb 100755 +--- a/tests/run_tests.sh ++++ b/tests/run_tests.sh +@@ -519,8 +519,8 @@ libfdt_tests () { + check_tests "$SRCDIR/phandle-args-overflow.dts" clocks_property + + ## https://github.com/dgibson/dtc/issues/74 +- run_dtc_test -I dts -O dtb -o cell-overflow-results.test.dtb cell-overflow-results.dts +- run_dtc_test -I dts -O dtb -o cell-overflow.test.dtb cell-overflow.dts ++ run_dtc_test -I dts -O dtb -o cell-overflow-results.test.dtb "$SRCDIR/cell-overflow-results.dts" ++ run_dtc_test -I dts -O dtb -o cell-overflow.test.dtb "$SRCDIR/cell-overflow.dts" + run_test dtbs_equal_ordered cell-overflow.test.dtb cell-overflow-results.test.dtb + + # check full tests -- cgit v1.2.3 From 766ac72dba36657ce217d055d7672cbf01bd32ce Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 8 Jan 2024 23:12:30 +0100 Subject: gnu: guile-fibers: Apply upstream patch fixing libevent timers. * gnu/packages/patches/guile-fibers-libevent-timeout.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/guile-xyz.scm (guile-fibers)[source]: Use it. Change-Id: I872ffe5b193087234d29eed399d6db518c5af4d5 --- gnu/local.mk | 3 +- gnu/packages/guile-xyz.scm | 5 +- .../patches/guile-fibers-libevent-timeout.patch | 61 ++++++++++++++++++++++ 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/guile-fibers-libevent-timeout.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 46da9a8adc..16a34065c6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012-2023 Ludovic Courtès +# Copyright © 2012-2024 Ludovic Courtès # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2022, 2023 Andreas Enge # Copyright © 2016 Mathieu Lirzin # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Mark H Weaver @@ -1384,6 +1384,7 @@ dist_patch_DATA = \ %D%/packages/patches/guile-fibers-fd-finalizer-leak.patch \ %D%/packages/patches/guile-fibers-wait-for-io-readiness.patch \ %D%/packages/patches/guile-fibers-libevent-32-bit.patch \ + %D%/packages/patches/guile-fibers-libevent-timeout.patch \ %D%/packages/patches/guile-fix-invalid-unicode-handling.patch \ %D%/packages/patches/guile-gdbm-ffi-support-gdbm-1.14.patch \ %D%/packages/patches/guile-git-adjust-for-libgit2-1.2.0.patch \ diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index 9dc1176797..520b838d88 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012-2023 Ludovic Courtès +;;; Copyright © 2012-2024 Ludovic Courtès ;;; Copyright © 2014, 2015, 2018 Mark H Weaver ;;; Copyright © 2015, 2017, 2022 Christine Lemmer-Webber ;;; Copyright © 2016 Alex Sassmannshausen @@ -816,7 +816,8 @@ tables.") (base32 "0wvdi4l58f9a5c9wi3cdc9l1bniscsixb6w2zj86mch7j7j814lc")) (patches - (search-patches "guile-fibers-libevent-32-bit.patch")))) + (search-patches "guile-fibers-libevent-32-bit.patch" + "guile-fibers-libevent-timeout.patch")))) (build-system gnu-build-system) (arguments (list #:make-flags diff --git a/gnu/packages/patches/guile-fibers-libevent-timeout.patch b/gnu/packages/patches/guile-fibers-libevent-timeout.patch new file mode 100644 index 0000000000..c33678eea3 --- /dev/null +++ b/gnu/packages/patches/guile-fibers-libevent-timeout.patch @@ -0,0 +1,61 @@ +commit 2ca397bfcca94c106380368b5b0ce920b0a62a95 +Author: Ludovic Courtès +Date: Sat Jan 6 16:22:45 2024 +0100 + + libevent: Fix computation of the timeout value. + +diff --git a/extensions/libevent.c b/extensions/libevent.c +index 134460a..62e50a3 100644 +--- a/extensions/libevent.c ++++ b/extensions/libevent.c +@@ -192,30 +192,27 @@ scm_primitive_resize (SCM lst, SCM eventsv) + } + #undef FUNC_NAME + +-static uint64_t time_units_per_microsec; ++static uint64_t time_units_per_microsec, microsec_per_time_units; + + static void* + run_event_loop (void *p) + #define FUNC_NAME "primitive-event-loop" + { +- int ret = 0; +- int microsec = 0; +- struct timeval tv; +- ++ int ret; + struct loop_data *data = p; + +- if (data->timeout < 0) +- microsec = -1; +- else if (data->timeout >= 0) ++ if (data->timeout >= 0) + { +- microsec = (time_units_per_microsec == 0) +- ? 0 : data->timeout / time_units_per_microsec; +- tv.tv_sec = 0; +- tv.tv_usec = microsec; +- } ++ struct timeval tv; ++ ++ tv.tv_sec = data->timeout / scm_c_time_units_per_second; ++ tv.tv_usec = ++ time_units_per_microsec > 0 ++ ? ((data->timeout % scm_c_time_units_per_second) ++ / time_units_per_microsec) ++ : ((data->timeout % scm_c_time_units_per_second) ++ * microsec_per_time_units); + +- if (microsec >= 0) +- { + ret = event_base_loopexit (data->base, &tv); + if (ret == -1) + SCM_MISC_ERROR ("event loop exit failed", SCM_EOL); +@@ -307,6 +304,7 @@ void + init_fibers_libevt (void) + { + time_units_per_microsec = scm_c_time_units_per_second / 1000000; ++ microsec_per_time_units = 1000000 / scm_c_time_units_per_second; + + scm_c_define_gsubr ("primitive-event-wake", 1, 0, 0, + scm_primitive_event_wake); -- cgit v1.2.3 From 185ebc01f6122e0312202e53a5cf2dfaa85d6672 Mon Sep 17 00:00:00 2001 From: Troy Figiel Date: Sun, 7 Jan 2024 17:40:35 +0100 Subject: gnu: Add python-pyreadstat. * gnu/packages/patches/python-pyreadstat-link-libiconv.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/statistics.scm (python-pyreadstat): New variable. Signed-off-by: Mathieu Othacehe Change-Id: I361df91487412e4bfd26fb728a6999752e6343e5 --- gnu/local.mk | 2 + .../patches/python-pyreadstat-link-libiconv.patch | 15 ++++++++ gnu/packages/statistics.scm | 45 ++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 gnu/packages/patches/python-pyreadstat-link-libiconv.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 16a34065c6..5b59aba3af 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -62,6 +62,7 @@ # Copyright © 2023 B. Wilson # Copyright © 2023 gemmaro # Copyright © 2023 Herman Rimm +# Copyright © 2023 Troy Figiel # # This file is part of GNU Guix. # @@ -1777,6 +1778,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-louvain-fix-test.patch \ %D%/packages/patches/python-random2-getrandbits-test.patch \ %D%/packages/patches/python-poppler-qt5-fix-build.patch \ + %D%/packages/patches/python-pyreadstat-link-libiconv.patch \ %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch \ %D%/packages/patches/python-pytorch2-system-libraries.patch \ %D%/packages/patches/python-sip-include-dirs.patch \ diff --git a/gnu/packages/patches/python-pyreadstat-link-libiconv.patch b/gnu/packages/patches/python-pyreadstat-link-libiconv.patch new file mode 100644 index 0000000000..7efd71faeb --- /dev/null +++ b/gnu/packages/patches/python-pyreadstat-link-libiconv.patch @@ -0,0 +1,15 @@ +To ensure libiconv can be found by Guix, we need to link the library. + +--- a/setup.py ++++ b/setup.py +@@ -81,8 +81,7 @@ else: + libraries.extend(["m", "z"]) + _platform = sys.platform + # Mac: iconv needs to be linked statically +- if _platform.lower().startswith("darwin"): +- libraries.append("iconv") ++ libraries.append("iconv") + + # Extensions + sources.sort() + diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 712b1a9c37..906ec456b6 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2021 Frank Pursel ;;; Copyright © 2022 Simon Tournier ;;; Copyright © 2023 gemmaro +;;; Copyright © 2023 Troy Figiel ;;; ;;; This file is part of GNU Guix. ;;; @@ -6919,6 +6920,50 @@ files, including Rmarkdown files.") popular stats packages like SAS, Stata and SPSS.") (license license:expat))) +(define-public python-pyreadstat + (package + (name "python-pyreadstat") + (version "1.2.4") + ;; No tests in the PyPI tarball. + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Roche/pyreadstat") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0zysrzixvqw2lwwykxqg5yj8a0zyv5s2bmk22x30f4rj2hgvq1pv")) + (patches (search-patches "python-pyreadstat-link-libiconv.patch")))) + (arguments + '(#:phases (modify-phases %standard-phases + (add-before 'check 'change-home-dir + (lambda _ + ;; test_sav_expand and test_sav_write_basic_expanduser need a + ;; home directory with write permissions. + (setenv "HOME" "/tmp"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + ;; The source also contains tests/test_version.py + ;; which checks the version in __init__.py against the + ;; one in setup.py. Since this requires texlive + ;; dependencies to run and is also not mentioned in + ;; how_to_test.md, this test is skipped. + (invoke "python" "tests/test_basic.py"))))))) + (build-system python-build-system) + (propagated-inputs (list python-pandas)) + (inputs (list libiconv zlib)) + (native-inputs (list python-cython-3)) + (home-page "https://github.com/Roche/pyreadstat") + (synopsis + "Read and write SAS, SPSS and Stata files into/from Pandas DataFrames") + (description + "This Python package can be used to read and write SAS, SPSS and Stata +files into/from Pandas DataFrames. It is a wrapper around the C library +@code{readstat}.") + (license license:asl2.0))) + (define-public r-quantpsyc (package (name "r-quantpsyc") -- cgit v1.2.3 From de002b93dbc3aace41e0fbfc5c717ab73c9a1aa1 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 7 Jan 2024 13:16:17 -0500 Subject: gnu: ffmpeg-jami: Relocate to (gnu packages video). To avoid Guile module dependency cycles, inherited packages must be defined in the same module. Use this opportunity to simplify the patches applying mechanism, versioning custom patches the same as for other packages. * gnu/packages/patches/ffmpeg-jami-change-RTCP-ratio.patch: New file. * gnu/packages/patches/ffmpeg-jami-rtp_ext_abs_send_time.patch: Likewise. * gnu/packages/patches/ffmpeg-jami-libopusdec-enable-FEC.patch: Likewise. * gnu/packages/patches/ffmpeg-jami-libopusenc-enable-FEC.patch: Likewise. * gnu/packages/patches/ffmpeg-jami-libopusenc-reload-packet-loss-at-encode.patch: Likewise. * gnu/packages/patches/ffmpeg-jami-remove-mjpeg-log.patch: Likewise. * gnu/packages/patches/ffmpeg-jami-screen-sharing-x11-fix.patch: Likewise. * gnu/local.mk (dist_patch_DATA): Register them. * gnu/packages/jami.scm (jami-apply-custom-patches): Delete procedure. (%ffmpeg-default-configure-flags): Delete variable. (ffmpeg-compose-configure-flags): Delete procedure. (ffmpeg-jami): Move to... * gnu/packages/video.scm (ffmpeg-jami): ... here. Apply patches to origin and repatriate configure flags. Change-Id: Id374fae18240cd76b224915d80b61422635ccb77 --- gnu/local.mk | 7 + gnu/packages/jami.scm | 266 ------------------ .../patches/ffmpeg-jami-change-RTCP-ratio.patch | 27 ++ .../ffmpeg-jami-libopusdec-enable-FEC.patch | 127 +++++++++ .../ffmpeg-jami-libopusenc-enable-FEC.patch | 50 ++++ ...i-libopusenc-reload-packet-loss-at-encode.patch | 44 +++ .../patches/ffmpeg-jami-remove-mjpeg-log.patch | 26 ++ .../ffmpeg-jami-rtp_ext_abs_send_time.patch | 71 +++++ .../ffmpeg-jami-screen-sharing-x11-fix.patch | 302 +++++++++++++++++++++ gnu/packages/video.scm | 248 ++++++++++++++++- 10 files changed, 901 insertions(+), 267 deletions(-) create mode 100644 gnu/packages/patches/ffmpeg-jami-change-RTCP-ratio.patch create mode 100644 gnu/packages/patches/ffmpeg-jami-libopusdec-enable-FEC.patch create mode 100644 gnu/packages/patches/ffmpeg-jami-libopusenc-enable-FEC.patch create mode 100644 gnu/packages/patches/ffmpeg-jami-libopusenc-reload-packet-loss-at-encode.patch create mode 100644 gnu/packages/patches/ffmpeg-jami-remove-mjpeg-log.patch create mode 100644 gnu/packages/patches/ffmpeg-jami-rtp_ext_abs_send_time.patch create mode 100644 gnu/packages/patches/ffmpeg-jami-screen-sharing-x11-fix.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 5b59aba3af..63d2e333cf 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1167,6 +1167,13 @@ dist_patch_DATA = \ %D%/packages/patches/fenics-dolfin-demo-init.patch \ %D%/packages/patches/fenics-dolfin-boost.patch \ %D%/packages/patches/fenics-dolfin-config-slepc.patch \ + %D%/packages/patches/ffmpeg-jami-change-RTCP-ratio.patch \ + %D%/packages/patches/ffmpeg-jami-rtp_ext_abs_send_time.patch \ + %D%/packages/patches/ffmpeg-jami-libopusdec-enable-FEC.patch \ + %D%/packages/patches/ffmpeg-jami-libopusenc-enable-FEC.patch \ + %D%/packages/patches/ffmpeg-jami-libopusenc-reload-packet-loss-at-encode.patch \ + %D%/packages/patches/ffmpeg-jami-remove-mjpeg-log.patch \ + %D%/packages/patches/ffmpeg-jami-screen-sharing-x11-fix.patch \ %D%/packages/patches/fifengine-boost-compat.patch \ %D%/packages/patches/fifengine-swig-compat.patch \ %D%/packages/patches/fifo-map-fix-flags-for-gcc.patch \ diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index 3037d090d3..c035a966c7 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -89,272 +89,6 @@ (patches (search-patches "jami-disable-integration-tests.patch" "jami-libjami-headers-search.patch")))) -;; Jami maintains a set of patches for some key dependencies (currently -;; pjproject and ffmpeg) of Jami that haven't yet been integrated upstream. -;; This procedure simplifies the process of applying them. -(define jami-apply-custom-patches - #~(lambda* (#:key dep-name patches) - (let ((patches-directory "patches")) - (mkdir-p patches-directory) - (invoke "tar" "-xvf" #$%jami-sources - "-C" patches-directory - "--strip-components=5" - "--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)))) - -;; The following variables are configure flags used by ffmpeg-jami. They're -;; 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). -;; 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" - "--enable-gpl" - "--enable-swscale" - "--enable-bsfs" - "--disable-filters" - "--disable-programs" - "--disable-postproc" - "--disable-protocols" - "--enable-protocol=crypto" - "--enable-protocol=file" - "--enable-protocol=rtp" - "--enable-protocol=srtp" - "--enable-protocol=tcp" - "--enable-protocol=udp" - "--enable-protocol=unix" - "--enable-protocol=pipe" - - ;; Enable muxers/demuxers. - "--disable-demuxers" - "--disable-muxers" - "--enable-muxer=rtp" - "--enable-muxer=g722" - "--enable-muxer=g726" - "--enable-muxer=g726le" - "--enable-muxer=h263" - "--enable-muxer=h264" - "--enable-muxer=hevc" - "--enable-muxer=matroska" - "--enable-muxer=wav" - "--enable-muxer=webm" - "--enable-muxer=ogg" - "--enable-muxer=pcm_s16be" - "--enable-muxer=pcm_s16le" - "--enable-demuxer=rtp" - "--enable-demuxer=mjpeg" - "--enable-demuxer=mjpeg_2000" - "--enable-demuxer=mpegvideo" - "--enable-demuxer=gif" - "--enable-demuxer=image_jpeg_pipe" - "--enable-demuxer=image_png_pipe" - "--enable-demuxer=image_webp_pipe" - "--enable-demuxer=matroska" - "--enable-demuxer=m4v" - "--enable-demuxer=mp3" - "--enable-demuxer=ogg" - "--enable-demuxer=flac" - "--enable-demuxer=wav" - "--enable-demuxer=ac3" - "--enable-demuxer=g722" - "--enable-demuxer=g723_1" - "--enable-demuxer=g726" - "--enable-demuxer=g726le" - "--enable-demuxer=pcm_mulaw" - "--enable-demuxer=pcm_alaw" - "--enable-demuxer=pcm_s16be" - "--enable-demuxer=pcm_s16le" - "--enable-demuxer=h263" - "--enable-demuxer=h264" - "--enable-demuxer=hevc" - - ;; Enable parsers. - "--enable-parser=h263" - "--enable-parser=h264" - "--enable-parser=hevc" - "--enable-parser=mpeg4video" - "--enable-parser=vp8" - "--enable-parser=vp9" - "--enable-parser=opus" - - ;; Encoders/decoders. - "--enable-encoder=adpcm_g722" - "--enable-decoder=adpcm_g722" - "--enable-encoder=adpcm_g726" - "--enable-decoder=adpcm_g726" - "--enable-encoder=adpcm_g726le" - "--enable-decoder=adpcm_g726le" - "--enable-decoder=g729" - "--enable-encoder=g723_1" - "--enable-decoder=g723_1" - "--enable-encoder=rawvideo" - "--enable-decoder=rawvideo" - "--enable-encoder=libx264" - "--enable-decoder=h264" - "--enable-encoder=pcm_alaw" - "--enable-decoder=pcm_alaw" - "--enable-encoder=pcm_mulaw" - "--enable-decoder=pcm_mulaw" - "--enable-encoder=mpeg4" - "--enable-decoder=mpeg4" - "--enable-encoder=libvpx_vp8" - "--enable-decoder=vp8" - "--enable-decoder=vp9" - "--enable-encoder=h263" - "--enable-encoder=h263p" - "--enable-decoder=h263" - "--enable-encoder=mjpeg" - "--enable-decoder=mjpeg" - "--enable-decoder=mjpegb" - "--enable-libspeex" - "--enable-libopus" - "--enable-libvpx" - "--enable-libx264" - "--enable-encoder=libspeex" - "--enable-decoder=libspeex" - "--enable-encoder=libopus" - "--enable-decoder=libopus" - - ;; Encoders/decoders for ringtones and audio streaming. - "--enable-decoder=flac" - "--enable-decoder=vorbis" - "--enable-decoder=aac" - "--enable-decoder=ac3" - "--enable-decoder=eac3" - "--enable-decoder=mp3" - "--enable-decoder=pcm_u24le" - "--enable-decoder=pcm_u32le" - "--enable-decoder=pcm_u8" - "--enable-decoder=pcm_f16le" - "--enable-decoder=pcm_f32le" - "--enable-decoder=pcm_f64le" - "--enable-decoder=pcm_s16le" - "--enable-decoder=pcm_s24le" - "--enable-decoder=pcm_s32le" - "--enable-decoder=pcm_s64le" - "--enable-decoder=pcm_u16le" - "--enable-encoder=pcm_u8" - "--enable-encoder=pcm_f32le" - "--enable-encoder=pcm_f64le" - "--enable-encoder=pcm_s16le" - "--enable-encoder=pcm_s32le" - "--enable-encoder=pcm_s64le" - - "--enable-decoder=pcm_s16be" - "--enable-decoder=pcm_s16be_planar" - "--enable-decoder=pcm_s16le_planar" - "--enable-decoder=pcm_s24be" - "--enable-decoder=pcm_s24le_planar" - "--enable-decoder=pcm_s32be" - "--enable-decoder=pcm_s32le_planar" - "--enable-decoder=pcm_s64be" - "--enable-decoder=pcm_s8" - "--enable-decoder=pcm_s8_planar" - "--enable-decoder=pcm_u16be" - - ;; Encoders/decoders for images. - "--enable-encoder=gif" - "--enable-decoder=gif" - "--enable-encoder=jpegls" - "--enable-decoder=jpegls" - "--enable-encoder=ljpeg" - "--enable-decoder=jpeg2000" - "--enable-encoder=png" - "--enable-decoder=png" - "--enable-encoder=bmp" - "--enable-decoder=bmp" - "--enable-encoder=tiff" - "--enable-decoder=tiff" - - ;; Filters. - "--enable-filter=scale" - "--enable-filter=overlay" - "--enable-filter=amix" - "--enable-filter=amerge" - "--enable-filter=aresample" - "--enable-filter=format" - "--enable-filter=aformat" - "--enable-filter=fps" - "--enable-filter=transpose" - "--enable-filter=pad" - - "--enable-filter=afir" - "--enable-filter=split" - "--enable-filter=drawbox" - "--enable-filter=drawtext" - "--enable-filter=rotate" - "--enable-filter=loop" - "--enable-filter=setpts" - "--enable-filter=movie" - "--enable-filter=alphamerge" - "--enable-filter=boxblur" - "--enable-filter=lut" - "--enable-filter=negate" - "--enable-filter=colorkey" - "--enable-filter=transpose")) - -(define %ffmpeg-linux-configure-flags - '("--enable-pic" - "--extra-cxxflags=-fPIC" - "--extra-cflags=-fPIC" - "--target-os=linux" - "--enable-indev=v4l2" - "--enable-indev=xcbgrab" - "--enable-vdpau" - "--enable-hwaccel=h264_vdpau" - "--enable-hwaccel=mpeg4_vdpau" - "--enable-vaapi" - "--enable-hwaccel=h264_vaapi" - "--enable-hwaccel=mpeg4_vaapi" - "--enable-hwaccel=h263_vaapi" - "--enable-hwaccel=vp8_vaapi" - "--enable-hwaccel=mjpeg_vaapi" - "--enable-hwaccel=hevc_vaapi" - "--enable-encoder=h264_vaapi" - "--enable-encoder=vp8_vaapi" - "--enable-encoder=mjpeg_vaapi" - "--enable-encoder=hevc_vaapi")) - -(define (ffmpeg-compose-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 - (inherit ffmpeg) - (name "ffmpeg-jami") - (arguments - (substitute-keyword-arguments (package-arguments ffmpeg) - ((#:configure-flags _ '()) - #~(cons* "--disable-static" - "--enable-shared" - "--disable-stripping" - #$(ffmpeg-compose-configure-flags))) - ((#:phases phases) - #~(modify-phases #$phases - (add-after 'unpack 'apply-patches - (lambda _ - ;; These patches come from: - ;; "jami-project/daemon/contrib/src/ffmpeg/rules.mak". - (#$jami-apply-custom-patches - #:dep-name "ffmpeg" - #:patches '("remove-mjpeg-log" - "change-RTCP-ratio" - "rtp_ext_abs_send_time" - "libopusdec-enable-FEC" - "libopusenc-reload-packet-loss-at-encode" - "screen-sharing-x11-fix")))))))))) - (define-public libjami (package (name "libjami") diff --git a/gnu/packages/patches/ffmpeg-jami-change-RTCP-ratio.patch b/gnu/packages/patches/ffmpeg-jami-change-RTCP-ratio.patch new file mode 100644 index 0000000000..6248165d8c --- /dev/null +++ b/gnu/packages/patches/ffmpeg-jami-change-RTCP-ratio.patch @@ -0,0 +1,27 @@ +From a884b62c9e6f23b9f4369d724e25db2f42dad28d Mon Sep 17 00:00:00 2001 +From: Pierre LESPAGNOL +Date: Tue, 28 May 2019 16:18:20 -0400 +Subject: [PATCH] Changement du ratio de 0.5% a 5% + +--- + libavformat/rtp.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libavformat/rtp.h b/libavformat/rtp.h +index 54512c6f71..16916ff86a 100644 +--- a/libavformat/rtp.h ++++ b/libavformat/rtp.h +@@ -78,8 +78,8 @@ enum AVCodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type); + #define RTP_VERSION 2 + #define RTP_MAX_SDES 256 /**< maximum text length for SDES */ + +-/* RTCP packets use 0.5% of the bandwidth */ +-#define RTCP_TX_RATIO_NUM 5 ++/* RTCP packets use 2.5% of the bandwidth */ ++#define RTCP_TX_RATIO_NUM 25 + #define RTCP_TX_RATIO_DEN 1000 + + /* An arbitrary id value for RTP Xiph streams - only relevant to indicate +-- +2.17.1 + diff --git a/gnu/packages/patches/ffmpeg-jami-libopusdec-enable-FEC.patch b/gnu/packages/patches/ffmpeg-jami-libopusdec-enable-FEC.patch new file mode 100644 index 0000000000..fb9466a4fc --- /dev/null +++ b/gnu/packages/patches/ffmpeg-jami-libopusdec-enable-FEC.patch @@ -0,0 +1,127 @@ +diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c +index 9b9a610343..8ec5bfc1ad 100644 +--- a/libavcodec/libopusdec.c ++++ b/libavcodec/libopusdec.c +@@ -45,6 +45,8 @@ struct libopus_context { + #ifdef OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST + int apply_phase_inv; + #endif ++ int decode_fec; ++ int64_t expected_next_pts; + }; + + #define OPUS_HEAD_SIZE 19 +@@ -141,6 +143,8 @@ static av_cold int libopus_decode_init(AVCodecContext *avc) + /* Decoder delay (in samples) at 48kHz */ + avc->delay = avc->internal->skip_samples = opus->pre_skip; + ++ opus->expected_next_pts = AV_NOPTS_VALUE; ++ + return 0; + } + +@@ -161,27 +165,82 @@ static int libopus_decode(AVCodecContext *avc, AVFrame *frame, + int *got_frame_ptr, AVPacket *pkt) + { + struct libopus_context *opus = avc->priv_data; +- int ret, nb_samples; ++ uint8_t *outptr; ++ int ret, nb_samples = 0, nb_lost_samples = 0, nb_samples_left; ++ ++ // If FEC is enabled, calculate number of lost samples ++ if (opus->decode_fec && ++ opus->expected_next_pts != AV_NOPTS_VALUE && ++ pkt->pts != AV_NOPTS_VALUE && ++ pkt->pts != opus->expected_next_pts) { ++ // Cap at recovering 120 ms of lost audio. ++ nb_lost_samples = pkt->pts - opus->expected_next_pts; ++ nb_lost_samples = FFMIN(nb_lost_samples, MAX_FRAME_SIZE); ++ } + +- frame->nb_samples = MAX_FRAME_SIZE; ++ frame->nb_samples = MAX_FRAME_SIZE + nb_lost_samples; + if ((ret = ff_get_buffer(avc, frame, 0)) < 0) + return ret; + ++ outptr = frame->data[0]; ++ nb_samples_left = frame->nb_samples; ++ ++ if (opus->decode_fec && nb_lost_samples) { ++ // Try to recover the lost samples with FEC data from this one. ++ // If there's no FEC data, the decoder will do loss concealment instead. ++ if (avc->sample_fmt == AV_SAMPLE_FMT_S16) ++ nb_samples = opus_multistream_decode(opus->dec, pkt->data, pkt->size, ++ (opus_int16 *)outptr, ++ nb_lost_samples, 1); ++ else ++ nb_samples = opus_multistream_decode_float(opus->dec, pkt->data, pkt->size, ++ (float *)outptr, ++ nb_lost_samples, 1); ++ ++ if (nb_samples < 0) { ++ av_log(avc, AV_LOG_ERROR, "Decoding error: %s\n", ++ opus_strerror(nb_samples)); ++ return ff_opus_error_to_averror(nb_samples); ++ } ++ ++ av_log(avc, AV_LOG_WARNING, "Recovered %d samples with FEC/PLC\n", ++ nb_samples); ++ ++ outptr += nb_samples * avc->channels * av_get_bytes_per_sample(avc->sample_fmt); ++ nb_samples_left -= nb_samples; ++ if (pkt->pts != AV_NOPTS_VALUE) { ++ pkt->pts -= nb_samples; ++ frame->pts = pkt->pts; ++ } ++ } ++ ++ // Decode the actual, non-lost data. + if (avc->sample_fmt == AV_SAMPLE_FMT_S16) +- nb_samples = opus_multistream_decode(opus->dec, pkt->data, pkt->size, +- (opus_int16 *)frame->data[0], +- frame->nb_samples, 0); ++ ret = opus_multistream_decode(opus->dec, pkt->data, pkt->size, ++ (opus_int16 *)outptr, ++ nb_samples_left, 0); + else +- nb_samples = opus_multistream_decode_float(opus->dec, pkt->data, pkt->size, +- (float *)frame->data[0], +- frame->nb_samples, 0); ++ ret = opus_multistream_decode_float(opus->dec, pkt->data, pkt->size, ++ (float *)outptr, ++ nb_samples_left, 0); + +- if (nb_samples < 0) { ++ if (ret < 0) { + av_log(avc, AV_LOG_ERROR, "Decoding error: %s\n", +- opus_strerror(nb_samples)); +- return ff_opus_error_to_averror(nb_samples); ++ opus_strerror(ret)); ++ return ff_opus_error_to_averror(ret); + } + ++ nb_samples += ret; ++ ++ if (opus->decode_fec) ++ { ++ // Calculate the next expected pts ++ if (pkt->pts == AV_NOPTS_VALUE) { ++ opus->expected_next_pts = AV_NOPTS_VALUE; ++ } else { ++ opus->expected_next_pts = pkt->pts + nb_samples; ++ } ++ } + #ifndef OPUS_SET_GAIN + { + int i = avc->ch_layout.nb_channels * nb_samples; +@@ -220,6 +279,7 @@ static const AVOption libopusdec_options[] = { + #ifdef OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST + { "apply_phase_inv", "Apply intensity stereo phase inversion", OFFSET(apply_phase_inv), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS }, + #endif ++ { "decode_fec", "Decode FEC data or use PLC", OFFSET(decode_fec), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, + { NULL }, + }; + +-- +2.34.1 + diff --git a/gnu/packages/patches/ffmpeg-jami-libopusenc-enable-FEC.patch b/gnu/packages/patches/ffmpeg-jami-libopusenc-enable-FEC.patch new file mode 100644 index 0000000000..43b786c567 --- /dev/null +++ b/gnu/packages/patches/ffmpeg-jami-libopusenc-enable-FEC.patch @@ -0,0 +1,50 @@ +diff --git a/libavcodec/libopusencc.c b/libavcodec/libopusencc.c +index 2a97811d18..40ee7b8fec 100644 +--- a/libavcodec/libopusenc.c ++++ b/libavcodec/libopusenc.c +@@ -33,6 +33,7 @@ + typedef struct LibopusEncOpts { + int vbr; + int application; ++ int enable_fec; + int packet_loss; + int complexity; + float frame_duration; +@@ -143,6 +144,13 @@ + "Unable to set constrained VBR: %s\n", opus_strerror(ret)); + + ret = opus_multistream_encoder_ctl(enc, ++ OPUS_SET_INBAND_FEC(opts->enable_fec)); ++ if (ret != OPUS_OK) ++ av_log(avctx, AV_LOG_WARNING, ++ "Unable to set enable FEC flag percentage: %s\n", ++ opus_strerror(ret)); ++ ++ ret = opus_multistream_encoder_ctl(enc, + OPUS_SET_PACKET_LOSS_PERC(opts->packet_loss)); + if (ret != OPUS_OK) + av_log(avctx, AV_LOG_WARNING, +@@ -452,6 +460,15 @@ + int ret; + int discard_padding; + ++ // Reload packet loss setting ++ ret = opus_multistream_encoder_ctl(opus->enc, ++ OPUS_SET_PACKET_LOSS_PERC(opus->opts.packet_loss)); ++ if (ret != OPUS_OK) ++ av_log(avctx, AV_LOG_WARNING, ++ "Unable to set expected packet loss percentage: %s\n", ++ opus_strerror(ret)); ++ ++ + if (frame) { + ret = ff_af_queue_add(&opus->afq, frame); + if (ret < 0) +@@ -543,6 +560,7 @@ + { "audio", "Favor faithfulness to the input", 0, AV_OPT_TYPE_CONST, { .i64 = OPUS_APPLICATION_AUDIO }, 0, 0, FLAGS, "application" }, + { "lowdelay", "Restrict to only the lowest delay modes", 0, AV_OPT_TYPE_CONST, { .i64 = OPUS_APPLICATION_RESTRICTED_LOWDELAY }, 0, 0, FLAGS, "application" }, + { "frame_duration", "Duration of a frame in milliseconds", OFFSET(frame_duration), AV_OPT_TYPE_FLOAT, { .dbl = 20.0 }, 2.5, 120.0, FLAGS }, ++ { "enable_fec", "Enable forward error correction", OFFSET(enable_fec), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, + { "packet_loss", "Expected packet loss percentage", OFFSET(packet_loss), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100, FLAGS }, + { "vbr", "Variable bit rate mode", OFFSET(vbr), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 2, FLAGS, "vbr" }, + { "off", "Use constant bit rate", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "vbr" }, diff --git a/gnu/packages/patches/ffmpeg-jami-libopusenc-reload-packet-loss-at-encode.patch b/gnu/packages/patches/ffmpeg-jami-libopusenc-reload-packet-loss-at-encode.patch new file mode 100644 index 0000000000..5c4bd4d3eb --- /dev/null +++ b/gnu/packages/patches/ffmpeg-jami-libopusenc-reload-packet-loss-at-encode.patch @@ -0,0 +1,44 @@ +From dba13d03bc8e827fededc20b0ab1f574a1500f2a Mon Sep 17 00:00:00 2001 +From: Philip-Dylan Gleonec +Date: Thu, 11 Feb 2021 12:25:14 +0100 +Subject: [PATCH 2/2] avcodec/libopusenc: reload packet loss at encode + +An estimation of packet loss is required by libopus to compute its FEC +data. Currently, this estimation is constant, and can not be changed +after configuration. This means an application using libopus through +ffmpeg can not adapt the packet loss estimation when the network +quality degrades. + +This patch makes the encoder reload the packet_loss AVOption before +encoding samples, if fec is enabled. This way an application can modify +the packet loss estimation by changing the AVOption. Typical use-case +is a RTP stream, where packet loss can be estimated from RTCP packets. + +Signed-off-by: Philip-Dylan Gleonec +--- + libavcodec/libopusenc.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c +index 70d17f802b..c18e8ae7fa 100644 +--- a/libavcodec/libopusenc.c ++++ b/libavcodec/libopusenc.c +@@ -460,6 +460,15 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt, + int ret; + int discard_padding; + ++ if (opus->opts.fec) { ++ ret = opus_multistream_encoder_ctl(opus->enc, ++ OPUS_SET_PACKET_LOSS_PERC(opus->opts.packet_loss)); ++ if (ret != OPUS_OK) ++ av_log(avctx, AV_LOG_WARNING, ++ "Unable to set expected packet loss percentage: %s\n", ++ opus_strerror(ret)); ++ } ++ + if (frame) { + ret = ff_af_queue_add(&opus->afq, frame); + if (ret < 0) +-- +2.25.1 + diff --git a/gnu/packages/patches/ffmpeg-jami-remove-mjpeg-log.patch b/gnu/packages/patches/ffmpeg-jami-remove-mjpeg-log.patch new file mode 100644 index 0000000000..595baea9c9 --- /dev/null +++ b/gnu/packages/patches/ffmpeg-jami-remove-mjpeg-log.patch @@ -0,0 +1,26 @@ +From c557a6211f5a29d89fc2ab561e0fb3d8878fb6ad Mon Sep 17 00:00:00 2001 +From: philippegorley +Date: Mon, 17 Dec 2018 15:27:57 -0500 +Subject: [PATCH] remove mjpeg log + +--- + libavcodec/mjpegdec.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c +index d1dca84d36..4a26c23cd4 100644 +--- a/libavcodec/mjpegdec.c ++++ b/libavcodec/mjpegdec.c +@@ -2294,9 +2294,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, + "restart marker: %d\n", start_code & 0x0f); + /* APP fields */ + } else if (start_code >= APP0 && start_code <= APP15) { +- if ((ret = mjpeg_decode_app(s)) < 0) +- av_log(avctx, AV_LOG_ERROR, "unable to decode APP fields: %s\n", +- av_err2str(ret)); ++ ret = mjpeg_decode_app(s); + /* Comment */ + } else if (start_code == COM) { + ret = mjpeg_decode_com(s); +-- +2.17.1 diff --git a/gnu/packages/patches/ffmpeg-jami-rtp_ext_abs_send_time.patch b/gnu/packages/patches/ffmpeg-jami-rtp_ext_abs_send_time.patch new file mode 100644 index 0000000000..cf52cf972a --- /dev/null +++ b/gnu/packages/patches/ffmpeg-jami-rtp_ext_abs_send_time.patch @@ -0,0 +1,71 @@ +diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c +index 63047beccc..d59ec3dc8c 100644 +--- a/libavformat/rtpenc.c ++++ b/libavformat/rtpenc.c +@@ -28,6 +28,8 @@ + + #include "rtpenc.h" + ++#define EXT_ABS_SEND_TIME ++ + static const AVOption options[] = { + FF_RTP_FLAG_OPTS(RTPMuxContext, flags), + { "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM }, +@@ -146,7 +148,11 @@ static int rtp_write_header(AVFormatContext *s1) + s1->pb->max_packet_size); + } else + s1->packet_size = s1->pb->max_packet_size; ++#ifdef EXT_ABS_SEND_TIME ++ if (s1->packet_size <= 20) { ++#else + if (s1->packet_size <= 12) { ++#endif + av_log(s1, AV_LOG_ERROR, "Max packet size %u too low\n", s1->packet_size); + return AVERROR(EIO); + } +@@ -154,7 +160,11 @@ static int rtp_write_header(AVFormatContext *s1) + if (!s->buf) { + return AVERROR(ENOMEM); + } ++#ifdef EXT_ABS_SEND_TIME ++ s->max_payload_size = s1->packet_size - 20; ++#else + s->max_payload_size = s1->packet_size - 12; ++#endif + + if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { + avpriv_set_pts_info(st, 32, 1, st->codecpar->sample_rate); +@@ -332,16 +342,34 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time, int bye) + void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m) + { + RTPMuxContext *s = s1->priv_data; ++ uint64_t ntp64_time; ++ uint32_t absoluteSendTime; + + av_log(s1, AV_LOG_TRACE, "rtp_send_data size=%d\n", len); + + /* build the RTP header */ ++#ifdef EXT_ABS_SEND_TIME ++ avio_w8(s1->pb, RTP_VERSION << 6 | 0x10); // extention bit ++#else + avio_w8(s1->pb, RTP_VERSION << 6); ++#endif + avio_w8(s1->pb, (s->payload_type & 0x7f) | ((m & 0x01) << 7)); + avio_wb16(s1->pb, s->seq); + avio_wb32(s1->pb, s->timestamp); + avio_wb32(s1->pb, s->ssrc); + ++#ifdef EXT_ABS_SEND_TIME ++ avio_wb16(s1->pb, 0xBEDE); // magic word ++ avio_wb16(s1->pb, 0x0001); // length=1 ++ avio_w8(s1->pb, 0x32); // ID=3 and lenght=2 ++ ntp64_time = ff_get_formatted_ntp_time(ff_ntp_time()); ++ absoluteSendTime = (uint32_t)((ntp64_time>> 14) & 0x00ffffff); ++ av_log(s1, AV_LOG_TRACE, "ntp64:%lu, abs_time:%u\n", ntp64_time, absoluteSendTime); ++ avio_w8(s1->pb, (uint8_t)(absoluteSendTime >> 16)); ++ avio_w8(s1->pb, (uint8_t)(absoluteSendTime >> 8 & 0xff)); ++ avio_w8(s1->pb, (uint8_t)(absoluteSendTime & 0xff)); ++#endif ++ + avio_write(s1->pb, buf1, len); + avio_flush(s1->pb); diff --git a/gnu/packages/patches/ffmpeg-jami-screen-sharing-x11-fix.patch b/gnu/packages/patches/ffmpeg-jami-screen-sharing-x11-fix.patch new file mode 100644 index 0000000000..e54a346706 --- /dev/null +++ b/gnu/packages/patches/ffmpeg-jami-screen-sharing-x11-fix.patch @@ -0,0 +1,302 @@ +From c1b210534b15188c964b31dc47e172f8ed4aca55 Mon Sep 17 00:00:00 2001 +From: Aline Gondim Santos +Date: Tue, 19 Jul 2022 13:35:19 -0300 +Subject: [PATCH] Screen sharing x11 fixes + ++ We can now have a single stream in the x11grab, which can be updated to follow window resizing ++ Due to stream reinit, shm may cause memory issues and was removed ++ Adds one option (is_area) that defines if we are grabing a region of the display/window or the hole screen/window. + +note: This is a custom patch for later rebase +--- + libavdevice/xcbgrab.c | 186 ++++++++++-------------------------------- + 1 file changed, 45 insertions(+), 141 deletions(-) + +diff --git a/libavdevice/xcbgrab.c b/libavdevice/xcbgrab.c +index 64a68ba497..76e654b424 100644 +--- a/libavdevice/xcbgrab.c ++++ b/libavdevice/xcbgrab.c +@@ -29,11 +29,6 @@ + #include + #endif + +-#if CONFIG_LIBXCB_SHM +-#include +-#include +-#endif +- + #if CONFIG_LIBXCB_SHAPE + #include + #endif +@@ -53,9 +48,6 @@ typedef struct XCBGrabContext { + xcb_connection_t *conn; + xcb_screen_t *screen; + xcb_window_t window; +-#if CONFIG_LIBXCB_SHM +- AVBufferPool *shm_pool; +-#endif + int64_t time_frame; + AVRational time_base; + int64_t frame_duration; +@@ -72,10 +64,9 @@ typedef struct XCBGrabContext { + int region_border; + int centered; + int select_region; ++ int is_area; + + const char *framerate; +- +- int has_shm; + } XCBGrabContext; + + #define FOLLOW_CENTER -1 +@@ -97,6 +88,7 @@ static const AVOption options[] = { + { "show_region", "Show the grabbing region.", OFFSET(show_region), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D }, + { "region_border", "Set the region border thickness.", OFFSET(region_border), AV_OPT_TYPE_INT, { .i64 = 3 }, 1, 128, D }, + { "select_region", "Select the grabbing region graphically using the pointer.", OFFSET(select_region), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, D }, ++ { "is_area", "Define if we are grabing a region of the display/window.", OFFSET(is_area), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, D }, + { NULL }, + }; + +@@ -216,99 +208,6 @@ static int64_t wait_frame(AVFormatContext *s, AVPacket *pkt) + return curtime; + } + +-#if CONFIG_LIBXCB_SHM +-static int check_shm(xcb_connection_t *conn) +-{ +- xcb_shm_query_version_cookie_t cookie = xcb_shm_query_version(conn); +- xcb_shm_query_version_reply_t *reply; +- +- reply = xcb_shm_query_version_reply(conn, cookie, NULL); +- if (reply) { +- free(reply); +- return 1; +- } +- +- return 0; +-} +- +-static void free_shm_buffer(void *opaque, uint8_t *data) +-{ +- shmdt(data); +-} +- +-static AVBufferRef *allocate_shm_buffer(void *opaque, size_t size) +-{ +- xcb_connection_t *conn = opaque; +- xcb_shm_seg_t segment; +- AVBufferRef *ref; +- uint8_t *data; +- int id; +- +- id = shmget(IPC_PRIVATE, size, IPC_CREAT | 0777); +- if (id == -1) +- return NULL; +- +- segment = xcb_generate_id(conn); +- xcb_shm_attach(conn, segment, id, 0); +- data = shmat(id, NULL, 0); +- shmctl(id, IPC_RMID, 0); +- if ((intptr_t)data == -1 || !data) +- return NULL; +- +- ref = av_buffer_create(data, size, free_shm_buffer, (void *)(ptrdiff_t)segment, 0); +- if (!ref) +- shmdt(data); +- +- return ref; +-} +- +-static int xcbgrab_frame_shm(AVFormatContext *s, AVPacket *pkt) +-{ +- XCBGrabContext *c = s->priv_data; +- xcb_shm_get_image_cookie_t iq; +- xcb_shm_get_image_reply_t *img; +- xcb_drawable_t drawable = c->window_id; +- xcb_generic_error_t *e = NULL; +- AVBufferRef *buf; +- xcb_shm_seg_t segment; +- +- buf = av_buffer_pool_get(c->shm_pool); +- if (!buf) { +- av_log(s, AV_LOG_ERROR, "Could not get shared memory buffer.\n"); +- return AVERROR(ENOMEM); +- } +- segment = (xcb_shm_seg_t)(uintptr_t)av_buffer_pool_buffer_get_opaque(buf); +- +- iq = xcb_shm_get_image(c->conn, drawable, +- c->x, c->y, c->width, c->height, ~0, +- XCB_IMAGE_FORMAT_Z_PIXMAP, segment, 0); +- img = xcb_shm_get_image_reply(c->conn, iq, &e); +- +- xcb_flush(c->conn); +- +- if (e) { +- av_log(s, AV_LOG_ERROR, +- "Cannot get the image data " +- "event_error: response_type:%u error_code:%u " +- "sequence:%u resource_id:%u minor_code:%u major_code:%u.\n", +- e->response_type, e->error_code, +- e->sequence, e->resource_id, e->minor_code, e->major_code); +- +- free(e); +- av_buffer_unref(&buf); +- return AVERROR(EACCES); +- } +- +- free(img); +- +- pkt->buf = buf; +- pkt->data = buf->data; +- pkt->size = c->frame_size; +- +- return 0; +-} +-#endif /* CONFIG_LIBXCB_SHM */ +- + #if CONFIG_LIBXCB_XFIXES + static int check_xfixes(xcb_connection_t *conn) + { +@@ -462,14 +361,7 @@ static int xcbgrab_read_packet(AVFormatContext *s, AVPacket *pkt) + if (c->show_region) + xcbgrab_update_region(s, win_x, win_y); + +-#if CONFIG_LIBXCB_SHM +- if (c->has_shm && xcbgrab_frame_shm(s, pkt) < 0) { +- av_log(s, AV_LOG_WARNING, "Continuing without shared memory.\n"); +- c->has_shm = 0; +- } +-#endif +- if (!c->has_shm) +- ret = xcbgrab_frame(s, pkt); ++ ret = xcbgrab_frame(s, pkt); + pkt->dts = pkt->pts = pts; + pkt->duration = c->frame_duration; + +@@ -488,11 +380,8 @@ static av_cold int xcbgrab_read_close(AVFormatContext *s) + { + XCBGrabContext *ctx = s->priv_data; + +-#if CONFIG_LIBXCB_SHM +- av_buffer_pool_uninit(&ctx->shm_pool); +-#endif +- + xcb_disconnect(ctx->conn); ++ ctx->conn = NULL; + + return 0; + } +@@ -572,7 +461,15 @@ static int pixfmt_from_pixmap_format(AVFormatContext *s, int depth, + static int create_stream(AVFormatContext *s) + { + XCBGrabContext *c = s->priv_data; +- AVStream *st = avformat_new_stream(s, NULL); ++ ++ // If we try to open another stream to x11grab, there is no reason ++ // to keep more than one stream in the context. ++ AVStream *st; ++ if (!s->nb_streams) { ++ st = avformat_new_stream(s, NULL); ++ } else { ++ st = s->streams[0]; ++ } + xcb_get_geometry_cookie_t gc; + xcb_get_geometry_reply_t *geo; + int64_t frame_size_bits; +@@ -594,11 +491,26 @@ static int create_stream(AVFormatContext *s) + return AVERROR_EXTERNAL; + } + ++ // av_log(s, AV_LOG_ERROR, "Capture is_area %d\n", c->is_area); ++ // Width and Height are not 0 only when we set a window area to share ++ // This if may be valid only in the first call to create_stream + if (!c->width || !c->height) { ++ // av_log(s, AV_LOG_ERROR, "Capture area!\n"); ++ c->is_area = 0; ++ c->width = geo->width; ++ c->height = geo->height; ++ } ++ // If not a predefined area, then we should follow geometry changes ++ // This can be valid only on the second call onwards ++ if (!c->is_area && (c->width != geo->width || c->height != geo->height)) { + c->width = geo->width; + c->height = geo->height; + } + ++ // av_log(s, AV_LOG_ERROR, "Capture area %dx%d at position %d.%d\n", ++ // c->width, c->height, ++ // c->x, c->y); ++ + if (c->x + c->width > geo->width || + c->y + c->height > geo->height) { + av_log(s, AV_LOG_ERROR, +@@ -628,13 +540,6 @@ static int create_stream(AVFormatContext *s) + } + c->frame_size = frame_size_bits / 8; + +-#if CONFIG_LIBXCB_SHM +- c->shm_pool = av_buffer_pool_init2(c->frame_size + AV_INPUT_BUFFER_PADDING_SIZE, +- c->conn, allocate_shm_buffer, NULL); +- if (!c->shm_pool) +- return AVERROR(ENOMEM); +-#endif +- + st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; + st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; + st->codecpar->width = c->width; +@@ -829,23 +734,26 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s) + sscanf(s->url, "+%d,%d", &c->x, &c->y); + } + +- c->conn = xcb_connect(display_name[0] ? display_name : NULL, &screen_num); +- av_freep(&display_name); ++ if (!c->conn || !c->screen) { ++ xcbgrab_read_close(s); ++ c->conn = xcb_connect(display_name[0] ? display_name : NULL, &screen_num); ++ av_freep(&display_name); + +- if ((ret = xcb_connection_has_error(c->conn))) { +- av_log(s, AV_LOG_ERROR, "Cannot open display %s, error %d.\n", +- s->url[0] ? s->url : "default", ret); +- return AVERROR(EIO); +- } ++ if ((ret = xcb_connection_has_error(c->conn))) { ++ av_log(s, AV_LOG_ERROR, "Cannot open display %s, error %d.\n", ++ s->url[0] ? s->url : "default", ret); ++ return AVERROR(EIO); ++ } + +- setup = xcb_get_setup(c->conn); ++ setup = xcb_get_setup(c->conn); + +- c->screen = get_screen(setup, screen_num); +- if (!c->screen) { +- av_log(s, AV_LOG_ERROR, "The screen %d does not exist.\n", +- screen_num); +- xcbgrab_read_close(s); +- return AVERROR(EIO); ++ c->screen = get_screen(setup, screen_num); ++ if (!c->screen) { ++ av_log(s, AV_LOG_ERROR, "The screen %d does not exist.\n", ++ screen_num); ++ xcbgrab_read_close(s); ++ return AVERROR(EIO); ++ } + } + + if (c->window_id == XCB_NONE) +@@ -876,10 +784,6 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s) + return ret; + } + +-#if CONFIG_LIBXCB_SHM +- c->has_shm = check_shm(c->conn); +-#endif +- + #if CONFIG_LIBXCB_XFIXES + if (c->draw_mouse) { + if (!(c->draw_mouse = check_xfixes(c->conn))) { +-- +2.34.1 + diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index de812ac762..d751442561 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -50,7 +50,7 @@ ;;; Copyright © 2021 Alexey Abramov ;;; Copyright © 2021, 2022, 2023 Andrew Tropin ;;; Copyright © 2021 David Wilson -;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer +;;; Copyright © 2021, 2022, 2023, 2024 Maxim Cournoyer ;;; Copyright © 2020 Hartmut Goebel ;;; Copyright © 2021 Raghav Gururajan ;;; Copyright © 2021 Thiago Jung Bauermann @@ -2000,6 +2000,252 @@ audio/video codec library.") "--enable-static")))) (inputs '())))) +;;; Custom ffmpeg package used by Jami, which incorporates custom patches. +(define-public ffmpeg-jami + (package + (inherit ffmpeg) + (name "ffmpeg-jami") + (source (let ((ffmpeg-origin (package-source ffmpeg))) + (origin + (inherit ffmpeg-origin) + ;; These patches originate come from + ;; . + ;; Make sure to keep them update and/or register any new ones + ;; here. + (patches + (append + (origin-patches ffmpeg-origin) + (search-patches + "ffmpeg-jami-remove-mjpeg-log.patch" + "ffmpeg-jami-change-RTCP-ratio.patch" + "ffmpeg-jami-rtp_ext_abs_send_time.patch" + "ffmpeg-jami-libopusdec-enable-FEC.patch" + "ffmpeg-jami-libopusenc-reload-packet-loss-at-encode.patch" + "ffmpeg-jami-screen-sharing-x11-fix.patch")))))) + (arguments + (substitute-keyword-arguments (package-arguments ffmpeg) + ((#:configure-flags _ '()) + #~(list "--disable-static" + "--enable-shared" + "--disable-stripping" + ;; The following variables are configure flags used by + ;; ffmpeg-jami. They're 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). + ;; An exception are the ffnvcodec-related switches, which is + ;; not packaged in Guix and would not work with Mesa. + #$@(if (string-contains (%current-system) "linux") + '("--enable-pic" + "--extra-cxxflags=-fPIC" + "--extra-cflags=-fPIC" + "--target-os=linux" + "--enable-indev=v4l2" + "--enable-indev=xcbgrab" + "--enable-vdpau" + "--enable-hwaccel=h264_vdpau" + "--enable-hwaccel=mpeg4_vdpau" + "--enable-vaapi" + "--enable-hwaccel=h264_vaapi" + "--enable-hwaccel=mpeg4_vaapi" + "--enable-hwaccel=h263_vaapi" + "--enable-hwaccel=vp8_vaapi" + "--enable-hwaccel=mjpeg_vaapi" + "--enable-hwaccel=hevc_vaapi" + "--enable-encoder=h264_vaapi" + "--enable-encoder=vp8_vaapi" + "--enable-encoder=mjpeg_vaapi" + "--enable-encoder=hevc_vaapi") + '()) + "--disable-everything" + "--enable-zlib" + "--enable-gpl" + "--enable-swscale" + "--enable-bsfs" + "--disable-filters" + "--disable-programs" + "--disable-postproc" + "--disable-protocols" + "--enable-protocol=crypto" + "--enable-protocol=file" + "--enable-protocol=rtp" + "--enable-protocol=srtp" + "--enable-protocol=tcp" + "--enable-protocol=udp" + "--enable-protocol=unix" + "--enable-protocol=pipe" + + ;; Enable muxers/demuxers. + "--disable-demuxers" + "--disable-muxers" + "--enable-muxer=rtp" + "--enable-muxer=g722" + "--enable-muxer=g726" + "--enable-muxer=g726le" + "--enable-muxer=h263" + "--enable-muxer=h264" + "--enable-muxer=hevc" + "--enable-muxer=matroska" + "--enable-muxer=wav" + "--enable-muxer=webm" + "--enable-muxer=ogg" + "--enable-muxer=pcm_s16be" + "--enable-muxer=pcm_s16le" + "--enable-demuxer=rtp" + "--enable-demuxer=mjpeg" + "--enable-demuxer=mjpeg_2000" + "--enable-demuxer=mpegvideo" + "--enable-demuxer=gif" + "--enable-demuxer=image_jpeg_pipe" + "--enable-demuxer=image_png_pipe" + "--enable-demuxer=image_webp_pipe" + "--enable-demuxer=matroska" + "--enable-demuxer=m4v" + "--enable-demuxer=mp3" + "--enable-demuxer=ogg" + "--enable-demuxer=flac" + "--enable-demuxer=wav" + "--enable-demuxer=ac3" + "--enable-demuxer=g722" + "--enable-demuxer=g723_1" + "--enable-demuxer=g726" + "--enable-demuxer=g726le" + "--enable-demuxer=pcm_mulaw" + "--enable-demuxer=pcm_alaw" + "--enable-demuxer=pcm_s16be" + "--enable-demuxer=pcm_s16le" + "--enable-demuxer=h263" + "--enable-demuxer=h264" + "--enable-demuxer=hevc" + + ;; Enable parsers. + "--enable-parser=h263" + "--enable-parser=h264" + "--enable-parser=hevc" + "--enable-parser=mpeg4video" + "--enable-parser=vp8" + "--enable-parser=vp9" + "--enable-parser=opus" + + ;; Encoders/decoders. + "--enable-encoder=adpcm_g722" + "--enable-decoder=adpcm_g722" + "--enable-encoder=adpcm_g726" + "--enable-decoder=adpcm_g726" + "--enable-encoder=adpcm_g726le" + "--enable-decoder=adpcm_g726le" + "--enable-decoder=g729" + "--enable-encoder=g723_1" + "--enable-decoder=g723_1" + "--enable-encoder=rawvideo" + "--enable-decoder=rawvideo" + "--enable-encoder=libx264" + "--enable-decoder=h264" + "--enable-encoder=pcm_alaw" + "--enable-decoder=pcm_alaw" + "--enable-encoder=pcm_mulaw" + "--enable-decoder=pcm_mulaw" + "--enable-encoder=mpeg4" + "--enable-decoder=mpeg4" + "--enable-encoder=libvpx_vp8" + "--enable-decoder=vp8" + "--enable-decoder=vp9" + "--enable-encoder=h263" + "--enable-encoder=h263p" + "--enable-decoder=h263" + "--enable-encoder=mjpeg" + "--enable-decoder=mjpeg" + "--enable-decoder=mjpegb" + "--enable-libspeex" + "--enable-libopus" + "--enable-libvpx" + "--enable-libx264" + "--enable-encoder=libspeex" + "--enable-decoder=libspeex" + "--enable-encoder=libopus" + "--enable-decoder=libopus" + + ;; Encoders/decoders for ringtones and audio streaming. + "--enable-decoder=flac" + "--enable-decoder=vorbis" + "--enable-decoder=aac" + "--enable-decoder=ac3" + "--enable-decoder=eac3" + "--enable-decoder=mp3" + "--enable-decoder=pcm_u24le" + "--enable-decoder=pcm_u32le" + "--enable-decoder=pcm_u8" + "--enable-decoder=pcm_f16le" + "--enable-decoder=pcm_f32le" + "--enable-decoder=pcm_f64le" + "--enable-decoder=pcm_s16le" + "--enable-decoder=pcm_s24le" + "--enable-decoder=pcm_s32le" + "--enable-decoder=pcm_s64le" + "--enable-decoder=pcm_u16le" + "--enable-encoder=pcm_u8" + "--enable-encoder=pcm_f32le" + "--enable-encoder=pcm_f64le" + "--enable-encoder=pcm_s16le" + "--enable-encoder=pcm_s32le" + "--enable-encoder=pcm_s64le" + + "--enable-decoder=pcm_s16be" + "--enable-decoder=pcm_s16be_planar" + "--enable-decoder=pcm_s16le_planar" + "--enable-decoder=pcm_s24be" + "--enable-decoder=pcm_s24le_planar" + "--enable-decoder=pcm_s32be" + "--enable-decoder=pcm_s32le_planar" + "--enable-decoder=pcm_s64be" + "--enable-decoder=pcm_s8" + "--enable-decoder=pcm_s8_planar" + "--enable-decoder=pcm_u16be" + + ;; Encoders/decoders for images. + "--enable-encoder=gif" + "--enable-decoder=gif" + "--enable-encoder=jpegls" + "--enable-decoder=jpegls" + "--enable-encoder=ljpeg" + "--enable-decoder=jpeg2000" + "--enable-encoder=png" + "--enable-decoder=png" + "--enable-encoder=bmp" + "--enable-decoder=bmp" + "--enable-encoder=tiff" + "--enable-decoder=tiff" + + ;; Filters. + "--enable-filter=scale" + "--enable-filter=overlay" + "--enable-filter=amix" + "--enable-filter=amerge" + "--enable-filter=aresample" + "--enable-filter=format" + "--enable-filter=aformat" + "--enable-filter=fps" + "--enable-filter=transpose" + "--enable-filter=pad" + + "--enable-filter=afir" + "--enable-filter=split" + "--enable-filter=drawbox" + "--enable-filter=drawtext" + "--enable-filter=rotate" + "--enable-filter=loop" + "--enable-filter=setpts" + "--enable-filter=movie" + "--enable-filter=alphamerge" + "--enable-filter=boxblur" + "--enable-filter=lut" + "--enable-filter=negate" + "--enable-filter=colorkey" + "--enable-filter=transpose")))))) + (define-public ffmpegthumbnailer (package (name "ffmpegthumbnailer") -- cgit v1.2.3 From 8237f4e9970623f4e7d91d49fcfa12b2854ddef6 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 18 Aug 2023 01:11:25 -0400 Subject: gnu: jami: Update to 20231222.2. * gnu/packages/jami.scm (%jami-version): Rename to... (%jami-nightly-version): ... this. Update to 20231222.2. (%jami-daemon-commit): New variable. (%jami-sources): Delete variable. (libjami) Adjust source to use %jami-nightly-version, %jami-daemon-commit. [source]: Fetch from git. Apply libjami-ac-config-files.patch. [arguments] : Skip ut_media_player test. : Add extend-scheduler-test-timeout and extend-scheduler-test-timeout phases. [inputs]: Replace dbus-c++ with sdbus-c++. Add dhtnet. Replace libgit2 with libgit2-1.6. (jami): Set version to %jami-nightly-version. [source]: Fetch from git. Apply new jami-qml-tests-discovery.patch, jami-skip-tests-requiring-internet.patch and jami-unbundle-dependencies.patch patches. [arguments] : Add -DWITH_DAEMON_SUBMODULE=OFF. : Delete change-directory/maybe. Adjust check phase. Add fake-x11-environment, copy-3rdparty-source-dependencies and disable-problematic-tests phases. [inputs]: Add md4c and tidy-html. * gnu/packages/patches/jami-qml-tests-discovery.patch: New file. * gnu/packages/patches/libjami-ac-config-files.patch: Likewise. * gnu/packages/patches/jami-skip-tests-requiring-internet.patch: Likewise. * gnu/packages/patches/jami-unbundle-dependencies.patch: Likewise. * gnu/packages/patches/jami-libjami-headers-search.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Update accordingly. * gnu/packages/patches/jami-disable-integration-tests.patch: Adjust patch. Series-changes: 2 - Update Jami to latest nightly version (20231222.2) Change-Id: If30f1178bdfa29c4ea3e54dbb7997e360788adae --- gnu/local.mk | 4 + gnu/packages/jami.scm | 124 +++++++++++++-------- .../patches/jami-disable-integration-tests.patch | 10 +- .../patches/jami-libjami-headers-search.patch | 5 +- .../patches/jami-qml-tests-discovery.patch | 15 +++ .../jami-skip-tests-requiring-internet.patch | 51 +++++++++ .../patches/jami-unbundle-dependencies.patch | 71 ++++++++++++ gnu/packages/patches/libjami-ac-config-files.patch | 52 +++++++++ 8 files changed, 280 insertions(+), 52 deletions(-) create mode 100644 gnu/packages/patches/jami-qml-tests-discovery.patch create mode 100644 gnu/packages/patches/jami-skip-tests-requiring-internet.patch create mode 100644 gnu/packages/patches/jami-unbundle-dependencies.patch create mode 100644 gnu/packages/patches/libjami-ac-config-files.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 63d2e333cf..62242d8c62 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1467,6 +1467,9 @@ dist_patch_DATA = \ %D%/packages/patches/itk-snap-alt-glibc-compat.patch \ %D%/packages/patches/jami-disable-integration-tests.patch \ %D%/packages/patches/jami-libjami-headers-search.patch \ + %D%/packages/patches/jami-qml-tests-discovery.patch \ + %D%/packages/patches/jami-skip-tests-requiring-internet.patch \ + %D%/packages/patches/jami-unbundle-dependencies.patch \ %D%/packages/patches/jamvm-1.5.1-aarch64-support.patch \ %D%/packages/patches/jamvm-1.5.1-armv7-support.patch \ %D%/packages/patches/jamvm-2.0.0-aarch64-support.patch \ @@ -1557,6 +1560,7 @@ dist_patch_DATA = \ %D%/packages/patches/libgnome-encoding.patch \ %D%/packages/patches/libgnomeui-utf8.patch \ %D%/packages/patches/libgrss-CVE-2016-2001.patch \ + %D%/packages/patches/libjami-ac-config-files.patch \ %D%/packages/patches/libjxr-fix-function-signature.patch \ %D%/packages/patches/libjxr-fix-typos.patch \ %D%/packages/patches/libofa-ftbfs-1.diff \ diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index 4d1b3a3db2..0987ac5e5e 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, 2023 Maxim Cournoyer +;;; Copyright © 2020, 2021, 2022, 2023, 2024 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -38,6 +38,7 @@ #:use-module (gnu packages guile) #:use-module (gnu packages libcanberra) #:use-module (gnu packages linux) + #:use-module (gnu packages markup) #:use-module (gnu packages networking) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) @@ -54,6 +55,7 @@ #:use-module (gnu packages version-control) #:use-module (gnu packages video) #:use-module (gnu packages vulkan) + #:use-module (gnu packages web) #:use-module (gnu packages webkit) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xiph) @@ -68,32 +70,33 @@ #:use-module (guix packages) #:use-module (guix utils)) -(define %jami-version "20230323.0") +;;; We use nightlies as stable versions are a bit far in-between, and often +;;; have bugs anyway. When the nightly version change, do not forget to +;;; retrieve the associated daemon submodule commit and update it in +;;; %jami-daemon-commit variable below. -(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")) - (modules '((guix build utils))) - (snippet - ;; 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 - "0vjsjr37cb87j9hqbmipyxn4877k1wn3l0vzca3l3ldgknglz7v2")) - (patches (search-patches "jami-disable-integration-tests.patch" - "jami-libjami-headers-search.patch")))) +;;; When updating Jami, make sure that the patches used for ffmpeg-jami are up +;;; to date with those listed in +;;; . +(define %jami-nightly-version "20231222.2") +(define %jami-daemon-commit "317b7317dcda4afb733ddb9bd5b450d4635941ae") (define-public libjami (package (name "libjami") - (version %jami-version) - (source %jami-sources) + (version %jami-nightly-version) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://review.jami.net/jami-daemon") + (commit %jami-daemon-commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "16qx50xz2mkw894irjsvql82iw7wpc5xncxpvw1nqd2sxhgfiq0i")) + (patches (search-patches + "libjami-ac-config-files.patch" + "jami-disable-integration-tests.patch")))) (outputs '("out" "bin" "debug")) ;"bin' contains jamid (build-system gnu-build-system) (arguments @@ -103,13 +106,25 @@ ;; user scripts too, until more general purpose Scheme bindings are made ;; available (see: test/agent/README.md). #:configure-flags #~(list "--enable-agent" "--enable-debug") - #:make-flags #~(list "V=1") ;build verbosely + #:make-flags + #~(list + "V=1" ;build verbosely + ;; The 'ut_media_player' is known to fail (see: + ;; https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/935). + "XFAIL_TESTS=ut_media_player") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'change-directory/maybe (lambda _ ;; Allow building from the tarball or a git checkout. (false-if-exception (chdir "daemon")))) + (add-after 'change-directory/maybe 'extend-scheduler-test-timeout + (lambda _ + ;; The ut_scheduler unit test may fail on slower machines (see: + ;; https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/939). + (substitute* "test/unitTest/scheduler.cpp" + (("std::chrono::seconds\\(3)") + "std::chrono::seconds(30)")))) (add-after 'install 'delete-static-libraries ;; Remove 100+ MiB of static libraries. "--disable-static" cannot ;; be used as the test suite requires access to private symbols @@ -134,14 +149,14 @@ (inputs (list alsa-lib asio - dbus-c++ + dhtnet eudev ffmpeg-jami guile-3.0 jack-1 jsoncpp libarchive - libgit2 + libgit2-1.6 libnatpmp libsecp256k1 libupnp @@ -149,6 +164,7 @@ openssl pjproject-jami pulseaudio + sdbus-c++ speex speexdsp webrtc-audio-processing @@ -214,15 +230,29 @@ QSortFilterProxyModel conveniently exposed for QML.") (define-public jami (package (name "jami") - (version %jami-version) - (source %jami-sources) + (version %jami-nightly-version) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://review.jami.net/jami-client-qt") + (commit (string-append "nightly/" %jami-nightly-version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0ypbbyqmq6x9zq4sr550k38v8pg7yq685bmwqmigqzhqgfazcg97")) + (patches (search-patches + "jami-libjami-headers-search.patch" + "jami-qml-tests-discovery.patch" + "jami-skip-tests-requiring-internet.patch" + "jami-unbundle-dependencies.patch")))) (build-system qt-build-system) (outputs '("out" "debug")) (arguments (list #:qtbase qtbase #:configure-flags - #~(list "-DENABLE_TESTS=ON" + #~(list "-DWITH_DAEMON_SUBMODULE=OFF" + "-DENABLE_TESTS=ON" ;; Disable the webengine since it grows the closure size by ;; about 450 MiB and requires more resources. "-DWITH_WEBENGINE=OFF" @@ -231,11 +261,7 @@ QSortFilterProxyModel conveniently exposed for QML.") "-DENABLE_LIBWRAP=ON") #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'change-directory/maybe - (lambda _ - ;; Allow building from the tarball or a git checkout. - (false-if-exception (chdir "client-qt")))) - (add-after 'change-directory/maybe 'fix-version-string + (add-after 'unpack 'fix-version-string (lambda _ (substitute* "src/app/version.h" (("VERSION_STRING") @@ -244,6 +270,17 @@ QSortFilterProxyModel conveniently exposed for QML.") (string-append "const char VERSION_STRING[] = \"" #$version "\";\n" anchor))))) + (add-after 'unpack 'copy-3rdparty-source-dependencies + (lambda _ + (copy-recursively #$(package-source sortfilterproxymodel) + "3rdparty/SortFilterProxyModel"))) + (add-before 'configure 'fake-x11-environment + (lambda _ + ;; This works around the lack of configuration for the X11 + ;; push-to-talk feature, which is auto-detected via the + ;; XDG_SESSION_TYPE environment variable (see: + ;; https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/1504). + (setenv "XDG_SESSION_TYPE" "x11"))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? @@ -252,22 +289,13 @@ QSortFilterProxyModel conveniently exposed for QML.") ;; The tests require a writable HOME. (setenv "HOME" "/tmp") - (display "Running unittests...\n") - (invoke "tests/unittests" "-mutejamid") + (display "Running unit tests...\n") + (invoke "tests/unit_tests") - ;; XXX: There are currently multiple failures with the - ;; functional tests (see: - ;; https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/883), - ;; so the code below is disabled for now. - ;; + ;; XXX: The QML test suite fails, exiting with status code 1 (see: + ;; https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/883). ;; (display "Running functional tests...\n") - ;; ;; This is to allow building from the source tarball or - ;; ;; directly from the git repository. - ;; (let ((tests-qml (if (file-exists? "../client-qt/tests") - ;; "../client-qt/tests/qml" - ;; "../tests/qml"))) - ;; (invoke "tests/qml_tests" "-mutejamid" - ;; "-input" tests-qml)) + ;; (invoke "tests/qml_tests") )))))) (native-inputs (list googletest @@ -282,6 +310,7 @@ QSortFilterProxyModel conveniently exposed for QML.") libnotify libxcb libxkbcommon + md4c network-manager qrencode qt5compat @@ -290,6 +319,7 @@ QSortFilterProxyModel conveniently exposed for QML.") qtnetworkauth qtpositioning qtsvg + tidy-html ;used by src/app/htmlparser.h vulkan-loader)) (home-page "https://jami.net") (synopsis "Qt Jami client") diff --git a/gnu/packages/patches/jami-disable-integration-tests.patch b/gnu/packages/patches/jami-disable-integration-tests.patch index 1efb7d552e..18f13800ac 100644 --- a/gnu/packages/patches/jami-disable-integration-tests.patch +++ b/gnu/packages/patches/jami-disable-integration-tests.patch @@ -1,3 +1,5 @@ +This issue is tracked at https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/824. + From 3fd7acc6e5a8c316c366827956d7c06affdc9685 Mon Sep 17 00:00:00 2001 From: Olivier Dion Date: Fri, 7 Oct 2022 15:20:37 -0400 @@ -17,8 +19,8 @@ With file names adjusted for the source tarball. diff --git a/configure.ac b/configure.ac index 27215d044..aaeef1c1b 100644 ---- a/daemon/configure.ac -+++ b/daemon/configure.ac +--- a/configure.ac ++++ b/configure.ac @@ -40,6 +40,11 @@ AS_IF([test "x$enable_debug" = "xyes"], [DAEMONCFLAGS+=" -DNDEBUG=1 -O3" DAEMONCXXFLAGS+=" -DNDEBUG=1 -O3 -Wno-deprecated"]) @@ -33,8 +35,8 @@ index 27215d044..aaeef1c1b 100644 [Build fuzzing tools])) diff --git a/test/unitTest/Makefile.am b/test/unitTest/Makefile.am index f2b0fd994..ab232ddb7 100644 ---- a/daemon/test/unitTest/Makefile.am -+++ b/daemon/test/unitTest/Makefile.am +--- a/test/unitTest/Makefile.am ++++ b/test/unitTest/Makefile.am @@ -13,30 +13,6 @@ check_PROGRAMS = ####### Unit Test ######## diff --git a/gnu/packages/patches/jami-libjami-headers-search.patch b/gnu/packages/patches/jami-libjami-headers-search.patch index 92cc92a4a6..3e7e19d703 100644 --- a/gnu/packages/patches/jami-libjami-headers-search.patch +++ b/gnu/packages/patches/jami-libjami-headers-search.patch @@ -1,4 +1,7 @@ -Upstream status: https://review.jami.net/c/jami-client-qt/+/24273. +It was applied, then reverted (by mistake?) in 4d2c55348bc014. + +It's been resubmitted here: +https://lists.gnu.org/archive/html/jami/2024-01/msg00005.html diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d71b84b..36729698 100644 diff --git a/gnu/packages/patches/jami-qml-tests-discovery.patch b/gnu/packages/patches/jami-qml-tests-discovery.patch new file mode 100644 index 0000000000..11fd69571c --- /dev/null +++ b/gnu/packages/patches/jami-qml-tests-discovery.patch @@ -0,0 +1,15 @@ +Upstream status: https://review.jami.net/c/jami-client-qt/+/25640 + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index d50908cf..587c9d15 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -73,6 +73,8 @@ endif() + + string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE) + ++set(QUICK_TEST_SOURCE_DIR "${CMAKE_SOURCE_DIR}tests/qml/src") ++ + set(QML_TESTS_SOURCE_FILES + ${CMAKE_SOURCE_DIR}/tests/qml/main.cpp + ${TEST_QML_RESOURCES} diff --git a/gnu/packages/patches/jami-skip-tests-requiring-internet.patch b/gnu/packages/patches/jami-skip-tests-requiring-internet.patch new file mode 100644 index 0000000000..1abc0e80cb --- /dev/null +++ b/gnu/packages/patches/jami-skip-tests-requiring-internet.patch @@ -0,0 +1,51 @@ +Forwarded upstream: https://lists.gnu.org/archive/html/jami/2024-01/msg00010.html + +From 1d3b044c85c32341cca392254fe8bbf34a4639e1 Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer +Date: Tue, 9 Jan 2024 11:14:04 -0500 +Subject: [PATCH] tests: Skip tests that need Internet when there's none. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +* tests/unittests/messageparser_unittest.cpp (ALinkIsParsedCorrectly) +(YoutubeLinkIsParsedCorrectly): Skip when there is no Internet. + +Series-to: jami@gnu.org +Series-cc: Sébastien Blin +Fixes: +Change-Id: I0a5b57cd82f93fd7edf3fbeb73fb3db5a04c628c +--- + tests/unittests/messageparser_unittest.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/tests/unittests/messageparser_unittest.cpp b/tests/unittests/messageparser_unittest.cpp +index c10b0d0b..df7a0692 100644 +--- a/tests/unittests/messageparser_unittest.cpp ++++ b/tests/unittests/messageparser_unittest.cpp +@@ -69,6 +69,9 @@ TEST_F(MessageParserFixture, TextIsParsedCorrectly) + */ + TEST_F(MessageParserFixture, ALinkIsParsedCorrectly) + { ++ if (!globalEnv.connectivityMonitor->isOnline()) ++ GTEST_SKIP() << "ALinkIsParsedCorrectly requires Internet connectivity"; ++ + auto linkColor = QColor::fromRgb(0, 0, 255); + auto backgroundColor = QColor::fromRgb(0, 0, 255); + +@@ -174,6 +177,9 @@ TEST_F(MessageParserFixture, FencedCodeIsParsedCorrectly) + */ + TEST_F(MessageParserFixture, YoutubeLinkIsParsedCorrectly) + { ++ if (!globalEnv.connectivityMonitor->isOnline()) ++ GTEST_SKIP() << "YoutubeLinkIsParsedCorrectly requires Internet connectivity"; ++ + auto url = "https://www.youtube.com/watch?v=1234567890"; + auto msg = "blah blah " + QString(url) + " blah blah"; + + +base-commit: a4300308dc8d03d59f620bb5fed753df5cf31ed9 +prerequisite-patch-id: 90a419e7de1f4fa5bb68bc58ad0da2817ed268e0 +-- +2.41.0 + diff --git a/gnu/packages/patches/jami-unbundle-dependencies.patch b/gnu/packages/patches/jami-unbundle-dependencies.patch new file mode 100644 index 0000000000..dab82b26cb --- /dev/null +++ b/gnu/packages/patches/jami-unbundle-dependencies.patch @@ -0,0 +1,71 @@ +Forwarded here: https://lists.gnu.org/archive/html/jami/2024-01/msg00007.html + +From a302dc0a0faf2778331745a1d01bc3071e182d4d Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer +Date: Mon, 8 Jan 2024 16:07:05 -0500 +Subject: [PATCH] build: Allow using system-provided md4c and tidy libraries. + +* CMakeLists.txt : Search for libraries in the system +first, falling back to bundled copies in case they aren't found. + +Series-to: jami@gnu.org +Fixes: +Change-Id: I637959fefce6a21b0ee73a793acb6c3c42dcdce0 +--- + CMakeLists.txt | 36 +++++++++++++++++++++++++----------- + 1 file changed, 25 insertions(+), 11 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 38e7a4e2..3f1bd599 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -545,19 +545,33 @@ add_subdirectory(3rdparty/SortFilterProxyModel) + set(SFPM_OBJECTS $) + + # md4c +-set(BUILD_SHARED_LIBS OFF CACHE BOOL "Don't build shared md4c library" FORCE) +-add_subdirectory(3rdparty/md4c EXCLUDE_FROM_ALL) +-list(APPEND CLIENT_LINK_DIRS ${MD4C_BINARY_DIR}/src) +-list(APPEND CLIENT_INCLUDE_DIRS ${MD4C_SOURCE_DIR}/src) +-list(APPEND CLIENT_LIBS md4c-html) ++find_package(md4c) ++if(md4c_FOUND) ++ message(STATUS "Using system-provided md4c-html") ++ list(APPEND CLIENT_LIBS md4c::md4c-html) ++else() ++ message("Using bundled md4c-html library") ++ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Don't build shared md4c library" FORCE) ++ add_subdirectory(3rdparty/md4c EXCLUDE_FROM_ALL) ++ list(APPEND CLIENT_LINK_DIRS ${MD4C_BINARY_DIR}/src) ++ list(APPEND CLIENT_INCLUDE_DIRS ${MD4C_SOURCE_DIR}/src) ++ list(APPEND CLIENT_LIBS md4c-html) ++endif() + + # tidy-html5 +-set(BUILD_SHARED_LIB OFF CACHE BOOL "Don't build shared tidy library" FORCE) +-set(SUPPORT_CONSOLE_APP OFF CACHE BOOL "Don't build tidy console app" FORCE) +-add_subdirectory(3rdparty/tidy-html5 EXCLUDE_FROM_ALL) +-list(APPEND CLIENT_LINK_DIRS ${tidy_BINARY_DIR}/Release) +-list(APPEND CLIENT_INCLUDE_DIRS ${tidy_SOURCE_DIR}/include) +-list(APPEND CLIENT_LIBS tidy-static) ++pkg_check_modules(tidy IMPORTED_TARGET tidy) ++if(tidy_FOUND) ++ message(STATUS "Using system-provided tidy") ++ list(APPEND CLIENT_LIBS PkgConfig::tidy) ++else() ++ message("Using bundled tidy library") ++ set(BUILD_SHARED_LIB OFF CACHE BOOL "Don't build shared tidy library" FORCE) ++ set(SUPPORT_CONSOLE_APP OFF CACHE BOOL "Don't build tidy console app" FORCE) ++ add_subdirectory(3rdparty/tidy-html5 EXCLUDE_FROM_ALL) ++ list(APPEND CLIENT_LINK_DIRS ${tidy_BINARY_DIR}/Release) ++ list(APPEND CLIENT_INCLUDE_DIRS ${tidy_SOURCE_DIR}/include) ++ list(APPEND CLIENT_LIBS tidy-static) ++endif() + + # common executable sources + qt_add_executable( + +base-commit: a4300308dc8d03d59f620bb5fed753df5cf31ed9 +-- +2.41.0 + diff --git a/gnu/packages/patches/libjami-ac-config-files.patch b/gnu/packages/patches/libjami-ac-config-files.patch new file mode 100644 index 0000000000..8508d55ee1 --- /dev/null +++ b/gnu/packages/patches/libjami-ac-config-files.patch @@ -0,0 +1,52 @@ +Forwarded here: https://lists.gnu.org/archive/html/jami/2024-01/msg00003.html + +From 20a1702d881b381979d31c456f1b8cf5e0f728ad Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer +Date: Sun, 7 Jan 2024 16:40:41 -0500 +Subject: [PATCH] configure.ac: Expand AC_CONFIG_FILES to fix a race. + +The commands apparently run for each file listed, or something +similar, leading to: + + configure: creating ./config.status + config.status: creating test/agent/Makefile + chmod: cannot access 'test/agent/pre-inst-env': No such file or directory + chmod: cannot access 'test/agent/scenarios/bulk-calls/run-scenario': No such file or directory + config.status: creating test/agent/pre-inst-env + chmod: cannot access 'test/agent/scenarios/bulk-calls/run-scenario': No such file or directory + +* configure.ac [ENABLE_AGENT]: Separate AC_CONFIG_FILES uses per file. + +Series-to: jami@gnu.org +Series-postfix: daemon +Change-Id: Ib283955b73540248e09bf31ef44ef3d178b216fa +--- + configure.ac | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index cdea5ff1c..2ab96d817 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -61,11 +61,11 @@ AC_ARG_ENABLE([agent], + [Build agent])) + AM_CONDITIONAL([ENABLE_AGENT], [test "x$enable_agent" = "xyes"]) + AM_COND_IF([ENABLE_AGENT], +- [AC_CONFIG_FILES([test/agent/Makefile +- test/agent/pre-inst-env:test/agent/build-aux/pre-inst-env.in +- test/agent/scenarios/bulk-calls/run-scenario], +- [chmod +x test/agent/pre-inst-env +- chmod +x test/agent/scenarios/bulk-calls/run-scenario])]) ++ [AC_CONFIG_FILES([test/agent/Makefile]) ++ AC_CONFIG_FILES([test/agent/pre-inst-env:test/agent/build-aux/pre-inst-env.in], ++ [chmod +x test/agent/pre-inst-env]) ++ AC_CONFIG_FILES([test/agent/scenarios/bulk-calls/run-scenario], ++ [chmod +x test/agent/scenarios/bulk-calls/run-scenario])]) + + AC_ARG_ENABLE([tracepoints], AS_HELP_STRING([--enable-tracepoints], [Enable tracepoints])) + + +base-commit: e246fb2e090c9b3de55e2d455eee5a6f05a5b286 +-- +2.41.0 + -- cgit v1.2.3