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 + 1 file changed, 1 insertion(+) (limited to 'gnu/local.mk') 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 \ -- 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/local.mk') 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 ea832b44b79fb06bac88679029773006fea15827 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Tue, 9 Jan 2024 09:59:46 +0100 Subject: gnu: sbcl: Fix build on powerpc64. * gnu/packages/patches/sbcl-fix-ppc64-build.patch: New file. * gnu/local.mk: Register it. * gnu/packages/lisp.scm (sbcl)[source]: Use it. Change-Id: If81321bc7e4075ac7ec63f7b8d623011b4b975d5 --- gnu/local.mk | 1 + gnu/packages/lisp.scm | 1 + gnu/packages/patches/sbcl-fix-ppc64-build.patch | 27 +++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 gnu/packages/patches/sbcl-fix-ppc64-build.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index ee25e1535e..1bf8a9df27 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1988,6 +1988,7 @@ dist_patch_DATA = \ %D%/packages/patches/sbcl-burgled-batteries3-fix-signals.patch \ %D%/packages/patches/sbcl-clml-fix-types.patch \ %D%/packages/patches/sbcl-eazy-gnuplot-skip-path-check.patch \ + %D%/packages/patches/sbcl-fix-ppc64-build.patch \ %D%/packages/patches/sbcl-png-fix-sbcl-compatibility.patch \ %D%/packages/patches/scalapack-gcc-10-compilation.patch \ %D%/packages/patches/scheme48-tests.patch \ diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 20ec61dfe5..40217780c8 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -447,6 +447,7 @@ an interpreter, a compiler, a debugger, and much more.") version "-source.tar.bz2")) (sha256 (base32 "0xhpdnsg8idzxkn20iw8gd2rk470d7vc22vrp5clq9fj117vgn43")) + (patches (search-patches "sbcl-fix-ppc64-build.patch")) (modules '((guix build utils))) (snippet '(begin diff --git a/gnu/packages/patches/sbcl-fix-ppc64-build.patch b/gnu/packages/patches/sbcl-fix-ppc64-build.patch new file mode 100644 index 0000000000..a7d4d9a21e --- /dev/null +++ b/gnu/packages/patches/sbcl-fix-ppc64-build.patch @@ -0,0 +1,27 @@ +commit 255f3ead060129aa097b62f10d054cdc4997a431 +Author: Douglas Katzman +Date: Mon Jan 1 23:59:50 2024 -0500 + + Fix ppc64 failure-to-build (from a few weeks ago) + + Git rev 7354472bb5 caused NIL to get a bogus widetag. + +diff --git a/make-target-2-load.lisp b/make-target-2-load.lisp +index 6571ec27d..daef942ea 100644 +--- a/make-target-2-load.lisp ++++ b/make-target-2-load.lisp +@@ -339,7 +339,13 @@ Please check that all strings which were not recognizable to the compiler + + + (do-all-symbols (symbol) +- (sb-kernel:logior-header-bits symbol sb-vm::+symbol-initial-core+) ++ ;; Don't futz with the header of static symbols. ++ ;; Technically LOGIOR-HEADER-BITS can only be used on an OTHER-POINTER-LOWTAG ++ ;; objects, so modifying NIL should not ever work, but it's especially wrong ++ ;; on ppc64 where OTHER- and LIST- pointer lowtags are 10 bytes apart instead ++ ;; of 8, so this was making a random alteration to the header. ++ (unless (eq (heap-allocated-p symbol) :static) ++ (sb-kernel:logior-header-bits symbol sb-vm::+symbol-initial-core+)) + + ;; A symbol whose INFO slot underwent any kind of manipulation + ;; such that it now has neither properties nor globaldb info, -- 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/local.mk') 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/local.mk') 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/local.mk') 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 From 5c0f77f4241c9beac0c82deae946bfdc70b49ff0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 10 Jan 2024 15:27:47 +0100 Subject: gnu: icedtea: Fix time bomb in ‘GenerateCurrencyData.java’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . * gnu/packages/java.scm (icedtea-7)[drop]: Add optional ‘patches’ parameter and honor it. [native-inputs]: Add patch for “jdk-drop”. (icedtea-8): Likewise. * gnu/packages/patches/jdk-currency-time-bomb.patch, gnu/packages/patches/jdk-currency-time-bomb2.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. Change-Id: I3b4cf562ce4bedb87ce0e7c289e431fbb0dbb6f8 --- gnu/local.mk | 2 ++ gnu/packages/java.scm | 16 ++++++++++------ gnu/packages/patches/jdk-currency-time-bomb.patch | 13 +++++++++++++ gnu/packages/patches/jdk-currency-time-bomb2.patch | 13 +++++++++++++ 4 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 gnu/packages/patches/jdk-currency-time-bomb.patch create mode 100644 gnu/packages/patches/jdk-currency-time-bomb2.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 62242d8c62..6e6d28e6f0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1489,6 +1489,8 @@ dist_patch_DATA = \ %D%/packages/patches/java-xerces-build_dont_unzip.patch \ %D%/packages/patches/java-xerces-xjavac_taskdef.patch \ %D%/packages/patches/jbr-17-xcursor-no-dynamic.patch \ + %D%/packages/patches/jdk-currency-time-bomb.patch \ + %D%/packages/patches/jdk-currency-time-bomb2.patch \ %D%/packages/patches/jfsutils-add-sysmacros.patch \ %D%/packages/patches/jfsutils-gcc-compat.patch \ %D%/packages/patches/jfsutils-include-systypes.patch \ diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index e2c2a041a9..ded73bc461 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -100,13 +100,14 @@ (define-public icedtea-7 (let* ((version "2.6.13") - (drop (lambda (name hash) + (drop (lambda* (name hash #:optional (patches '())) (origin (method url-fetch) (uri (string-append "http://icedtea.classpath.org/download/drops" "/icedtea7/" version "/" name ".tar.bz2")) - (sha256 (base32 hash)))))) + (sha256 (base32 hash)) + (patches patches))))) (package (name "icedtea") (version version) @@ -614,7 +615,8 @@ "110j7jlz47x2gg6f7653x12mssan5kvj9l9h1m1c8c92drfxbqyk")) ("jdk-drop" ,(drop "jdk" - "0d1mca38ksxvdskp9im3pp7fdijhj1n3lwq9w13r9s4v3qyskgdd")) + "0d1mca38ksxvdskp9im3pp7fdijhj1n3lwq9w13r9s4v3qyskgdd" + (search-patches "jdk-currency-time-bomb.patch"))) ("langtools-drop" ,(drop "langtools" "0nq5236fzxn3p6x8cgncl56mzcmsj07q9gymysnws4c8byc6n0qj")) @@ -687,13 +689,14 @@ IcedTea build harness.") (define-public icedtea-8 (let* ((version "3.19.0") - (drop (lambda (name hash) + (drop (lambda* (name hash #:optional (patches '())) (origin (method url-fetch) (uri (string-append "http://icedtea.classpath.org/download/drops" "/icedtea8/" version "/" name ".tar.xz")) - (sha256 (base32 hash)))))) + (sha256 (base32 hash)) + (patches patches))))) (package (inherit icedtea-7) (version "3.19.0") (source (origin @@ -839,7 +842,8 @@ new Date();")) "1pc0pv4v2mn2mjc0vp19d94v2150xigyhxsmckqasy647zcm6w0r")) ("jdk-drop" ,(drop "jdk" - "1742lcm55l8zhi522x83v65ccr0rd6511q9rj7crw44x3ymdrhrv")) + "1742lcm55l8zhi522x83v65ccr0rd6511q9rj7crw44x3ymdrhrv" + (search-patches "jdk-currency-time-bomb2.patch"))) ("langtools-drop" ,(drop "langtools" "08iz7p2xcddlphipf6gahyabr5cawlnydap12p1n4f0md069b50b")) diff --git a/gnu/packages/patches/jdk-currency-time-bomb.patch b/gnu/packages/patches/jdk-currency-time-bomb.patch new file mode 100644 index 0000000000..8e6bce6fcd --- /dev/null +++ b/gnu/packages/patches/jdk-currency-time-bomb.patch @@ -0,0 +1,13 @@ +Fix a time bomb present in the jdk "drop" of IcedTea. + +--- a/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java ++++ b/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java +@@ -284,7 +284,7 @@ public class GenerateCurrencyData { + String timeString = currencyInfo.substring(4, length - 4); + long time = format.parse(timeString).getTime(); + if (Math.abs(time - System.currentTimeMillis()) > ((long) 10) * 365 * 24 * 60 * 60 * 1000) { +- throw new RuntimeException("time is more than 10 years from present: " + time); ++ System.err.println("note: time is more than 10 years from \"present\": " + time); + } + specialCaseCutOverTimes[specialCaseCount] = time; + specialCaseOldCurrencies[specialCaseCount] = oldCurrency; diff --git a/gnu/packages/patches/jdk-currency-time-bomb2.patch b/gnu/packages/patches/jdk-currency-time-bomb2.patch new file mode 100644 index 0000000000..94454626c4 --- /dev/null +++ b/gnu/packages/patches/jdk-currency-time-bomb2.patch @@ -0,0 +1,13 @@ +Fix a time bomb present in the jdk "drop" of IcedTea 8. + +--- a/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java ++++ b/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java +@@ -284,7 +284,7 @@ public class GenerateCurrencyData { + String timeString = currencyInfo.substring(4, length - 4); + long time = format.parse(timeString).getTime(); + if (Math.abs(time - System.currentTimeMillis()) > ((long) 10) * 365 * 24 * 60 * 60 * 1000) { +- throw new RuntimeException("time is more than 10 years from present: " + time); ++ System.err.println("note: time is more than 10 years from \"present\": " + time); + } + specialCaseCutOverTimes[specialCaseCount] = time; + specialCaseOldCurrencies[specialCaseCount] = oldCurrency; -- cgit v1.2.3 From db7488a7fbd829d25b0b5c5e53b1c680b67832b1 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 10 Jan 2024 21:52:33 +0100 Subject: gnu: openjdk9: Fix time bomb in ‘GenerateCurrencyData.java’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes , as well. This is a companion to commit 5c0f77f4241c9beac0c82deae946bfdc70b49ff0. * gnu/packages/java.scm (openjdk9)[source]: Add patch. * gnu/packages/patches/openjdk-currency-time-bomb.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Change-Id: I45ca1fe5bad922307eba64d46a330a8f233c0f55 --- gnu/local.mk | 3 ++- gnu/packages/java.scm | 3 ++- gnu/packages/patches/openjdk-currency-time-bomb.patch | 13 +++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/openjdk-currency-time-bomb.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 6e6d28e6f0..43163c3d27 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -7,7 +7,7 @@ # Copyright © 2016, 2017, 2018 Kei Kebreau # Copyright © 2016, 2017 Rene Saavedra # Copyright © 2016 Adonay "adfeno" Felipe Nogueira -# Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Ricardo Wurmus +# Copyright © 2016-2024 Ricardo Wurmus # Copyright © 2016 Ben Woodcroft # Copyright © 2016, 2017, 2018, 2019 Alex Vong # Copyright © 2016-2023 Efraim Flashner @@ -1743,6 +1743,7 @@ dist_patch_DATA = \ %D%/packages/patches/openboardview-use-system-mpc.patch \ %D%/packages/patches/openbox-python3.patch \ %D%/packages/patches/opencolorio-fix-build-with-gcc11.patch \ + %D%/patches/openjdk-currency-time-bomb.patch \ %D%/packages/patches/openjdk-9-pointer-comparison.patch \ %D%/packages/patches/openjdk-9-setsignalhandler.patch \ %D%/packages/patches/openjdk-10-idlj-reproducibility.patch \ diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index ded73bc461..40d777089a 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -880,7 +880,8 @@ new Date();")) (base32 "1v92nzdqx07c35x945awzir4yk0fk22vky6fpp8mq9js930sxsz0")) (patches (search-patches "openjdk-9-pointer-comparison.patch" - "openjdk-9-setsignalhandler.patch")))) + "openjdk-9-setsignalhandler.patch" + "openjdk-currency-time-bomb.patch")))) (build-system gnu-build-system) (outputs '("out" "jdk" "doc")) (arguments diff --git a/gnu/packages/patches/openjdk-currency-time-bomb.patch b/gnu/packages/patches/openjdk-currency-time-bomb.patch new file mode 100644 index 0000000000..7738eb1595 --- /dev/null +++ b/gnu/packages/patches/openjdk-currency-time-bomb.patch @@ -0,0 +1,13 @@ +Fix a time bomb present in the OpenJDK tools. + +--- a/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java ++++ b/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java +@@ -285,7 +285,7 @@ public class GenerateCurrencyData { + String timeString = currencyInfo.substring(4, length - 4); + long time = format.parse(timeString).getTime(); + if (Math.abs(time - System.currentTimeMillis()) > ((long) 10) * 365 * 24 * 60 * 60 * 1000) { +- throw new RuntimeException("time is more than 10 years from present: " + time); ++ System.err.println("note: time is more than 10 years from \"present\": " + time); + } + specialCaseCutOverTimes[specialCaseCount] = time; + specialCaseOldCurrencies[specialCaseCount] = oldCurrency; -- cgit v1.2.3 From a252ab6f889fc8530e081da5361774179de4b146 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 10 Jan 2024 22:07:57 +0100 Subject: gnu: Fix patch location. This is a follow-up to commit db7488a7fbd829d25b0b5c5e53b1c680b67832b1. * gnu/local.mk (dist_patch_DATA): Restore "packages/" prefix. Change-Id: I1f8e420e75c3f4e1927dac935c2de337fd1306eb --- gnu/local.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 43163c3d27..5850736700 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1743,7 +1743,7 @@ dist_patch_DATA = \ %D%/packages/patches/openboardview-use-system-mpc.patch \ %D%/packages/patches/openbox-python3.patch \ %D%/packages/patches/opencolorio-fix-build-with-gcc11.patch \ - %D%/patches/openjdk-currency-time-bomb.patch \ + %D%/packages/patches/openjdk-currency-time-bomb.patch \ %D%/packages/patches/openjdk-9-pointer-comparison.patch \ %D%/packages/patches/openjdk-9-setsignalhandler.patch \ %D%/packages/patches/openjdk-10-idlj-reproducibility.patch \ -- cgit v1.2.3 From fc891f004aff40e34c23fc101aeea5d05e7555ae Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 10 Jan 2024 22:09:49 +0100 Subject: gnu: openjdk10: Fix time bomb in ‘GenerateCurrencyData.java’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes , as well. This is a companion to commit 5c0f77f4241c9beac0c82deae946bfdc70b49ff0. * gnu/packages/java.scm (openjdk10)[source]: Add patch. * gnu/packages/patches/openjdk-currency-time-bomb2.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Change-Id: I42fc14d305883f672cd6764a0ee6462852e41a5b --- gnu/local.mk | 1 + gnu/packages/java.scm | 3 ++- gnu/packages/patches/openjdk-currency-time-bomb2.patch | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/openjdk-currency-time-bomb2.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 5850736700..0fcac73d4c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1744,6 +1744,7 @@ dist_patch_DATA = \ %D%/packages/patches/openbox-python3.patch \ %D%/packages/patches/opencolorio-fix-build-with-gcc11.patch \ %D%/packages/patches/openjdk-currency-time-bomb.patch \ + %D%/packages/patches/openjdk-currency-time-bomb2.patch \ %D%/packages/patches/openjdk-9-pointer-comparison.patch \ %D%/packages/patches/openjdk-9-setsignalhandler.patch \ %D%/packages/patches/openjdk-10-idlj-reproducibility.patch \ diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index ea30ce10d1..4993988696 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1154,7 +1154,8 @@ new Date();")) (patches (search-patches "openjdk-10-idlj-reproducibility.patch" "openjdk-10-pointer-comparison.patch" - "openjdk-10-setsignalhandler.patch")))) + "openjdk-10-setsignalhandler.patch" + "openjdk-currency-time-bomb2.patch")))) (arguments (substitute-keyword-arguments (package-arguments openjdk9) ((#:phases phases) diff --git a/gnu/packages/patches/openjdk-currency-time-bomb2.patch b/gnu/packages/patches/openjdk-currency-time-bomb2.patch new file mode 100644 index 0000000000..d2ea04d63b --- /dev/null +++ b/gnu/packages/patches/openjdk-currency-time-bomb2.patch @@ -0,0 +1,13 @@ +Fix a time bomb present in the OpenJDK tools. + +--- a/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java ++++ b/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java +@@ -285,7 +285,7 @@ public class GenerateCurrencyData { + String timeString = currencyInfo.substring(4, length - 4); + long time = format.parse(timeString).getTime(); + if (Math.abs(time - System.currentTimeMillis()) > ((long) 10) * 365 * 24 * 60 * 60 * 1000) { +- throw new RuntimeException("time is more than 10 years from present: " + time); ++ System.err.println("note: time is more than 10 years from \"present\": " + time); + } + specialCaseCutOverTimes[specialCaseCount] = time; + specialCaseOldCurrencies[specialCaseCount] = oldCurrency; -- cgit v1.2.3 From f122f2bead538617d3bd43a05fa6f2def5e03c05 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Wed, 10 Jan 2024 22:57:43 +0100 Subject: gnu: sbcl: Fix riscv build. * gnu/packages/patches/sbcl-fix-riscv-build.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/lisp.scm (sbcl)[source]: Use it. Change-Id: I63f1b9a7a7b6f3a1961d0a0cb31189b74a60abc3 --- gnu/local.mk | 3 ++- gnu/packages/lisp.scm | 6 ++++-- gnu/packages/patches/sbcl-fix-riscv-build.patch | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/sbcl-fix-riscv-build.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 453e3fb5c7..62066a30dc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -20,7 +20,7 @@ # Copyright © 2018, 2019, 2020, 2021, 2022 Oleg Pykhalov # Copyright © 2018 Stefan Stefanović # Copyright © 2018, 2020, 2021, 2022, 2023 Maxim Cournoyer -# Copyright © 2019, 2020, 2021, 2022 Guillaume Le Vaillant +# Copyright © 2019, 2020, 2021, 2022, 2044 Guillaume Le Vaillant # Copyright © 2019, 2020 John Soo # Copyright © 2019 Jonathan Brielmaier # Copyright © 2019 Evan Straw @@ -2004,6 +2004,7 @@ dist_patch_DATA = \ %D%/packages/patches/sbcl-clml-fix-types.patch \ %D%/packages/patches/sbcl-eazy-gnuplot-skip-path-check.patch \ %D%/packages/patches/sbcl-fix-ppc64-build.patch \ + %D%/packages/patches/sbcl-fix-riscv-build.patch \ %D%/packages/patches/sbcl-png-fix-sbcl-compatibility.patch \ %D%/packages/patches/scalapack-gcc-10-compilation.patch \ %D%/packages/patches/scheme48-tests.patch \ diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index aa7315a7ce..4f89779d8d 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -14,7 +14,7 @@ ;;; Copyright © 2018, 2019 Pierre Langlois ;;; Copyright © 2019, 2020 Katherine Cox-Buday ;;; Copyright © 2019 Jesse Gildersleve -;;; Copyright © 2019-2023 Guillaume Le Vaillant +;;; Copyright © 2019-2024 Guillaume Le Vaillant ;;; Copyright © 2020 Marius Bakke ;;; Copyright © 2020 Zhu Zihao ;;; Copyright © 2021, 2023 Sharlatan Hellseher @@ -447,7 +447,9 @@ an interpreter, a compiler, a debugger, and much more.") version "-source.tar.bz2")) (sha256 (base32 "0xhpdnsg8idzxkn20iw8gd2rk470d7vc22vrp5clq9fj117vgn43")) - (patches (search-patches "sbcl-fix-ppc64-build.patch")) + ;; TODO: Remove these patches when updating to sbcl > 2.4.0. + (patches (search-patches "sbcl-fix-ppc64-build.patch" + "sbcl-fix-riscv-build.patch")) (modules '((guix build utils))) (snippet '(begin diff --git a/gnu/packages/patches/sbcl-fix-riscv-build.patch b/gnu/packages/patches/sbcl-fix-riscv-build.patch new file mode 100644 index 0000000000..3e01ee6579 --- /dev/null +++ b/gnu/packages/patches/sbcl-fix-riscv-build.patch @@ -0,0 +1,19 @@ +commit b286d92af7468164c155c70d38213211b296fdfe +Author: Douglas Katzman +Date: Wed Jan 10 11:46:55 2024 -0500 + + Fix riscv build + +diff --git a/src/compiler/riscv/float.lisp b/src/compiler/riscv/float.lisp +index ce46d24ac..a16380293 100644 +--- a/src/compiler/riscv/float.lisp ++++ b/src/compiler/riscv/float.lisp +@@ -578,7 +578,7 @@ + (:results (res :scs (double-reg))) + (:arg-types signed-num) + (:result-types double-float) +- (:translate make-double-float) ++ (:translate %make-double-float) + (:policy :fast-safe) + (:generator 2 + (inst fmvx-> :double res bits))) -- cgit v1.2.3 From e7823dbe8c32482ef02c53e688433fdc4a453aea Mon Sep 17 00:00:00 2001 From: Simon South Date: Thu, 4 Jan 2024 15:33:55 -0500 Subject: gnu: fifengine: Fix runtime error when using Python 3.9 or newer. * gnu/packages/patches/fifengine-python-3.9-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/games.scm (fifengine)[source]: Apply it. Change-Id: I61001d6b87db00c71f1e2e6ca3bac8581e941451 Signed-off-by: Liliana Marie Prikler --- gnu/local.mk | 1 + gnu/packages/games.scm | 3 +- .../patches/fifengine-python-3.9-compat.patch | 81 ++++++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/fifengine-python-3.9-compat.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index f1bdfc73e9..aff1977dbb 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1175,6 +1175,7 @@ dist_patch_DATA = \ %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-python-3.9-compat.patch \ %D%/packages/patches/fifengine-swig-compat.patch \ %D%/packages/patches/fifo-map-fix-flags-for-gcc.patch \ %D%/packages/patches/fifo-map-remove-catch.hpp.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index cd20c64dc4..f0f9061717 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -4118,7 +4118,8 @@ Widgets, and allows users to create more.") "fifengine/tar.gz/" version)) (file-name (string-append name "-" version ".tar.gz")) (patches (search-patches "fifengine-swig-compat.patch" - "fifengine-boost-compat.patch")) + "fifengine-boost-compat.patch" + "fifengine-python-3.9-compat.patch")) (sha256 (base32 "1y4grw25cq5iqlg05rnbyxw1njl11ypidnlsm3qy4sm3xxdvb0p8")))) diff --git a/gnu/packages/patches/fifengine-python-3.9-compat.patch b/gnu/packages/patches/fifengine-python-3.9-compat.patch new file mode 100644 index 0000000000..2def4681cd --- /dev/null +++ b/gnu/packages/patches/fifengine-python-3.9-compat.patch @@ -0,0 +1,81 @@ +Fix runtime error when using Python 3.9 or newer. + +Taken from upstream: +https://github.com/fifengine/fifengine/commit/cf295fd98a8fba080f6305c27be56d10ab7ce94d + +diff --git a/engine/python/fife/extensions/serializers/simplexml.py b/engine/python/fife/extensions/serializers/simplexml.py +index c4e10f4f8..d05567936 100644 +--- a/engine/python/fife/extensions/serializers/simplexml.py ++++ b/engine/python/fife/extensions/serializers/simplexml.py +@@ -200,7 +200,7 @@ def get(self, module, name, defaultValue=None): + #get the module tree: for example find tree under module FIFE + moduleTree = self._getModuleTree(module) + element = None +- for e in moduleTree.getchildren(): ++ for e in moduleTree: + if e.tag == "Setting" and e.get("name", "") == name: + element = e + break +@@ -275,7 +275,7 @@ def set(self, module, name, value, extra_attrs={}): + e_type = "str" + value = str(value) + +- for e in moduleTree.getchildren(): ++ for e in moduleTree: + if e.tag != "Setting": continue + if e.get("name", "") == name: + e.text = value +@@ -305,7 +305,7 @@ def remove(self, module, name): + + moduleTree = self._getModuleTree(module) + +- for e in moduleTree.getchildren(): ++ for e in moduleTree: + if e.tag != "Setting": continue + if e.get("name", "") == name: + moduleTree.remove(e) +@@ -321,7 +321,7 @@ def getModuleNameList(self): + self._initialized = True + + moduleNames = [] +- for c in self._root_element.getchildren(): ++ for c in self._root_element: + if c.tag == "Module": + name = c.get("name","") + if not isinstance(name, basestring): +@@ -344,7 +344,7 @@ def getAllSettings(self, module): + + # now from the tree read every value, and put the necessary values + # to the list +- for e in moduleTree.getchildren(): ++ for e in moduleTree: + if e.tag == "Setting": + name = e.get("name", "") + +@@ -383,7 +383,7 @@ def _validateTree(self): + + Raises an InvalidFormat exception if there is a format error. + """ +- for c in self._root_element.getchildren(): ++ for c in self._root_element: + if c.tag != "Module": + raise InvalidFormat("Invalid tag in " + self._file + \ + ". Expected Module, got: " + c.tag) +@@ -391,7 +391,7 @@ def _validateTree(self): + raise InvalidFormat("Invalid tag in " + self._file + \ + ". Module name is empty.") + else: +- for e in c.getchildren(): ++ for e in c: + if e.tag != "Setting": + raise InvalidFormat("Invalid tag in " + self._file + \ + " in module: " + c.tag + \ +@@ -414,7 +414,7 @@ def _getModuleTree(self, module): + raise AttributeError("Settings:_getModuleTree: Invalid type for " + "module argument.") + +- for c in self._root_element.getchildren(): ++ for c in self._root_element: + if c.tag == "Module" and c.get("name", "") == module: + return c + -- cgit v1.2.3 From 3351c5e59d0a975bb80b60a8ddbe374e130617ce Mon Sep 17 00:00:00 2001 From: Simon South Date: Thu, 4 Jan 2024 15:33:56 -0500 Subject: gnu: unknown-horizons: Fix build and runtime errors. Apply two upstream commits that allow building with Python 3.9 or newer and running with Python 3.10. * gnu/packages/patches/unknown-horizons-python-3.9.patch: New file. * gnu/packages/patches/unknown-horizons-python-3.10.patch: New file. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/games.scm (unknown-horizons)[source]: Apply them. Change-Id: Icbc8b698b913be01465b09ab26afb29e5fd62a87 Signed-off-by: Liliana Marie Prikler Fixes: Unknown Horizons fails to start --- gnu/local.mk | 2 ++ gnu/packages/games.scm | 4 ++- .../patches/unknown-horizons-python-3.10.patch | 32 +++++++++++++++++ .../patches/unknown-horizons-python-3.9.patch | 41 ++++++++++++++++++++++ 4 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/unknown-horizons-python-3.10.patch create mode 100644 gnu/packages/patches/unknown-horizons-python-3.9.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index aff1977dbb..bb78815a59 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2104,6 +2104,8 @@ dist_patch_DATA = \ %D%/packages/patches/ungoogled-chromium-system-ffmpeg.patch \ %D%/packages/patches/ungoogled-chromium-system-nspr.patch \ %D%/packages/patches/unknown-horizons-python-3.8-distro.patch \ + %D%/packages/patches/unknown-horizons-python-3.9.patch \ + %D%/packages/patches/unknown-horizons-python-3.10.patch \ %D%/packages/patches/unzip-CVE-2014-8139.patch \ %D%/packages/patches/unzip-CVE-2014-8140.patch \ %D%/packages/patches/unzip-CVE-2014-8141.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index f0f9061717..50efe7b010 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -4454,7 +4454,9 @@ also available.") (sha256 (base32 "1n747p7h0qp48szgp262swg0xh8kxy1bw8ag1qczs4i26hyzs5x4")) - (patches (search-patches "unknown-horizons-python-3.8-distro.patch")))) + (patches (search-patches "unknown-horizons-python-3.8-distro.patch" + "unknown-horizons-python-3.9.patch" + "unknown-horizons-python-3.10.patch")))) (build-system python-build-system) (arguments '(#:phases diff --git a/gnu/packages/patches/unknown-horizons-python-3.10.patch b/gnu/packages/patches/unknown-horizons-python-3.10.patch new file mode 100644 index 0000000000..599de1fec5 --- /dev/null +++ b/gnu/packages/patches/unknown-horizons-python-3.10.patch @@ -0,0 +1,32 @@ +From 4ff605d6c55fcf3e9b4777ffbcb0c24ef17ba4ca Mon Sep 17 00:00:00 2001 +From: Arti +Date: Mon, 28 Feb 2022 21:19:50 +0100 +Subject: [PATCH] Rename instances of `collections.Iterable` into + `collections.abc.Iterable` (#2956) + +--- + horizons/ai/aiplayer/combat/unitmanager.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/horizons/ai/aiplayer/combat/unitmanager.py b/horizons/ai/aiplayer/combat/unitmanager.py +index 8449d5563c5..57db0d47061 100644 +--- a/horizons/ai/aiplayer/combat/unitmanager.py ++++ b/horizons/ai/aiplayer/combat/unitmanager.py +@@ -151,7 +151,7 @@ def _ship_state_rule(self, state_dict, ship_states): + """ + Rule stating that ship has to be in any of given states. + """ +- if not isinstance(ship_states, collections.Iterable): ++ if not isinstance(ship_states, collections.abc.Iterable): + ship_states = (ship_states,) + return lambda ship: (state_dict[ship] in ship_states) + +@@ -178,7 +178,7 @@ def filter_ships(self, ships, rules): + @param rules: conditions each ship has to meet (AND) + @type rules: iterable of lambda(ship) or single lambda(ship) + """ +- if not isinstance(rules, collections.Iterable): ++ if not isinstance(rules, collections.abc.Iterable): + rules = (rules,) + return [ship for ship in ships if all((rule(ship) for rule in rules))] + diff --git a/gnu/packages/patches/unknown-horizons-python-3.9.patch b/gnu/packages/patches/unknown-horizons-python-3.9.patch new file mode 100644 index 0000000000..8b93a71b6c --- /dev/null +++ b/gnu/packages/patches/unknown-horizons-python-3.9.patch @@ -0,0 +1,41 @@ +From 7f6f613826aef9810999c1599c8354e8a78fbdb4 Mon Sep 17 00:00:00 2001 +From: Lukas1818 <44570204+Lukas1818@users.noreply.github.com> +Date: Fri, 19 Feb 2021 21:08:44 +0100 +Subject: [PATCH] fixs for Phyton 3.9 (#2955) + +* change deprecated isAlive() to is_alive() + +* remove unsupported keyword "encoding" + +Co-authored-by: Lukas1818 +--- + horizons/util/loaders/jsondecoder.py | 2 +- + horizons/util/preloader.py | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/horizons/util/loaders/jsondecoder.py b/horizons/util/loaders/jsondecoder.py +index ea2ddfb3308..138a948f42a 100644 +--- a/horizons/util/loaders/jsondecoder.py ++++ b/horizons/util/loaders/jsondecoder.py +@@ -37,4 +37,4 @@ def _decode_dict(dct): + return newdict + + with open(path, "r") as f: +- return json.load(f, encoding="ascii", object_hook=_decode_dict) ++ return json.load(f, object_hook=_decode_dict) +diff --git a/horizons/util/preloader.py b/horizons/util/preloader.py +index 5689cc68152..2e072fcc642 100644 +--- a/horizons/util/preloader.py ++++ b/horizons/util/preloader.py +@@ -79,9 +79,9 @@ def wait_for_finish(self): + """ + self.lock.acquire() + # wait until it finished its current action +- if self.isAlive(): ++ if self.is_alive(): + self.join() +- assert not self.isAlive() ++ assert not self.is_alive() + else: + try: + self.lock.release() -- cgit v1.2.3 From ef270f9d73203c1b19c6163ce4d4257a52bfb605 Mon Sep 17 00:00:00 2001 From: Jack Hill Date: Tue, 2 Jan 2024 11:54:46 -0500 Subject: gnu: openssh: Fix build on ppc64le. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/ssh.scm (openssh)[source]: Use 'openssh-gcc-13-ppc64le-fzero-call-used-regs.patch'. * gnu/packages/patches/openssh-gcc-13-ppc64le-fzero-call-used-regs.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Reported-by: Marcel van der Boom . Change-Id: I41b1350b2cdd1487a8fd69b13b64f63c0dc166c9 Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + ...enssh-gcc-13-ppc64le-fzero-call-used-regs.patch | 61 ++++++++++++++++++++++ gnu/packages/ssh.scm | 5 +- 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/openssh-gcc-13-ppc64le-fzero-call-used-regs.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index bb78815a59..d2e2843372 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1754,6 +1754,7 @@ dist_patch_DATA = \ %D%/packages/patches/openjdk-15-xcursor-no-dynamic.patch \ %D%/packages/patches/openjdk-21-fix-rpath.patch \ %D%/packages/patches/openmpi-mtl-priorities.patch \ + %D%/packages/patches/openssh-gcc-13-ppc64le-fzero-call-used-regs.patch \ %D%/packages/patches/openssh-trust-guix-store-directory.patch \ %D%/packages/patches/openresolv-restartcmd-guix.patch \ %D%/packages/patches/openrgb-unbundle-hueplusplus.patch \ diff --git a/gnu/packages/patches/openssh-gcc-13-ppc64le-fzero-call-used-regs.patch b/gnu/packages/patches/openssh-gcc-13-ppc64le-fzero-call-used-regs.patch new file mode 100644 index 0000000000..1af9868b9a --- /dev/null +++ b/gnu/packages/patches/openssh-gcc-13-ppc64le-fzero-call-used-regs.patch @@ -0,0 +1,61 @@ +From 1036d77b34a5fa15e56f516b81b9928006848cbd Mon Sep 17 00:00:00 2001 +From: Damien Miller +Date: Fri, 22 Dec 2023 17:56:26 +1100 +Subject: [PATCH] better detection of broken -fzero-call-used-regs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +gcc 13.2.0 on ppc64le refuses to compile some function, including +cipher.c:compression_alg_list() with an error: + +> sorry, unimplemented: argument ‘used’ is not supportedcw +> for ‘-fzero-call-used-regs’ on this target + +This extends the autoconf will-it-work test with a similarly- +structured function that seems to catch this. + +Spotted/tested by Colin Watson; bz3645 +--- + +Taken from upsteam, and for Guix by jackhill@jackhill.us +Thanks Marcel van der Boom for noticing: https://issues.guix.gnu.org/67948#2 + +m4/openssh.m4 | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/m4/openssh.m4 b/m4/openssh.m4 +index 5d4c56280..033df501c 100644 +--- a/m4/openssh.m4 ++++ b/m4/openssh.m4 +@@ -20,18 +20,24 @@ char *f2(char *s, ...) { + va_end(args); + return strdup(ret); + } ++const char *f3(int s) { ++ return s ? "good" : "gooder"; ++} + int main(int argc, char **argv) { +- (void)argv; + char b[256], *cp; ++ const char *s; + /* Some math to catch -ftrapv problems in the toolchain */ + int i = 123 * argc, j = 456 + argc, k = 789 - argc; + float l = i * 2.1; + double m = l / 0.5; + long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; ++ (void)argv; + f(1); +- snprintf(b, sizeof b, "%d %d %d %f %f %lld %lld\n", i,j,k,l,m,n,o); ++ s = f3(f(2)); ++ snprintf(b, sizeof b, "%d %d %d %f %f %lld %lld %s\n", i,j,k,l,m,n,o,s); + if (write(1, b, 0) == -1) exit(0); +- cp = f2("%d %d %d %f %f %lld %lld\n", i,j,k,l,m,n,o); ++ cp = f2("%d %d %d %f %f %lld %lld %s\n", i,j,k,l,m,n,o,s); ++ if (write(1, cp, 0) == -1) exit(0); + free(cp); + /* + * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does +-- +2.41.0 + diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm index 2a5c0541cc..d53d8d59e7 100644 --- a/gnu/packages/ssh.scm +++ b/gnu/packages/ssh.scm @@ -204,7 +204,10 @@ a server that supports the SSH-2 protocol.") (method url-fetch) (uri (string-append "mirror://openbsd/OpenSSH/portable/" "openssh-" version ".tar.gz")) - (patches (search-patches "openssh-trust-guix-store-directory.patch")) + (patches (search-patches "openssh-trust-guix-store-directory.patch" + ;; Can be removed with next openssh update + ;; https://issues.guix.gnu.org/67948#2 + "openssh-gcc-13-ppc64le-fzero-call-used-regs.patch")) (sha256 (base32 "0z3pgam8b4z05lvdb78iv06p204qwl7b94a3cnnwba2mfb0120li")))) (build-system gnu-build-system) -- cgit v1.2.3 From 65d021a95032bc2dff81c19158fe9eeeb46f89d4 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 11 Jan 2024 13:34:33 +0100 Subject: gnu: python-scikit-bio: Update to 0.5.9. * gnu/packages/bioinformatics.scm (python-scikit-bio): Update to 0.5.9. [source]: Add patch. [arguments]: Disable one test via #:test-flags; adjust 'compatibility phase; update 'check phase. [propagated-inputs]: Remove python-cachecontrol, python-lockfile, and python-scikit-learn; add python-requests. * gnu/packages/patches/python-scikit-bio-1887.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Change-Id: Ie57b0256cf695e5ea088545cd2102335303a93e7 --- gnu/local.mk | 1 + gnu/packages/bioinformatics.scm | 39 +++----- gnu/packages/patches/python-scikit-bio-1887.patch | 109 ++++++++++++++++++++++ 3 files changed, 122 insertions(+), 27 deletions(-) create mode 100644 gnu/packages/patches/python-scikit-bio-1887.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index d2e2843372..ed4e82772e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1926,6 +1926,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-robotframework-atest.patch \ %D%/packages/patches/python-robotframework-source-date-epoch.patch \ %D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \ + %D%/packages/patches/python-scikit-bio-1887.patch \ %D%/packages/patches/python-scikit-optimize-1148.patch \ %D%/packages/patches/python-scikit-optimize-1150.patch \ %D%/packages/patches/python-typing-inspect-fix.patch \ diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index c05ca19022..462dd54bc9 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -4732,58 +4732,43 @@ and record oriented data modeling and the Semantic Web.") (define-public python-scikit-bio (package (name "python-scikit-bio") - (version "0.5.7") + (version "0.5.9") (source (origin (method url-fetch) (uri (pypi-uri "scikit-bio" version)) (sha256 (base32 - "1a8xbp3vrw8wfpm3pa2nb4rcar0643iqnb043ifwqbqyc86clhv3")))) + "0429060pkyq1pm19zb2n1la7czh7b633mp4a4h01j8zfigf49q3s")) + (patches (search-patches "python-scikit-bio-1887.patch")))) (build-system pyproject-build-system) (arguments (list + ;; Accuracy problem + #:test-flags '(list "-k" "not test_fisher_alpha") #:phases '(modify-phases %standard-phases - ;; See https://github.com/biocore/scikit-bio/pull/1826 (add-after 'unpack 'compatibility (lambda _ - (substitute* "skbio/sequence/tests/test_sequence.py" - (("def test_concat_strict_many") - "def _do_not_test_concat_strict_many")) - (substitute* "skbio/stats/distance/_mantel.py" - (("from scipy.stats import PearsonRConstantInputWarning") - "from scipy.stats import ConstantInputWarning") - (("from scipy.stats import PearsonRNearConstantInputWarning") - "from scipy.stats import NearConstantInputWarning") - (("from scipy.stats import SpearmanRConstantInputWarning") "") - (("warnings.warn\\(PearsonRConstantInputWarning\\(\\)\\)") - "warnings.warn(ConstantInputWarning())") - (("warnings.warn\\(PearsonRNearConstantInputWarning\\(\\)\\)") - "warnings.warn(NearConstantInputWarning())") - (("warnings.warn\\(SpearmanRConstantInputWarning\\(\\)\\)") - "warnings.warn(ConstantInputWarning())")) - (substitute* "skbio/diversity/alpha/tests/test_base.py" - (("self.assertEqual\\(pielou_e") - "self.assertAlmostEqual(pielou_e")))) + (substitute* "skbio/diversity/__init__.py" + ((", numeric_only=True") "")))) (add-before 'check 'build-extensions (lambda _ ;; Cython extensions have to be built before running the tests. (invoke "python3" "setup.py" "build_ext" "--inplace"))) (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? (invoke "python3" "-m" "skbio.test"))))))) + (lambda* (#:key tests? test-flags #:allow-other-keys) + (when tests? + (apply invoke "python3" "-m" "skbio.test" test-flags))))))) (propagated-inputs - (list python-cachecontrol - python-decorator + (list python-decorator python-h5py python-hdmedians python-ipython - python-lockfile python-matplotlib python-natsort python-numpy python-pandas - python-scikit-learn + python-requests python-scipy)) (native-inputs (list python-coverage python-pytest)) diff --git a/gnu/packages/patches/python-scikit-bio-1887.patch b/gnu/packages/patches/python-scikit-bio-1887.patch new file mode 100644 index 0000000000..7ee7518128 --- /dev/null +++ b/gnu/packages/patches/python-scikit-bio-1887.patch @@ -0,0 +1,109 @@ +From 290da0472e3a0af01b242cd1d3dd6a24588db0e5 Mon Sep 17 00:00:00 2001 +From: qiyunzhu +Date: Sat, 4 Nov 2023 12:59:54 -0700 +Subject: [PATCH 1/2] removed kulsinski + +--- + CHANGELOG.md | 6 ++++++ + ci/aarch64.conda_requirements.txt | 2 +- + ci/conda_requirements.txt | 2 +- + setup.py | 2 +- + skbio/diversity/_driver.py | 2 -- + 5 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/CHANGELOG.md b/CHANGELOG.md +index 0ce69c2c6..cd9adea6c 100644 +--- a/CHANGELOG.md ++++ b/CHANGELOG.md +@@ -2,6 +2,12 @@ + + ## Version 0.5.10 + ++### Features ++* SciPy 1.11+ is now supported. ++ ++### Backward-incompatible changes [experimental] ++* Beta diversity metric `kulsinski` was removed. This was motivated by that SciPy replaced this distance metric with `kulczynski1` in version 1.11 (see SciPy issue [#2009](https://github.com/scipy/scipy/issues/2009)), and that both metrics do not return 0 on two identical vectors. ++ + ### Bug fixes + + * Re-enabled OpenMP support, which has been mistakenly disabled in 0.5.8 ([#1874](https://github.com/biocore/scikit-bio/pull/1874)) +diff --git a/ci/aarch64.conda_requirements.txt b/ci/aarch64.conda_requirements.txt +index a329bc666..3564f4c3c 100644 +--- a/ci/aarch64.conda_requirements.txt ++++ b/ci/aarch64.conda_requirements.txt +@@ -5,5 +5,5 @@ matplotlib >= 1.4.3 + natsort >= 4.0.3 + numpy >= 1.9.2 + pandas >= 1.5.0 +-scipy <= 1.10.1 ++scipy >= 1.9.0 + h5py >= 3.6.0 +diff --git a/ci/conda_requirements.txt b/ci/conda_requirements.txt +index 4402e4ebb..0f1bd715c 100644 +--- a/ci/conda_requirements.txt ++++ b/ci/conda_requirements.txt +@@ -5,6 +5,6 @@ matplotlib >= 1.4.3 + natsort >= 4.0.3 + numpy >= 1.9.2 + pandas >= 1.5.0 +-scipy <= 1.10.1 ++scipy >= 1.9.0 + h5py >= 3.6.0 + hdmedians >= 0.14.1 +diff --git a/setup.py b/setup.py +index 36600e427..fa4d5e0a7 100644 +--- a/setup.py ++++ b/setup.py +@@ -221,7 +221,7 @@ def check_bin(ccbin, source, allow_dash): + 'natsort >= 4.0.3', + 'numpy >= 1.9.2', + 'pandas >= 1.5.0', +- 'scipy <= 1.10.1', ++ 'scipy >= 1.9.0', + 'h5py >= 3.6.0', + 'hdmedians >= 0.14.1', + ], +diff --git a/skbio/diversity/_driver.py b/skbio/diversity/_driver.py +index 016020743..1a792efb6 100644 +--- a/skbio/diversity/_driver.py ++++ b/skbio/diversity/_driver.py +@@ -296,7 +296,6 @@ def partial_beta_diversity(metric, counts, ids, id_pairs, validate=True, + "dice", + "hamming", + "jaccard", +- "kulsinski", + "mahalanobis", + "manhattan", # aliases to "cityblock" in beta_diversity + "matching", +@@ -314,7 +313,6 @@ def partial_beta_diversity(metric, counts, ids, id_pairs, validate=True, + _qualitative_beta_metrics = [ + "dice", + "jaccard", +- "kulsinski", + "matching", + "rogerstanimoto", + "russellrao", + +From 9dd9c6dd68a015f1159f884c57878b8a00fad14c Mon Sep 17 00:00:00 2001 +From: Qiyun Zhu +Date: Tue, 7 Nov 2023 22:42:10 -0700 +Subject: [PATCH 2/2] fixing numpy exception + +--- + skbio/stats/tests/test_composition.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/skbio/stats/tests/test_composition.py b/skbio/stats/tests/test_composition.py +index 90921be5b..e720a594f 100644 +--- a/skbio/stats/tests/test_composition.py ++++ b/skbio/stats/tests/test_composition.py +@@ -1222,7 +1222,7 @@ def test_ancom_fail_alpha(self): + ancom(self.table1, self.cats1, alpha=1.1) + + def test_ancom_fail_multiple_groups(self): +- with self.assertRaises(TypeError): ++ with self.assertRaises((TypeError, np.AxisError)): + ancom(self.table4, self.cats4, + significance_test=scipy.stats.ttest_ind) + -- cgit v1.2.3 From b8085c9240d0202a759eaaae531b2c1b01bef035 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 16 Jan 2024 14:16:10 +0100 Subject: gnu: python-pyls-black: Fix build. * gnu/packages/patches/python-pyls-black-41.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/python-xyz.scm (python-pyls-black)[source]: Add patch. [build-system]: Use pyproject-build-system. [arguments]: Disable one failing test. Change-Id: I14b2982644e58c0b43d76838febc6dfceb220b15 --- gnu/local.mk | 1 + gnu/packages/patches/python-pyls-black-41.patch | 45 +++++++++++++++++++++++++ gnu/packages/python-xyz.scm | 7 ++-- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/python-pyls-black-41.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index ed4e82772e..34bed91fc3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1796,6 +1796,7 @@ dist_patch_DATA = \ %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-pyls-black-41.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-pyls-black-41.patch b/gnu/packages/patches/python-pyls-black-41.patch new file mode 100644 index 0000000000..5a1ebd2f54 --- /dev/null +++ b/gnu/packages/patches/python-pyls-black-41.patch @@ -0,0 +1,45 @@ +From ada6a999e4f5cca21a2133e449f4576dbe9a64d2 Mon Sep 17 00:00:00 2001 +From: Isaac Dadzie <4581114+idadzie@users.noreply.github.com> +Date: Fri, 4 Feb 2022 21:18:37 +0000 +Subject: [PATCH] Add support for black 22.1.0 + +Make changes to support black 22.1.0, which changed the return type +of 'find_project_root' to a tuple. + +Resolves: #40 +--- + pyls_black/plugin.py | 8 +++++++- + setup.cfg | 2 +- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/pyls_black/plugin.py b/pyls_black/plugin.py +index dc5d482..e4f4d98 100644 +--- a/pyls_black/plugin.py ++++ b/pyls_black/plugin.py +@@ -73,7 +73,13 @@ def load_config(filename: str) -> Dict: + + root = black.find_project_root((filename,)) + +- pyproject_filename = root / "pyproject.toml" ++ # Note: find_project_root returns a tuple in 22.1.0+ ++ try: ++ # Keeping this to not break backward compatibility. ++ pyproject_filename = root / "pyproject.toml" ++ except TypeError: ++ _root, _ = root ++ pyproject_filename = _root / "pyproject.toml" + + if not pyproject_filename.is_file(): + return defaults +diff --git a/setup.cfg b/setup.cfg +index 036cec2..57fbe4f 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -1,6 +1,6 @@ + [metadata] + name = pyls-black +-version = 0.4.7 ++version = 0.4.8 + author = Rupert Bedford + author_email = rupert@rupertb.com + description = Black plugin for the Python Language Server diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index a806166569..e486a73023 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -2666,6 +2666,7 @@ Unicode-to-LaTeX conversion.") (file-name (git-file-name name version)) (sha256 (base32 "0bkhfnlik89j3yamr20br4wm8975f20v33wabi2nyxvj10whr5dj")) + (patches (search-patches "python-pyls-black-41.patch")) ;; Patch to work with python-lsp-server. Taken from ;; . (modules '((guix build utils))) @@ -2681,9 +2682,11 @@ Unicode-to-LaTeX conversion.") "pylsp_format_range") (("from pyls([ \\.])" _ char) (string-append "from pylsp" char))))))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - `(#:test-target "pytest")) + (list + #:test-flags + '(list "-k" "not test_load_config_target_version"))) (propagated-inputs (list python-black python-lsp-server python-tomli)) (native-inputs -- cgit v1.2.3