From 3fc26c6dc4b6bbf558a17b5e3ef8092ea0eeeacd Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 12 Jun 2023 18:07:07 +0300 Subject: gnu: directfb: Fix building on armhf-linux. * gnu/packages/graphics.scm (directfb)[arguments]: Add a phase when building for armhf-linux to apply a patch. [native-inputs]: Add patch, patch file. * gnu/packages/patches/directfb-davinci-glibc-228-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- 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 ce16d37e2b..6aabe2ba73 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1056,6 +1056,7 @@ dist_patch_DATA = \ %D%/packages/patches/dezyne-add-missing-shebangs.patch \ %D%/packages/patches/dfu-programmer-fix-libusb.patch \ %D%/packages/patches/diffutils-fix-signal-processing.patch \ + %D%/packages/patches/directfb-davinci-glibc-228-compat.patch \ %D%/packages/patches/dkimproxy-add-ipv6-support.patch \ %D%/packages/patches/docbook-xsl-nonrecursive-string-subst.patch \ %D%/packages/patches/docbook-xsl-support-old-url.patch \ -- cgit 1.4.1 From b188c41d930dbe8142c1f377d3c8f2580ff1277c Mon Sep 17 00:00:00 2001 From: Alice BRENON Date: Fri, 5 May 2023 15:26:37 +0200 Subject: gnu: quodlibet: Fix compatibility with python-3.10. Reported in #63205. * gnu/packages/music.scm (quodlibet)[source]: Add two backported patches. [arguments]: Adjust 'check phase to change skipped tests. * gnu/packages/patches/quodlibet-fix-invalid-glob.patch, gnu/packages/patches/quodlibet-fix-mtime-tests.patch: New files. * gnu/local.mk (dist_patch_DATA): Register them. Signed-off-by: Efraim Flashner --- gnu/local.mk | 2 + gnu/packages/music.scm | 6 +- .../patches/quodlibet-fix-invalid-glob.patch | 89 ++++++++++++++++++++++ .../patches/quodlibet-fix-mtime-tests.patch | 39 ++++++++++ 4 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/quodlibet-fix-invalid-glob.patch create mode 100644 gnu/packages/patches/quodlibet-fix-mtime-tests.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 6aabe2ba73..03b981c201 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1703,6 +1703,8 @@ dist_patch_DATA = \ %D%/packages/patches/python-typeguard-python3.10.patch \ %D%/packages/patches/python-w3lib-fix-test-failure.patch \ %D%/packages/patches/python-wxwidgets-type-errors.patch \ + %D%/packages/patches/quodlibet-fix-invalid-glob.patch \ + %D%/packages/patches/quodlibet-fix-mtime-tests.patch \ %D%/packages/patches/scribus-1.5.8-poppler-22.03.0.patch \ %D%/packages/patches/scribus-1.5.8-poppler-22.04.0.patch \ %D%/packages/patches/scribus-1.5.8-poppler-22.09.0.patch \ diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 67d170997d..2e7eddafb0 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -7154,6 +7154,8 @@ streaming audio server.") (url "https://github.com/quodlibet/quodlibet") (commit (string-append "release-" version)))) (file-name (git-file-name name version)) + (patches (search-patches "quodlibet-fix-invalid-glob.patch" + "quodlibet-fix-mtime-tests.patch")) (sha256 (base32 "1i5k93k3bfp7hpcwkbr865mbj9jam3jv2a5k1bazcyp4f5vdrb0v")))) (build-system python-build-system) @@ -7177,9 +7179,7 @@ streaming audio server.") "--ignore=tests/test_browsers_iradio.py" ;; broken upstream "--disable-warnings" - "--ignore=tests/quality" - ;; missing legacy icons in adwaita-icon-theme - "--ignore=tests/plugin/test_trayicon.py") + "--ignore=tests/quality/test_flake8.py") (format #t "test suite not run~%")))) (add-after 'install 'glib-or-gtk-wrap ; ensure icons loaded (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)) diff --git a/gnu/packages/patches/quodlibet-fix-invalid-glob.patch b/gnu/packages/patches/quodlibet-fix-invalid-glob.patch new file mode 100644 index 0000000000..95f95d8aab --- /dev/null +++ b/gnu/packages/patches/quodlibet-fix-invalid-glob.patch @@ -0,0 +1,89 @@ +From 5f55431a28509fd4f4f7b40dc246f3d34fa8549e Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sun, 26 Jun 2022 23:14:28 +0200 +Subject: [PATCH] builtin cover: fix handling of invalid glob ranges with + Python 3.10.5+ (#4027) + +Previously Python would raise if an invalid range was given +to glob, but with 3.10.5 they fixed it to not match anything. +https://github.com/python/cpython/issues/89973 + +Our tests depended on the previous logic and treating the glob pattern +as a literal file name in that case. + +One could argue that this is wrong since a range that doesn't contain anything +should also not match anything, so wrap glob() to make it not match for all +Python versions in that case and adjust the tests accordingly. + +This should fix the Windows CI, which is currently the only job using 3.10.5 +--- + quodlibet/util/cover/built_in.py | 22 +++++++++++----------- + tests/test_util_cover.py | 12 +++--------- + 2 files changed, 14 insertions(+), 20 deletions(-) + +diff --git a/quodlibet/util/cover/built_in.py b/quodlibet/util/cover/built_in.py +index f2a8791a2..01474c9b6 100644 +--- a/quodlibet/util/cover/built_in.py ++++ b/quodlibet/util/cover/built_in.py +@@ -100,6 +100,15 @@ class FilesystemCover(CoverSourcePlugin): + base = self.song('~dirname') + images = [] + ++ def safe_glob(*args, **kwargs): ++ try: ++ return glob.glob(*args, **kwargs) ++ except sre_constants.error: ++ # https://github.com/python/cpython/issues/89973 ++ # old glob would fail with invalid ranges, newer one ++ # handles it correctly. ++ return [] ++ + if config.getboolean("albumart", "force_filename"): + score = 100 + for filename in config.get("albumart", "filename").split(","): +@@ -107,17 +116,8 @@ class FilesystemCover(CoverSourcePlugin): + filename = filename.strip() + + escaped_path = os.path.join(glob.escape(base), filename) +- try: +- for path in glob.glob(escaped_path): +- images.append((score, path)) +- except sre_constants.error: +- # Use literal filename if globbing causes errors +- path = os.path.join(base, filename) +- +- # We check this here, so we can search for alternative +- # files in case no preferred file was found. +- if os.path.isfile(path): +- images.append((score, path)) ++ for path in safe_glob(escaped_path): ++ images.append((score, path)) + + # So names and patterns at the start are preferred + score -= 1 +diff --git a/tests/test_util_cover.py b/tests/test_util_cover.py +index db81e4d1f..71a48ad9a 100644 +--- a/tests/test_util_cover.py ++++ b/tests/test_util_cover.py +@@ -105,15 +105,9 @@ class TCoverManager(TestCase): + config.set("albumart", "force_filename", str(True)) + config.set("albumart", "filename", "[a-2].jpg") + +- # Should match +- f = self.add_file("[a-2].jpg") +- assert path_equal( +- os.path.abspath(self._find_cover(self.song).name), f) +- +- # Should not crash +- f = self.add_file("test.jpg") +- assert not path_equal( +- os.path.abspath(self._find_cover(self.song).name), f) ++ # Invalid glob range, should not match anything ++ self.add_file("a.jpg") ++ assert self._find_cover(self.song) is None + + def test_invalid_glob_path(self): + config.set("albumart", "force_filename", str(True)) +-- +2.39.2 + diff --git a/gnu/packages/patches/quodlibet-fix-mtime-tests.patch b/gnu/packages/patches/quodlibet-fix-mtime-tests.patch new file mode 100644 index 0000000000..037f77d868 --- /dev/null +++ b/gnu/packages/patches/quodlibet-fix-mtime-tests.patch @@ -0,0 +1,39 @@ +From 06a32b319f065550efe0d2a9ff10ca6bdc32b893 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sat, 23 Jul 2022 20:15:18 +0200 +Subject: [PATCH] operon: hopefully better fix for flaky mtime tests + +copy the mtime after we write everything, so there is no chance of +it changing before we note the initial value. +--- + quodlibet/operon/commands.py | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/quodlibet/operon/commands.py b/quodlibet/operon/commands.py +index e0a5ef33a..af2dcfa8b 100644 +--- a/quodlibet/operon/commands.py ++++ b/quodlibet/operon/commands.py +@@ -227,16 +227,16 @@ class EditCommand(Command): + # write to tmp file + fd, path = tempfile.mkstemp(suffix=".txt") + +- # XXX: copy mtime here so we can test for changes in tests by +- # setting a out of date mtime on the source song file +- copy_mtime(args[0], path) +- + try: + try: + os.write(fd, dump) + finally: + os.close(fd) + ++ # XXX: copy mtime here so we can test for changes in tests by ++ # setting a out of date mtime on the source song file ++ copy_mtime(args[0], path) ++ + # only parse the result if the editor returns 0 and the mtime has + # changed + old_mtime = mtime(path) +-- +2.39.2 + -- cgit 1.4.1 From f3114ac4f0f1ac20a85dcb20c44cb32e06c22a14 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 28 May 2023 11:09:19 +0300 Subject: system: images: Add unmatched module. * gnu/system/images/unmatched.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/system/images/unmatched.scm | 102 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 gnu/system/images/unmatched.scm (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 03b981c201..30bea95a23 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -743,6 +743,7 @@ GNU_SYSTEM_MODULES = \ %D%/system/images/pine64.scm \ %D%/system/images/pinebook-pro.scm \ %D%/system/images/rock64.scm \ + %D%/system/images/unmatched.scm \ %D%/system/images/wsl2.scm \ \ %D%/machine.scm \ diff --git a/gnu/system/images/unmatched.scm b/gnu/system/images/unmatched.scm new file mode 100644 index 0000000000..d40a32f184 --- /dev/null +++ b/gnu/system/images/unmatched.scm @@ -0,0 +1,102 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 Efraim Flashner +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu system images unmatched) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader u-boot) + #:use-module (gnu image) + #:use-module (gnu packages linux) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services networking) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system image) + #:use-module (guix platforms riscv) + #:use-module (srfi srfi-26) + #:export (unmatched-barebones-os + unmatched-image-type + unmatched-barebones-raw-image)) + +(define unmatched-barebones-os + (operating-system + (host-name "unmatched") + (timezone "Asia/Jerusalem") + (locale "en_US.utf8") + (bootloader (bootloader-configuration + (bootloader u-boot-sifive-unmatched-bootloader) + (targets '("/dev/vda")))) + (initrd-modules '()) + (kernel linux-libre-riscv64-generic) + (file-systems (cons (file-system + (device (file-system-label "my-root")) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (services + (append (list (service agetty-service-type + (agetty-configuration + (extra-options '("-L")) ; no carrier detect + (baud-rate "115200") + (term "vt100") + (tty "ttySIF0"))) + (service dhcp-client-service-type)) + %base-services)))) + +(define unmatched-disk-image + (image-without-os + (format 'disk-image) + (partition-table-type 'gpt) + ;; https://source.denx.de/u-boot/u-boot/-/blob/master/doc/board/sifive/unmatched.rst + ;; The boot process goes: + ;; * zero-stage bootloader (ZSBL) in ROM and first-stage bootloader (FSBL) + ;; together perform the SoC initialization and hand off to the next stage. + ;; * BBL (Berkeley bootloader) takes the device-tree and brings up the rest + ;; of the board, then boots the desired operating system. + (partitions (list + (partition + ;; Special UUID for HiFive first-stage bootloader (FSBL). + (size (* 1 (expt 2 20))) + (label "spl") + (offset (* 34 512)) + (file-system "unformatted") + (uuid (uuid "5b193300-fc78-40cd-8002-e86c45580b47"))) + (partition + ;; Specific offset for compatibility with the defaults for + ;; u-boot SPL. Special UUID for HiFive BBL (Berkeley bootloader). + (size (* 4 (expt 2 20))) + (label "uboot") + (offset (* 2082 512)) + (file-system "unformatted") + (uuid (uuid "2e54b353-1271-4842-806f-e436d6af6985"))) + root-partition)))) + +(define unmatched-image-type + (image-type + (name 'unmatched-raw) + (constructor (cut image-with-os unmatched-disk-image <>)))) + +(define unmatched-barebones-raw-image + (image + (inherit + (os+platform->image unmatched-barebones-os riscv64-linux + #:type unmatched-image-type)) + (name 'unmatched-barebones-raw-image))) + +;; Return the default image. +unmatched-barebones-raw-image -- cgit 1.4.1 From f9b8f38908da660a2f775de2656e47f3e9ec75bc Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 28 May 2023 12:04:53 +0300 Subject: gnu: glibc-2.33: Fix building for riscv64-linux. * gnu/packages/base.scm (glibc-2.33)[source]: Add patch. * gnu/packages/patches/glibc-2.33-riscv64-miscompilation.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/base.scm | 16 +++--- .../glibc-2.33-riscv64-miscompilation.patch | 57 ++++++++++++++++++++++ 3 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 gnu/packages/patches/glibc-2.33-riscv64-miscompilation.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 30bea95a23..209556b56d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1240,6 +1240,7 @@ dist_patch_DATA = \ %D%/packages/patches/glib-appinfo-watch.patch \ %D%/packages/patches/glib-networking-gnutls-binding.patch \ %D%/packages/patches/glib-skip-failing-test.patch \ + %D%/packages/patches/glibc-2.33-riscv64-miscompilation.patch \ %D%/packages/patches/glibc-CVE-2019-7309.patch \ %D%/packages/patches/glibc-CVE-2019-9169.patch \ %D%/packages/patches/glibc-CVE-2019-19126.patch \ diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index d2f276c447..39c7e5ef5f 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -1066,12 +1066,13 @@ with the Linux kernel.") (base32 "1zvp0qdfbdyqrzydz18d9zg3n5ygy8ps7cmny1bvsp8h1q05c99f")) (patches - ;; Remove a patch that's become irrelevant and that does not - ;; apply to this version. - (remove (lambda (patch) - (string=? (basename patch) - "glibc-hurd-clock_gettime_monotonic.patch")) - (origin-patches (package-source glibc)))))) + (cons (search-patch "glibc-2.33-riscv64-miscompilation.patch") + ;; Remove a patch that's become irrelevant and that does not + ;; apply to this version. + (remove (lambda (patch) + (string=? (basename patch) + "glibc-hurd-clock_gettime_monotonic.patch")) + (origin-patches (package-source glibc))))))) (arguments (substitute-keyword-arguments (package-arguments glibc) ((#:configure-flags flags ''()) @@ -1379,6 +1380,9 @@ test environments.") (make-glibc-utf8-locales glibc))) ;; Packages provided to ease use of binaries linked against the previous libc. +(define-public glibc-locales-2.33 + (package (inherit (make-glibc-locales glibc-2.33)) + (name "glibc-locales-2.33"))) (define-public glibc-locales-2.32 (package (inherit (make-glibc-locales glibc-2.32)) (name "glibc-locales-2.32"))) diff --git a/gnu/packages/patches/glibc-2.33-riscv64-miscompilation.patch b/gnu/packages/patches/glibc-2.33-riscv64-miscompilation.patch new file mode 100644 index 0000000000..bcf297be94 --- /dev/null +++ b/gnu/packages/patches/glibc-2.33-riscv64-miscompilation.patch @@ -0,0 +1,57 @@ +This patch is from upstream glibc after 2.33 and is needed in Guix to +fix glibc-2.33 compilation for riscv64-linux. + +From 044e603b698093cf48f6e6229e0b66acf05227e4 Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Fri, 19 Feb 2021 13:29:00 +0100 +Subject: [PATCH] string: Work around GCC PR 98512 in rawmemchr + +--- + string/rawmemchr.c | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +diff --git a/string/rawmemchr.c b/string/rawmemchr.c +index 59bbeeaa42..b8523118e5 100644 +--- a/string/rawmemchr.c ++++ b/string/rawmemchr.c +@@ -22,24 +22,28 @@ + # define RAWMEMCHR __rawmemchr + #endif + ++/* The pragmata should be nested inside RAWMEMCHR below, but that ++ triggers GCC PR 98512. */ ++DIAG_PUSH_NEEDS_COMMENT; ++#if __GNUC_PREREQ (7, 0) ++/* GCC 8 warns about the size passed to memchr being larger than ++ PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */ ++DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-overflow="); ++#endif ++#if __GNUC_PREREQ (11, 0) ++/* Likewise GCC 11, with a different warning option. */ ++DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread"); ++#endif ++ + /* Find the first occurrence of C in S. */ + void * + RAWMEMCHR (const void *s, int c) + { +- DIAG_PUSH_NEEDS_COMMENT; +-#if __GNUC_PREREQ (7, 0) +- /* GCC 8 warns about the size passed to memchr being larger than +- PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */ +- DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-overflow="); +-#endif +-#if __GNUC_PREREQ (11, 0) +- /* Likewise GCC 11, with a different warning option. */ +- DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread"); +-#endif + if (c != '\0') + return memchr (s, c, (size_t)-1); +- DIAG_POP_NEEDS_COMMENT; + return (char *)s + strlen (s); + } + libc_hidden_def (__rawmemchr) + weak_alias (__rawmemchr, rawmemchr) ++ ++DIAG_POP_NEEDS_COMMENT; +-- -- cgit 1.4.1 From 4e60cbe5bbcf425442952de0e8eb6410e9304d1d Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 14 Jun 2023 08:06:21 -0400 Subject: gnu: ibus-anthy: Prepare for tests. * gnu/packages/patches/ibus-anthy-fix-tests.patch: New patch. * gnu/packages/ibus.scm (ibus-anthy): Register it. * gnu/packages/ibus.scm (ibus-anthy) [source]: Apply patch. [arguments]: Clarify #:tests? comment. Add a fix-check, do-not-override-GI_TYPELIB_PATH and prepare-for-tests phases. [native-inputs]: Add procps, python-pycotap, util-linux and xorg-server-for-tests. --- gnu/local.mk | 1 + gnu/packages/ibus.scm | 38 +++++++++++++++++-- gnu/packages/patches/ibus-anthy-fix-tests.patch | 49 +++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/ibus-anthy-fix-tests.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 209556b56d..3d3e54406b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -897,6 +897,7 @@ dist_patch_DATA = \ %D%/packages/patches/akonadi-not-relocatable.patch \ %D%/packages/patches/akonadi-timestamps.patch \ %D%/packages/patches/allegro-mesa-18.2.5-and-later.patch \ + %D%/packages/patches/ibus-anthy-fix-tests.patch \ %D%/packages/patches/anki-mpv-args.patch \ %D%/packages/patches/antiword-CVE-2014-8123.patch \ %D%/packages/patches/antlr3-3_1-fix-java8-compilation.patch \ diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm index d880956c56..e9294fab1e 100644 --- a/gnu/packages/ibus.scm +++ b/gnu/packages/ibus.scm @@ -59,10 +59,12 @@ #:use-module (gnu packages gstreamer) #:use-module (gnu packages gtk) #:use-module (gnu packages iso-codes) + #:use-module (gnu packages linux) #:use-module (gnu packages logging) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-check) #:use-module (gnu packages python-xyz) #:use-module (gnu packages python-web) #:use-module (gnu packages serialization) @@ -348,18 +350,44 @@ Chinese pinyin input methods.") version "/ibus-anthy-" version ".tar.gz")) (sha256 (base32 - "16vd0k8wm13s38869jqs3dnwmjvywgn0snnpyi41m28binhlssf8")))) + "16vd0k8wm13s38869jqs3dnwmjvywgn0snnpyi41m28binhlssf8")) + (patches (search-patches "ibus-anthy-fix-tests.patch")))) (build-system gnu-build-system) (arguments (list + ;; The test suite hangs (see: + ;; https://github.com/ibus/ibus-anthy/issues/28). + #:tests? #f #:configure-flags ;; Use absolute exec path in the anthy.xml. #~(list (string-append "--libexecdir=" #$output "/libexec")) ;; The test suite fails (see: ;; https://github.com/ibus/ibus-anthy/issues/28). - #:tests? #f #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'fix-check + (lambda _ + (substitute* "data/Makefile.in" + ;; Use a year current at the time the release was made, to + ;; avoid the "This year 2023 is not included in era.y" + ;; error. + (("`date '\\+%Y'`") + "2021")))) + (add-after 'unpack 'do-not-override-GI_TYPELIB_PATH + ;; Do not override the GI_TYPELIB_PATH to avoid the pygobject + ;; error: "ValueError: Namespace Gdk not available". + (lambda _ + (substitute* "tests/test-build.sh" + (("GI_TYPELIB_PATH=\\$BUILDDIR/../gir" all) + (string-append all ":$GI_TYPELIB_PATH"))))) + (add-before 'check 'prepare-for-tests + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + ;; IBus requires write access to the HOME directory. + (setenv "HOME" "/tmp") + ;; The single test is skipped if no actual display is found. + (system "Xvfb :1 &") + (setenv "DISPLAY" ":1")))) (add-after 'install 'wrap-programs (lambda* (#:key inputs #:allow-other-keys) (for-each @@ -376,7 +404,11 @@ Chinese pinyin input methods.") `(,glib "bin") intltool pkg-config - python)) + procps ;for ps + python + python-pycotap + util-linux ;for getopt + xorg-server-for-tests)) (inputs (list anthy gtk+ diff --git a/gnu/packages/patches/ibus-anthy-fix-tests.patch b/gnu/packages/patches/ibus-anthy-fix-tests.patch new file mode 100644 index 0000000000..6934358980 --- /dev/null +++ b/gnu/packages/patches/ibus-anthy-fix-tests.patch @@ -0,0 +1,49 @@ +Submitted upstream: https://github.com/ibus/ibus-anthy/pull/35 + +diff --git a/tests/test-build.sh b/tests/test-build.sh +index e83b78f..a0efe32 100755 +--- a/tests/test-build.sh ++++ b/tests/test-build.sh +@@ -63,26 +63,27 @@ parse_args() + done; + } + ++maybe_install_pycotap() { ++ # Check if pycotap is already available. ++ python3 -m pycotap >/dev/null && return 0 ++ ++ # Red Hat specific hint. ++ if test -f /etc/redhat-release ; then ++ if ! rpm -q --quiet python3-pycotap; then ++ echo "Please install python3-pycotap" ++ exit -1 ++ fi ++ fi; ++} ++ + init_environment() + { + if test x$FORCE_TEST != x ; then + RUN_ARGS="$RUN_ARGS --force"; + fi; +- HAS_TAP=0; +- if test -f /etc/redhat-release ; then +- rpm -q --quiet python3-pycotap +- if test $? -ne 0 ; then +- echo "Not found python3-pycotap"; +- exit -1; +- fi; +- HAS_TAP=1; +- fi; +- TAP_DIR=`python -m site --user-site`/pycotap; +- if test $HAS_TAP -ne 1 && \ +- test x"$TAP_DIR" != x && test ! -d "$TAP_DIR" ; then +- echo "pip install pycotap --user"; +- pip install pycotap --user; +- fi; ++ ++ maybe_install_pycotap ++ + if test ! -f $BUILDDIR/../data/$ANTHY_SCHEMA_FILE ; then + echo "Not found $BUILDDIR/../data/$ANTHY_SCHEMA_FILE"; + exit -1; -- cgit 1.4.1 From 49119eee2b1d46945d6ca9ba12355ffa0f8859b3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 6 Jun 2023 23:50:38 +0200 Subject: gnu: guile-fibers: Add 1.3.1. * gnu/packages/guile-xyz.scm (guile-fibers-1.3): New variable. (guile-fibers-1.1): Inherit from it. * gnu/packages/patches/guile-fibers-libevent-32-bit.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/guile-xyz.scm | 53 ++++++++++++++++------ .../patches/guile-fibers-libevent-32-bit.patch | 18 ++++++++ 3 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 gnu/packages/patches/guile-fibers-libevent-32-bit.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 3d3e54406b..bc3cdbbaed 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1321,6 +1321,7 @@ dist_patch_DATA = \ %D%/packages/patches/guile-fibers-epoll-instance-is-dead.patch \ %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-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 69e4d02472..4acd756f9a 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -92,6 +92,7 @@ #:use-module (gnu packages hurd) #:use-module (gnu packages image) #:use-module (gnu packages imagemagick) + #:use-module (gnu packages libevent) #:use-module (gnu packages libffi) #:use-module (gnu packages libunistring) #:use-module (gnu packages linux) @@ -783,10 +784,10 @@ Unix-style DSV format and RFC 4180 format.") (inputs (list guile-2.2)) (propagated-inputs `(("guile-lib" ,guile2.2-lib))))) -(define-public guile-fibers-1.1 +(define-public guile-fibers-1.3 (package (name "guile-fibers") - (version "1.1.1") + (version "1.3.1") (source (origin (method git-fetch) (uri (git-reference @@ -795,11 +796,9 @@ Unix-style DSV format and RFC 4180 format.") (file-name (git-file-name name version)) (sha256 (base32 - "0ll63d7202clapg1k4bilbnlmfa4qvpjnsd7chbkka4kxf5klilc")) + "0wvdi4l58f9a5c9wi3cdc9l1bniscsixb6w2zj86mch7j7j814lc")) (patches - (search-patches "guile-fibers-wait-for-io-readiness.patch" - "guile-fibers-epoll-instance-is-dead.patch" - "guile-fibers-fd-finalizer-leak.patch")))) + (search-patches "guile-fibers-libevent-32-bit.patch")))) (build-system gnu-build-system) (arguments (list #:make-flags @@ -817,17 +816,15 @@ Unix-style DSV format and RFC 4180 format.") (substitute* "Makefile" (("tests/speedup.scm") "")))))))) (native-inputs - (list texinfo pkg-config autoconf automake libtool + (list texinfo pkg-config autoconf-2.71 automake libtool guile-3.0 ;for 'guild compile ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS' gettext-minimal)) (inputs - (list guile-3.0)) ;for libguile-3.0.so - (supported-systems - ;; This version requires 'epoll' and is thus limited to Linux-based - ;; systems, but this may change soon: - ;; . - (filter (cut string-suffix? "-linux" <>) %supported-systems)) + (append (list guile-3.0) ;for libguile-3.0.so + (if (hurd-target?) + (list libevent) + '()))) (synopsis "Lightweight concurrency facility for Guile") (description "Fibers is a Guile library that implements a a lightweight concurrency @@ -844,6 +841,36 @@ is not available for Guile 2.0.") (properties '((upstream-name . "fibers"))) (license license:lgpl3+))) +(define-public guile-fibers-1.1 + (package + (inherit guile-fibers-1.3) + (version "1.1.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/wingo/fibers") + (commit (string-append "v" version)))) + (file-name (git-file-name "guile-fibers" version)) + (sha256 + (base32 + "0ll63d7202clapg1k4bilbnlmfa4qvpjnsd7chbkka4kxf5klilc")) + (patches + (search-patches "guile-fibers-wait-for-io-readiness.patch" + "guile-fibers-epoll-instance-is-dead.patch" + "guile-fibers-fd-finalizer-leak.patch")))) + (native-inputs + (list texinfo pkg-config autoconf automake libtool + guile-3.0 ;for 'guild compile + ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS' + gettext-minimal)) + (inputs + (list guile-3.0)) ;for libguile-3.0.so + (supported-systems + ;; This version requires 'epoll' and is thus limited to Linux-based + ;; systems, which is fixed in 1.2.0: + ;; . + (filter (cut string-suffix? "-linux" <>) %supported-systems)))) + (define-public guile-fibers-next (let ((commit "99fc3e38048f732de67c43fde52e949fa294aa7d") (revision "1")) diff --git a/gnu/packages/patches/guile-fibers-libevent-32-bit.patch b/gnu/packages/patches/guile-fibers-libevent-32-bit.patch new file mode 100644 index 0000000000..a1cc99fdbe --- /dev/null +++ b/gnu/packages/patches/guile-fibers-libevent-32-bit.patch @@ -0,0 +1,18 @@ +This fixes a bug with the libevent backend on 32-bit platforms: + + https://github.com/wingo/fibers/issues/86 + +diff --git a/extensions/libevent.c b/extensions/libevent.c +index 4f44de9..52c9d73 100644 +--- a/extensions/libevent.c ++++ b/extensions/libevent.c +@@ -215,7 +215,8 @@ run_event_loop (void *p) + microsec = -1; + else if (data->timeout >= 0) + { +- microsec = data->timeout / time_units_per_microsec; ++ microsec = (time_units_per_microsec == 0) ++ ? 0 : data->timeout / time_units_per_microsec; + tv.tv_sec = 0; + tv.tv_usec = microsec; + } -- cgit 1.4.1 From 6440b352c92e01aab1756e287a0271ccf0346dff Mon Sep 17 00:00:00 2001 From: Z572 <873216071@qq.com> Date: Fri, 26 May 2023 18:23:45 +0800 Subject: gnu: libtree: fix building on non-x86 systems. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/linux.scm (libtree): fix building on non-x86 systems. [source]: add patch. * gnu/packages/patches/libtree-fix-check-non-x86.patch: New file. * gnu/local.mk (dist_path_DATA): Register it. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + gnu/packages/linux.scm | 2 + .../patches/libtree-fix-check-non-x86.patch | 50 ++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 gnu/packages/patches/libtree-fix-check-non-x86.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index bc3cdbbaed..2b3df5d75a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1508,6 +1508,7 @@ dist_patch_DATA = \ %D%/packages/patches/libtommath-integer-overflow.patch \ %D%/packages/patches/libtool-grep-compat.patch \ %D%/packages/patches/libtool-skip-tests2.patch \ + %D%/packages/patches/libtree-fix-check-non-x86.patch \ %D%/packages/patches/libusb-0.1-disable-tests.patch \ %D%/packages/patches/libusb-for-axoloti.patch \ %D%/packages/patches/libutils-add-includes.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 6a6cbc118d..c81740a5a1 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -73,6 +73,7 @@ ;;; Copyright © 2022, 2023 Demis Balbach ;;; Copyright © 2023 Bruno Victal ;;; Copyright © 2023 Yovan Naumovski +;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -9822,6 +9823,7 @@ formats.") (url "https://github.com/haampie/libtree") (commit (string-append "v" version)))) (file-name (git-file-name name version)) + (patches (search-patches "libtree-fix-check-non-x86.patch")) (sha256 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb")))) (arguments diff --git a/gnu/packages/patches/libtree-fix-check-non-x86.patch b/gnu/packages/patches/libtree-fix-check-non-x86.patch new file mode 100644 index 0000000000..51f020c5d3 --- /dev/null +++ b/gnu/packages/patches/libtree-fix-check-non-x86.patch @@ -0,0 +1,50 @@ +From 061d3ec62707a526a83482e57d202a66f9d776cd Mon Sep 17 00:00:00 2001 +From: Ismael Luceno +Date: Tue, 23 Aug 2022 19:34:39 +0200 +Subject: [PATCH] Test the -m32 and -m64 compiler flags before use + +Fixes: https://github.com/haampie/libtree/issues/78 +Signed-off-by: Ismael Luceno +--- + tests/05_32_bits/Makefile | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/tests/05_32_bits/Makefile b/tests/05_32_bits/Makefile +index 2c0bece..5628f42 100644 +--- a/tests/05_32_bits/Makefile ++++ b/tests/05_32_bits/Makefile +@@ -3,7 +3,7 @@ + + LD_LIBRARY_PATH= + +-.PHONY: clean ++.PHONY: clean check + + all: check + +@@ -21,11 +21,21 @@ exe64: lib64/libx.so + exe32: lib32/libx.so + echo 'extern int a(); int _start(){return a();}' | $(CC) -m32 "-Wl,-rpath,$(CURDIR)/lib64" "-Wl,-rpath,$(CURDIR)/lib32" -o $@ -nostdlib -x c - -Llib32 -lx + +-check: exe32 exe64 +- ../../libtree exe32 +- ../../libtree exe64 +- + clean: + rm -rf lib32 lib64 exe* + + CURDIR ?= $(.CURDIR) ++ ++test-flag = 2>/dev/null ${CC} -E /dev/null ++test-end = && echo y || echo n ++support-m32 != ${test-flag} -m32 ${test-end} ++support-m64 != ${test-flag} -m64 ${test-end} ++ ++check${support-m32:y=}:: exe32 ++ ../../libtree exe32 ++ ++check${support-m64:y=}:: exe64 ++ ../../libtree exe64 ++ ++check${support-m32:n=} check${support-m64:n=}:: ++ @echo WARNING: test skipped at ${CURDIR} -- cgit 1.4.1 From 81441182bb5b61c6e5bc09b843f1fc1b9697523c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 20 Jun 2023 23:37:06 +0200 Subject: gnu: python-keras: Update to 2.3.1. * gnu/packages/patches/python-keras-integration-test.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. * gnu/packages/machine-learning.scm (python-keras): Update to 2.3.1. [source]: Remove patch; update snippet. [arguments]: Add build phase 'tf-compatibility; add phase 'hdf5-compatibility; rename phase 'remove-tests-for-unavailable-features to 'delete-unavailable-backends; update 'check phase to disable tests that cannot be repaired or are flaky. [native-inputs]: Add python-flaky, python-markdown, and python-pyux. --- gnu/local.mk | 1 - gnu/packages/machine-learning.scm | 105 +++++++++++++++++---- .../patches/python-keras-integration-test.patch | 19 ---- 3 files changed, 86 insertions(+), 39 deletions(-) delete mode 100644 gnu/packages/patches/python-keras-integration-test.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 2b3df5d75a..1b59cc522b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1802,7 +1802,6 @@ dist_patch_DATA = \ %D%/packages/patches/python-fixtures-remove-monkeypatch-test.patch \ %D%/packages/patches/python-hiredis-fix-header.patch \ %D%/packages/patches/python-hiredis-use-system-hiredis.patch \ - %D%/packages/patches/python-keras-integration-test.patch \ %D%/packages/patches/python-pdoc3-tests.patch \ %D%/packages/patches/python-peachpy-determinism.patch \ %D%/packages/patches/python-pep8-stdlib-tokenize-compat.patch \ diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 13651f4035..8fbb0274d4 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -3221,51 +3221,115 @@ with image data, text data, and sequence data.") (define-public python-keras (package (name "python-keras") - (version "2.2.4") + (version "2.3.1") (source (origin (method url-fetch) (uri (pypi-uri "Keras" version)) - (patches (search-patches "python-keras-integration-test.patch")) (sha256 (base32 - "1j8bsqzh49vjdxy6l1k4iwax5vpjzniynyd041xjavdzvfii1dlh")) + "1k68xd8n2y9ldijggjc8nn4d6d1axw0p98gfb0fmm8h641vl679j")) + (modules '((guix build utils))) (snippet - #~(begin (use-modules (guix build utils)) - (substitute* "keras/callbacks.py" - (("from collections import Iterable") - "from collections.abc import Iterable")))))) + '(substitute* '("keras/callbacks/callbacks.py" + "keras/engine/training_utils.py" + "keras/engine/training.py" + "keras/engine/training_generator.py" + "keras/utils/generic_utils.py") + (("from collections import Iterable") + "from collections.abc import Iterable") + (("collections.Container") + "collections.abc.Container") + (("collections.Mapping") + "collections.abc.Mapping") + (("collections.Sequence") + "collections.abc.Sequence"))))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'remove-tests-for-unavailable-features + (add-after 'unpack 'tf-compatibility + (lambda _ + (substitute* "keras/backend/tensorflow_backend.py" + (("^get_graph = .*") + "get_graph = tf.get_default_graph") + (("tf.compat.v1.nn.fused_batch_norm") + "tf.nn.fused_batch_norm") + ;; categorical_crossentropy does not support axis + (("from_logits=from_logits, axis=axis") + "from_logits=from_logits") + ;; dropout accepts a level number, not a named rate argument. + (("dropout\\(x, rate=level,") + "dropout(x, level,") + (("return x.shape.rank") + "return len(x.shape)")))) + (add-after 'unpack 'hdf5-compatibility + (lambda _ + ;; The truth value of an array with more than one element is ambiguous. + (substitute* "tests/keras/utils/io_utils_test.py" + ((" *assert .* == \\[b'(asd|efg).*") "")) + (substitute* "tests/test_model_saving.py" + (("h5py.File\\('does not matter',") + "h5py.File('does not matter', 'w',")) + (substitute* "keras/utils/io_utils.py" + (("h5py.File\\('in-memory-h5py', driver='core', backing_store=False\\)") + "h5py.File('in-memory-h5py', 'w', driver='core', backing_store=False)") + (("h5file.fid.get_file_image") + "h5file.id.get_file_image")) + (substitute* "keras/engine/saving.py" + (("\\.decode\\('utf-?8'\\)") "")))) + (add-after 'unpack 'delete-unavailable-backends (lambda _ (delete-file "keras/backend/theano_backend.py") - (delete-file "keras/backend/cntk_backend.py") - (delete-file "tests/keras/backend/backend_test.py") - ;; FIXME: This doesn't work because Tensorflow is missing the - ;; coder ops library. - (delete-file "tests/keras/test_callbacks.py"))) + (delete-file "keras/backend/cntk_backend.py"))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? ;; These tests attempt to download data files from the internet. (delete-file "tests/integration_tests/test_datasets.py") (delete-file "tests/integration_tests/imagenet_utils_test.py") - ;; Backport https://github.com/keras-team/keras/pull/12479. - (substitute* "tests/keras/engine/test_topology.py" - (("np.ones\\(\\(3, 2\\)\\)") - "1.")) (invoke "python" "-m" "pytest" "tests" "-p" "no:pep8" ;; FIXME: python-build-system lacks PARALLEL-TESTS? "-n" (number->string (parallel-job-count)) + ;; This one uses the theano backend that we don't have. + "--ignore=tests/test_api.py" + "--ignore=tests/keras/backend/backend_test.py" + ;; Our Tensorflow version does not have the coder ops library. + "--ignore=tests/keras/callbacks/callbacks_test.py" + ;; ...nor do we have tensorboard + "--ignore=tests/keras/callbacks/tensorboard_test.py" "-k" (string-append + ;; See https://github.com/keras-team/keras/pull/7033 + "not test_TimeDistributed_learning_phase " + ;; XXX fails because no closure is provided + "and not test_func_dump_and_load_backwards_compat " + ;; XXX real bug? These are all tests that fail due to + ;; shape mismatch, e.g. "got logits shape [12,3] and + ;; labels shape [9]" + "and not test_model_with_crossentropy_losses_channels_first " + "and not test_masking_correctness_output_size_not_equal_to_first_state_size " + "and not test_convolutional_recurrent " + "and not test_axis " + + ;; XXX fails because of 3/15 values have unexpected differences. + "and not test_masking_correctness_output_not_equal_to_first_state " + ;; XXX fails because of a difference of about 0.1 + "and not test_sample_weighted " + ;; XXX fails because of a difference of about 0.3 + "and not test_scalar_weighted " + ;; XXX fails because of a difference of about 0.2 + "and not test_unweighted " + + ;; XXX I cannot reproduce this in an interactive + ;; Python session, because l2_norm works just fine. + "and not test_weighted " ;TestCosineSimilarity + "and not test_config " ;TestCosineSimilarity + ;; The following test fails only in the build ;; container; skip it. - "not test_selu " + "and not test_selu " ;; The following test was found flaky and removed in ;; recent versions. "and not test_stateful_metrics")))))))) @@ -3281,12 +3345,15 @@ with image data, text data, and sequence data.") tensorflow graphviz)) (native-inputs - (list python-pandas + (list python-flaky + python-markdown + python-pandas python-pytest python-pytest-cov python-pytest-pep8 python-pytest-timeout python-pytest-xdist + python-pyux python-sphinx python-requests)) (home-page "https://github.com/keras-team/keras") diff --git a/gnu/packages/patches/python-keras-integration-test.patch b/gnu/packages/patches/python-keras-integration-test.patch deleted file mode 100644 index aa2b1a273d..0000000000 --- a/gnu/packages/patches/python-keras-integration-test.patch +++ /dev/null @@ -1,19 +0,0 @@ -Fix a test failure with recent versions of ... Pytest? Python? - -Taken from upstream: -https://github.com/keras-team/keras/commit/fe35050a8f18dc52304aa8da4e463eececa25240 - -diff --git a/tests/integration_tests/applications_test.py b/tests/integration_tests/applications_test.py -index 979f2f2abd6..6e3b57fa8e2 100644 ---- a/tests/integration_tests/applications_test.py -+++ b/tests/integration_tests/applications_test.py -@@ -58,7 +58,8 @@ def _test_application_basic(app, last_dim=1000): - def _test_application_notop(app, last_dim): - output_shape = _get_output_shape( - lambda: app(weights=None, include_top=False)) -- assert output_shape == (None, None, None, last_dim) -+ assert len(output_shape) == 4 -+ assert output_shape[-1] == last_dim - - - def test_mobilenet_v2_legacy_import(): -- cgit 1.4.1 From 22642d460488896ec1ddb25d7eb262938db810eb Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sat, 24 Jun 2023 00:17:52 +0200 Subject: gnu: igt-gpu-tools: Fix build with procps@4. * gnu/packages/patches/igt-gpu-tools-Use-libproc2.patch: New file. * gnu/packages/admin.scm (igt-gpu-tools)[source]: Use it. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/admin.scm | 4 +- .../patches/igt-gpu-tools-Use-libproc2.patch | 505 +++++++++++++++++++++ 3 files changed, 509 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/igt-gpu-tools-Use-libproc2.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 1b59cc522b..09a0741cc3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1374,6 +1374,7 @@ dist_patch_DATA = \ %D%/packages/patches/id3lib-CVE-2007-4460.patch \ %D%/packages/patches/id3lib-UTF16-writing-bug.patch \ %D%/packages/patches/idris-test-ffi008.patch \ + %D%/packages/patches/igt-gpu-tools-Use-libproc2.patch \ %D%/packages/patches/ilmbase-fix-tests.patch \ %D%/packages/patches/imagemagick-CVE-2020-27829.patch \ %D%/packages/patches/imagemagick-ReadDCMImage-fix.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 529a477ed0..a81a3f3414 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -3903,7 +3903,9 @@ buffers.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0d6jsj77qddccv0vfmqmbw3k2prvxzvmgc8zdi83gdi3wpp5i7zd")))) + (base32 "0d6jsj77qddccv0vfmqmbw3k2prvxzvmgc8zdi83gdi3wpp5i7zd")) + (patches + (search-patches "igt-gpu-tools-Use-libproc2.patch")))) (build-system meson-build-system) (arguments `(#:tests? #f ; many of the tests try to load kernel modules diff --git a/gnu/packages/patches/igt-gpu-tools-Use-libproc2.patch b/gnu/packages/patches/igt-gpu-tools-Use-libproc2.patch new file mode 100644 index 0000000000..131fea28fc --- /dev/null +++ b/gnu/packages/patches/igt-gpu-tools-Use-libproc2.patch @@ -0,0 +1,505 @@ +diff --git a/lib/igt_aux.c b/lib/igt_aux.c +index 672d7d4b0..4c24b0928 100644 +--- a/lib/igt_aux.c ++++ b/lib/igt_aux.c +@@ -52,8 +52,16 @@ + #include + #include + +-#include +-#include ++#ifdef HAVE_LIBPROCPS ++# include ++#else ++# include ++#endif ++ ++#include ++#ifdef __linux__ ++# include ++#endif + + #include "drmtest.h" + #include "i915_drm.h" +@@ -1217,6 +1225,7 @@ void igt_unlock_mem(void) + */ + int igt_is_process_running(const char *comm) + { ++#if HAVE_LIBPROCPS + PROCTAB *proc; + proc_t *proc_info; + bool found = false; +@@ -1235,6 +1244,26 @@ int igt_is_process_running(const char *comm) + + closeproc(proc); + return found; ++#else ++ enum pids_item Item[] = { PIDS_CMD }; ++ struct pids_info *info = NULL; ++ struct pids_stack *stack; ++ char *pid_comm; ++ bool found = false; ++ ++ if (procps_pids_new(&info, Item, 1) < 0) ++ return false; ++ while ((stack = procps_pids_get(info, PIDS_FETCH_TASKS_ONLY))) { ++ pid_comm = PIDS_VAL(0, str, stack, info); ++ if (!strncasecmp(pid_comm, comm, strlen(pid_comm))) { ++ found = true; ++ break; ++ } ++ } ++ ++ procps_pids_unref(&info); ++ return found; ++#endif + } + + /** +@@ -1251,6 +1280,7 @@ int igt_is_process_running(const char *comm) + */ + int igt_terminate_process(int sig, const char *comm) + { ++#if HAVE_LIBPROCPS + PROCTAB *proc; + proc_t *proc_info; + int err = 0; +@@ -1272,6 +1302,28 @@ int igt_terminate_process(int sig, const char *comm) + + closeproc(proc); + return err; ++#else ++ enum pids_item Items[] = { PIDS_ID_PID, PIDS_CMD }; ++ struct pids_info *info = NULL; ++ struct pids_stack *stack; ++ char *pid_comm; ++ int pid; ++ int err = 0; ++ ++ if (procps_pids_new(&info, Items, 2) < 0) ++ return -errno; ++ while ((stack = procps_pids_get(info, PIDS_FETCH_TASKS_ONLY))) { ++ pid = PIDS_VAL(0, s_int, stack, info); ++ pid_comm = PIDS_VAL(1, str, stack, info); ++ if (!strncasecmp(pid_comm, comm, strlen(pid_comm))) { ++ if (kill(pid, sig) < 0) ++ err = -errno; ++ break; ++ } ++ } ++ procps_pids_unref(&info); ++ return err; ++#endif + } + + struct pinfo { +@@ -1341,9 +1393,9 @@ igt_show_stat_header(void) + } + + static void +-igt_show_stat(proc_t *info, int *state, const char *fn) ++igt_show_stat(const pid_t tid, const char *cmd, int *state, const char *fn) + { +- struct pinfo p = { .pid = info->tid, .comm = info->cmd, .fn = fn }; ++ struct pinfo p = { .pid = tid, .comm = cmd, .fn = fn }; + + if (!*state) + igt_show_stat_header(); +@@ -1353,7 +1405,7 @@ igt_show_stat(proc_t *info, int *state, const char *fn) + } + + static void +-__igt_lsof_fds(proc_t *proc_info, int *state, char *proc_path, const char *dir) ++__igt_lsof_fds(const pid_t tid, const char *cmd, int *state, char *proc_path, const char *dir) + { + struct dirent *d; + struct stat st; +@@ -1400,7 +1452,7 @@ again: + dirn = dirname(copy_fd_lnk); + + if (!strncmp(dir, dirn, strlen(dir))) +- igt_show_stat(proc_info, state, fd_lnk); ++ igt_show_stat(tid, cmd, state, fd_lnk); + + free(copy_fd_lnk); + free(fd_lnk); +@@ -1416,13 +1468,13 @@ again: + static void + __igt_lsof(const char *dir) + { +- PROCTAB *proc; +- proc_t *proc_info; +- + char path[30]; + char *name_lnk; + struct stat st; + int state = 0; ++#ifdef HAVE_LIBPROCPS ++ PROCTAB *proc; ++ proc_t *proc_info; + + proc = openproc(PROC_FILLCOM | PROC_FILLSTAT | PROC_FILLARG); + igt_assert(proc != NULL); +@@ -1443,19 +1495,56 @@ __igt_lsof(const char *dir) + name_lnk[read] = '\0'; + + if (!strncmp(dir, name_lnk, strlen(dir))) +- igt_show_stat(proc_info, &state, name_lnk); ++ igt_show_stat(proc_info->tid, proc_info->cmd, &state, name_lnk); + + /* check also fd, seems that lsof(8) doesn't look here */ + memset(path, 0, sizeof(path)); + snprintf(path, sizeof(path), "/proc/%d/fd", proc_info->tid); + +- __igt_lsof_fds(proc_info, &state, path, dir); ++ __igt_lsof_fds(proc_info->tid, proc_info->cmd, &state, path, dir); + + free(name_lnk); + freeproc(proc_info); + } + + closeproc(proc); ++#else ++ enum pids_item Items[] = { PIDS_ID_PID, PIDS_CMD }; ++ struct pids_info *info = NULL; ++ struct pids_stack *stack; ++ ++ if (procps_pids_new(&info, Items, 2) < 0) ++ return; ++ while ((stack = procps_pids_get(info, PIDS_FETCH_TASKS_ONLY))) { ++ ssize_t read; ++ int tid = PIDS_VAL(0, s_int, stack, info); ++ char *pid_comm = PIDS_VAL(1, str, stack, info); ++ ++ /* check current working directory */ ++ memset(path, 0, sizeof(path)); ++ snprintf(path, sizeof(path), "/proc/%d/cwd", tid); ++ ++ if (stat(path, &st) == -1) ++ continue; ++ ++ name_lnk = malloc(st.st_size + 1); ++ ++ igt_assert((read = readlink(path, name_lnk, st.st_size + 1))); ++ name_lnk[read] = '\0'; ++ ++ if (!strncmp(dir, name_lnk, strlen(dir))) ++ igt_show_stat(tid, pid_comm, &state, name_lnk); ++ ++ /* check also fd, seems that lsof(8) doesn't look here */ ++ memset(path, 0, sizeof(path)); ++ snprintf(path, sizeof(path), "/proc/%d/fd", tid); ++ ++ __igt_lsof_fds(tid, pid_comm, &state, path, dir); ++ ++ free(name_lnk); ++ } ++ procps_pids_unref(&info); ++#endif + } + + /** +@@ -1490,7 +1579,7 @@ igt_lsof(const char *dpath) + free(sanitized); + } + +-static void pulseaudio_unload_module(proc_t *proc_info) ++static void pulseaudio_unload_module(const uid_t euid, const gid_t egid) + { + struct igt_helper_process pa_proc = {}; + char xdg_dir[PATH_MAX]; +@@ -1498,14 +1587,14 @@ static void pulseaudio_unload_module(proc_t *proc_info) + struct passwd *pw; + + igt_fork_helper(&pa_proc) { +- pw = getpwuid(proc_info->euid); ++ pw = getpwuid(euid); + homedir = pw->pw_dir; +- snprintf(xdg_dir, sizeof(xdg_dir), "/run/user/%d", proc_info->euid); ++ snprintf(xdg_dir, sizeof(xdg_dir), "/run/user/%d", euid); + + igt_info("Request pulseaudio to stop using audio device\n"); + +- setgid(proc_info->egid); +- setuid(proc_info->euid); ++ setgid(egid); ++ setuid(euid); + clearenv(); + setenv("HOME", homedir, 1); + setenv("XDG_RUNTIME_DIR",xdg_dir, 1); +@@ -1524,10 +1613,13 @@ static void pipewire_reserve_wait(void) + char xdg_dir[PATH_MAX]; + const char *homedir; + struct passwd *pw; +- proc_t *proc_info; +- PROCTAB *proc; ++ int tid = 0, euid, egid; + ++#ifdef HAVE_LIBPROCPS + igt_fork_helper(&pw_reserve_proc) { ++ proc_t *proc_info; ++ PROCTAB *proc; ++ + igt_info("Preventing pipewire-pulse to use the audio drivers\n"); + + proc = openproc(PROC_FILLCOM | PROC_FILLSTAT | PROC_FILLARG); +@@ -1540,19 +1632,45 @@ static void pipewire_reserve_wait(void) + } + closeproc(proc); + ++ tid = proc_info->tid; ++ euid = proc_info->euid; ++ egid = proc_info->egid; ++ freeproc(proc_info); ++#else ++ igt_fork_helper(&pw_reserve_proc) { ++ enum pids_item Items[] = { PIDS_ID_PID, PIDS_ID_EUID, PIDS_ID_EGID }; ++ enum rel_items { EU_PID, EU_EUID, EU_EGID }; ++ struct pids_info *info = NULL; ++ struct pids_stack *stack; ++ ++ igt_info("Preventing pipewire-pulse to use the audio drivers\n"); ++ ++ if (procps_pids_new(&info, Items, 3) < 0) { ++ igt_info("error getting pids: %d\n", errno); ++ exit(errno); ++ } ++ while ((stack = procps_pids_get(info, PIDS_FETCH_TASKS_ONLY))) { ++ tid = PIDS_VAL(EU_PID, s_int, stack, info); ++ if (pipewire_pulse_pid == tid) ++ break; ++ } ++ euid = PIDS_VAL(EU_EUID, s_int, stack, info); ++ egid = PIDS_VAL(EU_EGID, s_int, stack, info); ++ procps_pids_unref(&info); ++#endif ++ + /* Sanity check: if it can't find the process, it means it has gone */ +- if (pipewire_pulse_pid != proc_info->tid) ++ if (pipewire_pulse_pid != tid) + exit(0); + +- pw = getpwuid(proc_info->euid); ++ pw = getpwuid(euid); + homedir = pw->pw_dir; +- snprintf(xdg_dir, sizeof(xdg_dir), "/run/user/%d", proc_info->euid); +- setgid(proc_info->egid); +- setuid(proc_info->euid); ++ snprintf(xdg_dir, sizeof(xdg_dir), "/run/user/%d", euid); ++ setgid(egid); ++ setuid(euid); + clearenv(); + setenv("HOME", homedir, 1); + setenv("XDG_RUNTIME_DIR",xdg_dir, 1); +- freeproc(proc_info); + + /* + * pw-reserve will run in background. It will only exit when +@@ -1570,9 +1688,7 @@ static void pipewire_reserve_wait(void) + int pipewire_pulse_start_reserve(void) + { + bool is_pw_reserve_running = false; +- proc_t *proc_info; + int attempts = 0; +- PROCTAB *proc; + + if (!pipewire_pulse_pid) + return 0; +@@ -1584,6 +1700,10 @@ int pipewire_pulse_start_reserve(void) + * pipewire version 0.3.50 or upper. + */ + for (attempts = 0; attempts < PIPEWIRE_RESERVE_MAX_TIME; attempts++) { ++#ifdef HAVE_LIBPROCPS ++ PROCTAB *proc; ++ proc_t *proc_info; ++ + usleep(1000); + proc = openproc(PROC_FILLCOM | PROC_FILLSTAT | PROC_FILLARG); + igt_assert(proc != NULL); +@@ -1598,6 +1718,24 @@ int pipewire_pulse_start_reserve(void) + freeproc(proc_info); + } + closeproc(proc); ++#else ++ enum pids_item Items[] = { PIDS_ID_PID, PIDS_CMD }; ++ struct pids_info *info = NULL; ++ struct pids_stack *stack; ++ ++ usleep(1000); ++ ++ if (procps_pids_new(&info, Items, 2) < 0) ++ return 1; ++ while ((stack = procps_pids_get(info, PIDS_FETCH_TASKS_ONLY))) { ++ if (!strcmp(PIDS_VAL(1, str, stack, info), "pw-reserve")) { ++ is_pw_reserve_running = true; ++ pipewire_pw_reserve_pid = PIDS_VAL(0, s_int, stack, info); ++ break; ++ } ++ } ++ procps_pids_unref(&info); ++#endif + if (is_pw_reserve_running) + break; + } +@@ -1645,7 +1783,7 @@ void pipewire_pulse_stop_reserve(void) + * If the check fails, it means that the process can simply be killed. + */ + static int +-__igt_lsof_audio_and_kill_proc(proc_t *proc_info, char *proc_path) ++__igt_lsof_audio_and_kill_proc(const pid_t tid, const char *cmd, const uid_t euid, const gid_t egid, char *proc_path) + { + const char *audio_dev = "/dev/snd/"; + char path[PATH_MAX * 2]; +@@ -1670,10 +1808,10 @@ __igt_lsof_audio_and_kill_proc(proc_t *proc_info, char *proc_path) + * 2) unload/unbind the the audio driver(s); + * 3) stop the pw-reserve thread. + */ +- if (!strcmp(proc_info->cmd, "pipewire-pulse")) { ++ if (!strcmp(cmd, "pipewire-pulse")) { + igt_info("process %d (%s) is using audio device. Should be requested to stop using them.\n", +- proc_info->tid, proc_info->cmd); +- pipewire_pulse_pid = proc_info->tid; ++ tid, cmd); ++ pipewire_pulse_pid = tid; + return 0; + } + /* +@@ -1685,9 +1823,9 @@ __igt_lsof_audio_and_kill_proc(proc_t *proc_info, char *proc_path) + * will respawn them. So, just ignore here, they'll honor pw-reserve, + * when the time comes. + */ +- if (!strcmp(proc_info->cmd, "pipewire-media-session")) ++ if (!strcmp(cmd, "pipewire-media-session")) + return 0; +- if (!strcmp(proc_info->cmd, "wireplumber")) ++ if (!strcmp(cmd, "wireplumber")) + return 0; + + dp = opendir(proc_path); +@@ -1723,22 +1861,22 @@ __igt_lsof_audio_and_kill_proc(proc_t *proc_info, char *proc_path) + * enough to unbind audio modules and won't cause race issues + * with systemd trying to reload it. + */ +- if (!strcmp(proc_info->cmd, "pulseaudio")) { +- pulseaudio_unload_module(proc_info); ++ if (!strcmp(cmd, "pulseaudio")) { ++ pulseaudio_unload_module(euid, egid); + break; + } + + /* For all other processes, just kill them */ + igt_info("process %d (%s) is using audio device. Should be terminated.\n", +- proc_info->tid, proc_info->cmd); ++ tid, cmd); + +- if (kill(proc_info->tid, SIGTERM) < 0) { ++ if (kill(tid, SIGTERM) < 0) { + igt_info("Fail to terminate %s (pid: %d) with SIGTERM\n", +- proc_info->cmd, proc_info->tid); +- if (kill(proc_info->tid, SIGABRT) < 0) { ++ cmd, tid); ++ if (kill(tid, SIGABRT) < 0) { + fail++; + igt_info("Fail to terminate %s (pid: %d) with SIGABRT\n", +- proc_info->cmd, proc_info->tid); ++ cmd, tid); + } + } + +@@ -1760,23 +1898,47 @@ int + igt_lsof_kill_audio_processes(void) + { + char path[PATH_MAX]; ++ int fail = 0; ++ ++#ifdef HAVE_LIBPROCPS + proc_t *proc_info; + PROCTAB *proc; +- int fail = 0; + + proc = openproc(PROC_FILLCOM | PROC_FILLSTAT | PROC_FILLARG); + igt_assert(proc != NULL); + pipewire_pulse_pid = 0; +- + while ((proc_info = readproc(proc, NULL))) { + if (snprintf(path, sizeof(path), "/proc/%d/fd", proc_info->tid) < 1) + fail++; + else +- fail += __igt_lsof_audio_and_kill_proc(proc_info, path); ++ fail += __igt_lsof_audio_and_kill_proc(proc_info->tid, proc_info->cmd, proc_info->euid, proc_info->egid, path); + + freeproc(proc_info); + } + closeproc(proc); ++#else ++ enum pids_item Items[] = { PIDS_ID_PID, PIDS_CMD, PIDS_ID_EUID, PIDS_ID_EGID }; ++ enum rel_items { EU_PID, EU_CMD, EU_EUID, EU_EGID }; ++ struct pids_info *info = NULL; ++ struct pids_stack *stack; ++ pid_t tid; ++ ++ if (procps_pids_new(&info, Items, 4) < 0) ++ return 1; ++ while ((stack = procps_pids_get(info, PIDS_FETCH_TASKS_ONLY))) { ++ tid = PIDS_VAL(EU_PID, s_int, stack, info); ++ ++ if (snprintf(path, sizeof(path), "/proc/%d/fd", tid) < 1) ++ fail++; ++ else ++ fail += __igt_lsof_audio_and_kill_proc(tid, ++ PIDS_VAL(EU_CMD, str, stack, info), ++ PIDS_VAL(EU_EUID, s_int, stack, info), ++ PIDS_VAL(EU_EGID, s_int, stack, info), ++ path); ++ } ++ procps_pids_unref(&info); ++#endif + + return fail; + } +diff --git a/lib/meson.build b/lib/meson.build +index 85f100f75..55efdc83b 100644 +--- a/lib/meson.build ++++ b/lib/meson.build +@@ -114,7 +114,6 @@ lib_deps = [ + libdrm, + libdw, + libkmod, +- libprocps, + libudev, + math, + pciaccess, +@@ -178,6 +177,12 @@ if chamelium.found() + lib_sources += 'monitor_edids/monitor_edids_helper.c' + endif + ++if libprocps.found() ++ lib_deps += libprocps ++else ++ lib_deps += libproc2 ++endif ++ + if get_option('srcdir') != '' + srcdir = join_paths(get_option('srcdir'), 'tests') + else +diff --git a/meson.build b/meson.build +index 1c872cc9c..0487158dc 100644 +--- a/meson.build ++++ b/meson.build +@@ -125,7 +125,15 @@ build_info += 'With libdrm: ' + ','.join(libdrm_info) + + pciaccess = dependency('pciaccess', version : '>=0.10') + libkmod = dependency('libkmod') +-libprocps = dependency('libprocps', required : true) ++libprocps = dependency('libprocps', required : false) ++libproc2 = dependency('libproc2', required : false) ++if libprocps.found() ++ config.set('HAVE_LIBPROCPS', 1) ++elif libproc2.found() ++ config.set('HAVE_LIBPROC2', 1) ++else ++ error('Either libprocps or libproc2 is required') ++endif + + libunwind = dependency('libunwind', required : get_option('libunwind')) + build_info += 'With libunwind: @0@'.format(libunwind.found()) -- cgit 1.4.1 From bf2b18250cbee10d5a73fa7175054f2cafa40212 Mon Sep 17 00:00:00 2001 From: Olivier Dion Date: Thu, 15 Jun 2023 12:32:27 -0400 Subject: gnu: dyninst: Fix runtime error with new glibc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/dyninst-fix-glibc-compatibility.patch: New file. * gnu/packages/instrumentation.scm (dyninst)[source]: Use it. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + gnu/packages/instrumentation.scm | 5 +++- .../patches/dyninst-fix-glibc-compatibility.patch | 33 ++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/dyninst-fix-glibc-compatibility.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 09a0741cc3..4f557fbe93 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1073,6 +1073,7 @@ dist_patch_DATA = \ %D%/packages/patches/dune-istl-fix-solver-playground.patch \ %D%/packages/patches/dvd+rw-tools-add-include.patch \ %D%/packages/patches/dynaconf-unvendor-deps.patch \ + %D%/packages/patches/dyninst-fix-glibc-compatibility.patch \ %D%/packages/patches/efivar-211.patch \ %D%/packages/patches/eigen-fix-strict-aliasing-bug.patch \ %D%/packages/patches/einstein-build.patch \ diff --git a/gnu/packages/instrumentation.scm b/gnu/packages/instrumentation.scm index 5d862b5df1..263c2909f3 100644 --- a/gnu/packages/instrumentation.scm +++ b/gnu/packages/instrumentation.scm @@ -18,6 +18,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages instrumentation) + #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages bash) @@ -178,7 +179,9 @@ standard library headers.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1m04pg824rqx647wvk9xl33ri8i6mm0vmrz9924li25dxbr4zqd5")))) + (base32 "1m04pg824rqx647wvk9xl33ri8i6mm0vmrz9924li25dxbr4zqd5")) + (patches + (search-patches "dyninst-fix-glibc-compatibility.patch")))) (build-system cmake-build-system) (arguments diff --git a/gnu/packages/patches/dyninst-fix-glibc-compatibility.patch b/gnu/packages/patches/dyninst-fix-glibc-compatibility.patch new file mode 100644 index 0000000000..cd018da6cc --- /dev/null +++ b/gnu/packages/patches/dyninst-fix-glibc-compatibility.patch @@ -0,0 +1,33 @@ +From f233c46ac7b415104d04e4bb74bd7a0fcf24a333 Mon Sep 17 00:00:00 2001 +From: Olivier Dion +Date: Thu, 15 Jun 2023 12:02:08 -0400 +Subject: [PATCH] Fix compatibility with glibc 2.35 + +Something has change with the visibility of the _r_debug structure in +glibc 2.35. See this issue +. + +This patch is essentially the upstream fix + +backported. + +Signed-off-by: Olivier Dion +--- + dyninstAPI_RT/src/RTlinux.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/dyninstAPI_RT/src/RTlinux.c b/dyninstAPI_RT/src/RTlinux.c +index fc231d0a4..2f17ff677 100644 +--- a/dyninstAPI_RT/src/RTlinux.c ++++ b/dyninstAPI_RT/src/RTlinux.c +@@ -406,7 +406,6 @@ void dyninstTrapHandler(int sig, siginfo_t *sg, ucontext_t *context) + #if defined(cap_binary_rewriter) + + extern struct r_debug _r_debug; +-DLLEXPORT struct r_debug _r_debug __attribute__ ((weak)); + + /* Verify that the r_debug variable is visible */ + void r_debugCheck() { assert(_r_debug.r_map); } +-- +2.40.1 + -- cgit 1.4.1 From 64e5e17d8c3e32a5735c6a616afc18bbcc2729fb Mon Sep 17 00:00:00 2001 From: Vinicius Monego Date: Sat, 20 May 2023 15:03:32 -0300 Subject: gnu: Add python-vega-datasets. * gnu/packages/statistics.scm (python-vega-datasets): New variable. * gnu/packages/patches/python-vega-datasets-remove-la-riots-code.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + ...python-vega-datasets-remove-la-riots-code.patch | 89 ++++++++++++++++++++++ gnu/packages/statistics.scm | 29 +++++++ 3 files changed, 119 insertions(+) create mode 100644 gnu/packages/patches/python-vega-datasets-remove-la-riots-code.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 4f557fbe93..4566f1b4a4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1834,6 +1834,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-typing-inspect-fix.patch \ %D%/packages/patches/python-unittest2-python3-compat.patch \ %D%/packages/patches/python-unittest2-remove-argparse.patch \ + %D%/packages/patches/python-vega-datasets-remove-la-riots-code.patch \ %D%/packages/patches/python-versioneer-guix-support.patch \ %D%/packages/patches/python-waitress-fix-tests.patch \ %D%/packages/patches/python-werkzeug-tests.patch \ diff --git a/gnu/packages/patches/python-vega-datasets-remove-la-riots-code.patch b/gnu/packages/patches/python-vega-datasets-remove-la-riots-code.patch new file mode 100644 index 0000000000..ea3f68927a --- /dev/null +++ b/gnu/packages/patches/python-vega-datasets-remove-la-riots-code.patch @@ -0,0 +1,89 @@ +# This patch was imported from Debian: +# https://sources.debian.org/src/python-vega-datasets/0.9%2Bdfsg-1/debian/patches/remove-la-riots-related-code.patch/ +# According to the Debian package, the license of this dataset is not clear and it is not available from Los Angeles Times for European users. +Index: vega_datasets/vega_datasets/tests/test_local_datasets.py +=================================================================== +--- vega_datasets.orig/vega_datasets/tests/test_local_datasets.py ++++ vega_datasets/vega_datasets/tests/test_local_datasets.py +@@ -75,7 +75,6 @@ def test_cars_column_names(): + [ + ("cars", "Year"), + ("stocks", "date"), +- ("la-riots", "death_date"), + ("iowa-electricity", "year"), + ("seattle-weather", "date"), + ("seattle-temps", "date"), +Index: vega_datasets/vega_datasets/core.py +=================================================================== +--- vega_datasets.orig/vega_datasets/core.py ++++ vega_datasets/vega_datasets/core.py +@@ -322,11 +322,6 @@ class IowaElectricity(Dataset): + _pd_read_kwds = {"parse_dates": ["year"]} + + +-class LARiots(Dataset): +- name = "la-riots" +- _pd_read_kwds = {"parse_dates": ["death_date"]} +- +- + class Miserables(Dataset): + name = "miserables" + _return_type = tuple +Index: vega_datasets/vega_datasets/datasets.json +=================================================================== +--- vega_datasets.orig/vega_datasets/datasets.json ++++ vega_datasets/vega_datasets/datasets.json +@@ -143,10 +143,6 @@ + "filename": "jobs.json", + "format": "json" + }, +- "la-riots": { +- "filename": "la-riots.csv", +- "format": "csv" +- }, + "londonBoroughs": { + "filename": "londonBoroughs.json", + "format": "json" +@@ -279,4 +275,4 @@ + "filename": "zipcodes.csv", + "format": "csv" + } +-} +\ No newline at end of file ++} +Index: vega_datasets/vega_datasets/local_datasets.json +=================================================================== +--- vega_datasets.orig/vega_datasets/local_datasets.json ++++ vega_datasets/vega_datasets/local_datasets.json +@@ -8,7 +8,6 @@ + "driving": "_data/driving.json", + "iowa-electricity": "_data/iowa-electricity.csv", + "iris": "_data/iris.json", +- "la-riots": "_data/la-riots.csv", + "ohlc": "_data/ohlc.json", + "seattle-temps": "_data/seattle-temps.csv", + "seattle-weather": "_data/seattle-weather.csv", +@@ -16,4 +15,4 @@ + "stocks": "_data/stocks.csv", + "us-employment": "_data/us-employment.csv", + "wheat": "_data/wheat.json" +-} +\ No newline at end of file ++} +Index: vega_datasets/vega_datasets/dataset_info.json +=================================================================== +--- vega_datasets.orig/vega_datasets/dataset_info.json ++++ vega_datasets/vega_datasets/dataset_info.json +@@ -49,12 +49,6 @@ + "R. A. Fisher (1936). 'The use of multiple measurements in taxonomic problems'. Annals of Eugenics. 7 (2): 179-188." + ] + }, +- "la-riots" : { +- "description" : "More than 60 people lost their lives amid the looting and fires that ravaged Los Angeles for five days starting on April 29, 1992. This dataset contains metadata about each person, including the geographic coordinates of their death. It was compiled and published by the Los Angeles Times Data Desk [1]_.", +- "references" : [ +- "http://spreadsheets.latimes.com/la-riots-deaths/" +- ] +- }, + "ohlc" : { + "description" : "This dataset contains the performance of the Chicago Board Options Exchange `Volatility Index `_ in the summer of 2009." + }, diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index e025653338..449f1aaf66 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -2026,6 +2026,35 @@ and fast file reading.") "This package provides tools to export R data as LaTeX and HTML tables.") (license license:gpl2+))) +(define-public python-vega-datasets + (package + (name "python-vega-datasets") + (version "0.9.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "vega_datasets" version)) + (sha256 + (base32 "1h1zv607mars2j73v8fdwihjh479blqxyw29nhmc73lf40s9iglx")) + (modules '((guix build utils))) + (patches + (search-patches "python-vega-datasets-remove-la-riots-code.patch")))) + (build-system pyproject-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'remove-la-riots-dataset + ;; Remove dataset with unclear license. + (lambda _ + (delete-file "vega_datasets/_data/la-riots.csv")))))) + (native-inputs (list python-pytest)) + (propagated-inputs (list python-pandas)) + (home-page "https://github.com/altair-viz/vega_datasets") + (synopsis "Example datasets used by Vega-related projects") + (description "This package provides a collection of datasets used in Vega +and Vega-Lite examples.") + (license license:expat))) + (define-public python-hdmedians (package (name "python-hdmedians") -- cgit 1.4.1 From 1bc878ded2ea349384da6a72d4b8326c63c794b4 Mon Sep 17 00:00:00 2001 From: Janneke Nieuwenhuizen Date: Mon, 26 Jun 2023 13:25:06 +0200 Subject: gnu: dezyne: Update to 2.17.3. * gnu/packages/patches/dezyne-add-missing-shebangs.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. * gnu/packages/dezyne.scm (dezyne): Update to 2.17.3. [source]: Remove patch, update hash. --- gnu/local.mk | 1 - gnu/packages/dezyne.scm | 5 +- .../patches/dezyne-add-missing-shebangs.patch | 61 ---------------------- 3 files changed, 2 insertions(+), 65 deletions(-) delete mode 100644 gnu/packages/patches/dezyne-add-missing-shebangs.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 4566f1b4a4..e65888a044 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1055,7 +1055,6 @@ dist_patch_DATA = \ %D%/packages/patches/dee-vapi.patch \ %D%/packages/patches/desmume-gcc6-fixes.patch \ %D%/packages/patches/desmume-gcc7-fixes.patch \ - %D%/packages/patches/dezyne-add-missing-shebangs.patch \ %D%/packages/patches/dfu-programmer-fix-libusb.patch \ %D%/packages/patches/diffutils-fix-signal-processing.patch \ %D%/packages/patches/directfb-davinci-glibc-228-compat.patch \ diff --git a/gnu/packages/dezyne.scm b/gnu/packages/dezyne.scm index c13374069f..ef2130a940 100644 --- a/gnu/packages/dezyne.scm +++ b/gnu/packages/dezyne.scm @@ -32,15 +32,14 @@ (define-public dezyne (package (name "dezyne") - (version "2.17.2") + (version "2.17.3") (source (origin (method url-fetch) (uri (string-append "https://dezyne.org/download/dezyne/" name "-" version ".tar.gz")) - (patches (search-patches "dezyne-add-missing-shebangs.patch")) (sha256 - (base32 "1v0anwr0iic26ck796b29dfyj1dxkjf935g134z98s95hvzzrhm3")))) + (base32 "0x2aqfvbxhiwxj6vm17g7dkxwj8skcs9pg3a3l1x9pxy7v22wxd7")))) (inputs (list bash-minimal guile-3.0-latest guile-json-4 diff --git a/gnu/packages/patches/dezyne-add-missing-shebangs.patch b/gnu/packages/patches/dezyne-add-missing-shebangs.patch deleted file mode 100644 index bf88e95c8a..0000000000 --- a/gnu/packages/patches/dezyne-add-missing-shebangs.patch +++ /dev/null @@ -1,61 +0,0 @@ -Upstream status: Taken from upstream development. - -From aace425e41247c1dd6b16eb7eabce50be7310d15 Mon Sep 17 00:00:00 2001 -From: Janneke Nieuwenhuizen -Date: Mon, 24 Apr 2023 16:58:32 +0200 -Subject: [PATCH] DRAFT test: Add missing shebangs to run scripts. - -This fixes `make check' on current ci.guix.gnu.org. - -* test/all/parse_import_order/run, -test/all/parse_locations/run, -test/all/parse_peg_locations/run: Add #! /bin/sh. ---- - test/all/parse_import_order/run | 3 ++- - test/all/parse_locations/run | 3 ++- - test/all/parse_peg_locations/run | 3 ++- - 3 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/test/all/parse_import_order/run b/test/all/parse_import_order/run -index 6e231de4f9..c383e4f223 100755 ---- a/test/all/parse_import_order/run -+++ b/test/all/parse_import_order/run -@@ -1,6 +1,7 @@ -+#! /bin/sh - # Dezyne --- Dezyne command line tools - # --# Copyright © 2022 Jan (janneke) Nieuwenhuizen -+# Copyright © 2022, 2023 Jan (janneke) Nieuwenhuizen - # - # This file is part of Dezyne. - # -diff --git a/test/all/parse_locations/run b/test/all/parse_locations/run -index 0b092b26dd..6c48ee1392 100755 ---- a/test/all/parse_locations/run -+++ b/test/all/parse_locations/run -@@ -1,7 +1,8 @@ -+#! /bin/sh - # Dezyne --- Dezyne command line tools - # - # Copyright © 2021 Paul Hoogendijk --# Copyright © 2020, 2021 Jan (janneke) Nieuwenhuizen -+# Copyright © 2020, 2021, 2023 Jan (janneke) Nieuwenhuizen - # - # This file is part of Dezyne. - # -diff --git a/test/all/parse_peg_locations/run b/test/all/parse_peg_locations/run -index 5b5ced0bb4..5206a23db6 100755 ---- a/test/all/parse_peg_locations/run -+++ b/test/all/parse_peg_locations/run -@@ -1,6 +1,7 @@ -+#! /bin/sh - # Dezyne --- Dezyne command line tools - # --# Copyright © 2020 Jan (janneke) Nieuwenhuizen -+# Copyright © 2020, 2023 Jan (janneke) Nieuwenhuizen - # - # This file is part of Dezyne. - # --- -2.39.2 - -- cgit 1.4.1 From 08649cfcd41bc78ba4df0609798461816dda9496 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Mon, 3 Jul 2023 03:07:18 +0200 Subject: gnu: jbr: Make big cursors work. * gnu/packages/patches/jbr-17-xcursor-no-dynamic.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/java.scm (jbr17)[source]<#:patches>: Add it. --- gnu/local.mk | 1 + gnu/packages/java.scm | 3 +- .../patches/jbr-17-xcursor-no-dynamic.patch | 72 ++++++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/jbr-17-xcursor-no-dynamic.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index e65888a044..00fe7a036c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1410,6 +1410,7 @@ dist_patch_DATA = \ %D%/packages/patches/java-xerces-bootclasspath.patch \ %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/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 8f7dc19c12..5a6288581e 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1551,7 +1551,8 @@ blacklisted.certs.pem" (file-name (string-append name "-" version "-checkout")) (sha256 (base32 - "0wh9xhqgcjk0jgvpvlvf78dy3r8m0vgqd0f54whpx0qqbmyavgdw")))) + "0wh9xhqgcjk0jgvpvlvf78dy3r8m0vgqd0f54whpx0qqbmyavgdw")) + (patches (search-patches "jbr-17-xcursor-no-dynamic.patch")))) (synopsis "JetBrains Java Runtime") (description "This package provides a Java runtime environment for and Java development kit. It supports enhanced class redefinition (DCEVM), diff --git a/gnu/packages/patches/jbr-17-xcursor-no-dynamic.patch b/gnu/packages/patches/jbr-17-xcursor-no-dynamic.patch new file mode 100644 index 0000000000..371cbfe202 --- /dev/null +++ b/gnu/packages/patches/jbr-17-xcursor-no-dynamic.patch @@ -0,0 +1,72 @@ +From: Danny Milosavljevic +Date: Thu, 31 Mar 2022 17:02:00 +0200 +Subject: Make openjdk use libxcursor directly + +Fixes . + +This patch makes openjdk use libxcursor directly. +Without it, libx11 would try to dlopen("libXcursor.so.1") and fail. + +diff -ru orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/make/modules/java.desktop/lib/Awt2dLibraries.gmk 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/make/modules/java.desktop/lib/Awt2dLibraries.gmk +--- orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/make/modules/java.desktop/lib/Awt2dLibraries.gmk 2022-03-31 15:34:08.773419480 +0200 ++++ 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/make/modules/java.desktop/lib/Awt2dLibraries.gmk 2022-03-31 21:36:27.854273411 +0200 +@@ -217,7 +217,7 @@ + endif + endif + +- LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(SPEECHD_LIBS) $(LIBDL) -lXtst -lXi -ljava -ljvm ++ LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXcursor -lXrender $(SPEECHD_LIBS) $(LIBDL) -lXtst -lXi -ljava -ljvm + + ifeq ($(call isTargetOs, linux), true) + LIBAWT_XAWT_LIBS += -lpthread +diff -ru orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c +--- orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c 2022-03-31 15:34:11.917502206 +0200 ++++ 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c 2022-03-31 21:38:16.417253535 +0200 +@@ -40,10 +40,12 @@ + #include + #include + #include ++#include + #include + #include + #include + #include ++#include + + #if defined(AIX) + #undef X_HAVE_UTF8_STRING +@@ -972,10 +974,21 @@ + + } + ++static XColor _Xconst foreground = { 0, 0, 0, 0 }; /* black */ ++static XColor _Xconst background = { 0, 65535, 65535, 65535 }; /* white */ ++ + JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XCreateFontCursor + (JNIEnv *env, jclass clazz, jlong display, jint shape) { + AWT_CHECK_HAVE_LOCK_RETURN(0); +- return XCreateFontCursor((Display *) jlong_to_ptr(display), (int) shape); ++ Display * dpy = (Display *) jlong_to_ptr(display); ++ if (dpy->cursor_font == None) { ++ dpy->cursor_font = XLoadFont(dpy, "cursor"); ++ if (dpy->cursor_font == None) return None; ++ } ++ Cursor result = XcursorTryShapeCursor(dpy, dpy->cursor_font, dpy->cursor_font, (int) shape, (int) shape + 1, &foreground, &background); ++ if (!result) ++ result = XCreateFontCursor(dpy, (int) shape); ++ return result; + } + + /* +diff -ru orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/test/jdk/java/awt/JAWT/Makefile.unix 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/test/jdk/java/awt/JAWT/Makefile.unix +--- orig/22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/test/jdk/java/awt/JAWT/Makefile.unix 2022-03-31 15:34:10.553466316 +0200 ++++ 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/test/jdk/java/awt/JAWT/Makefile.unix 2022-03-31 21:36:27.854273411 +0200 +@@ -31,7 +31,7 @@ + + J_INC = $(TESTJAVA)/include + INCLUDES = -I$(J_INC) -I$(J_INC)/$(SYST) -I. +-LIBS = -L$(TESTJAVA)/lib -ljawt -lX11 ++LIBS = -L$(TESTJAVA)/lib -ljawt -lX11 -lXcursor + + all: $(CLASSES) libmylib.so + -- cgit 1.4.1 From 1011100868ec6d712145c75c016b18ba5913c7c7 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 3 Jul 2023 14:34:41 +0300 Subject: gnu: local: Register missing patch. * gnu/local.mk (dist_patch_DATA): Register missing patch. --- 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 00fe7a036c..6470f1abd4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2072,6 +2072,7 @@ dist_patch_DATA = \ %D%/packages/patches/wordnet-CVE-2008-2149.patch \ %D%/packages/patches/wordnet-CVE-2008-3908-pt1.patch \ %D%/packages/patches/wordnet-CVE-2008-3908-pt2.patch \ + %D%/packages/patches/wpa-supplicant-dbus-group-policy.patch \ %D%/packages/patches/x265-arm-flags.patch \ %D%/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch\ %D%/packages/patches/xf86-video-ark-remove-mibstore.patch \ -- cgit 1.4.1 From 55476119dd2aeb8fc6427098d928a1c9db451ff7 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 2 Jul 2023 02:00:02 +0200 Subject: gnu: git: Update to 2.41.0. * gnu/packages/version-control.scm (git): Update to 2.41.0. [source]: Remove upstreamed patch. * gnu/packages/patches/git-header-cmd.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/patches/git-header-cmd.patch | 287 ------------------------------ gnu/packages/version-control.scm | 7 +- 3 files changed, 3 insertions(+), 292 deletions(-) delete mode 100644 gnu/packages/patches/git-header-cmd.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 6470f1abd4..fa6f76e790 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1225,7 +1225,6 @@ dist_patch_DATA = \ %D%/packages/patches/genimage-mke2fs-test.patch \ %D%/packages/patches/geoclue-config.patch \ %D%/packages/patches/gettext-libunicode-update.patch \ - %D%/packages/patches/git-header-cmd.patch \ %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \ %D%/packages/patches/ghc-9.2-glibc-2.33-link-order.patch \ %D%/packages/patches/ghc-9.2-grep-warnings.patch \ diff --git a/gnu/packages/patches/git-header-cmd.patch b/gnu/packages/patches/git-header-cmd.patch deleted file mode 100644 index a8964ab174..0000000000 --- a/gnu/packages/patches/git-header-cmd.patch +++ /dev/null @@ -1,287 +0,0 @@ -Add a '--header-cmd' to git send-email. - -Upstream status can be tracked at: -https://lore.kernel.org/git/20230423122744.4865-1-maxim.cournoyer@gmail.com/T/#t - -diff --git a/Documentation/config/sendemail.txt b/Documentation/config/sendemail.txt -index 51da7088a8..92a9ebe98c 100644 ---- a/Documentation/config/sendemail.txt -+++ b/Documentation/config/sendemail.txt -@@ -61,6 +61,7 @@ sendemail.ccCmd:: - sendemail.chainReplyTo:: - sendemail.envelopeSender:: - sendemail.from:: -+sendemail.headerCmd:: - sendemail.signedoffbycc:: - sendemail.smtpPass:: - sendemail.suppresscc:: -diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt -index b0f438ec99..4d2ae061f9 100644 ---- a/Documentation/git-send-email.txt -+++ b/Documentation/git-send-email.txt -@@ -320,6 +320,17 @@ Automating - Output of this command must be single email address per line. - Default is the value of `sendemail.ccCmd` configuration value. - -+--header-cmd=:: -+ Specify a command that is executed once per outgoing message -+ and output RFC 2822 style header lines to be inserted into -+ them. When the `sendemail.headerCmd` configuration variable is -+ set, its value is always used. When --header-cmd is provided -+ at the command line, its value takes precedence over the -+ `sendemail.headerCmd` configuration variable. -+ -+--no-header-cmd:: -+ Disable any header command in use. -+ - --[no-]chain-reply-to:: - If this is set, each email will be sent as a reply to the previous - email sent. If disabled with "--no-chain-reply-to", all emails after -diff --git a/git-send-email.perl b/git-send-email.perl -index 66c9171109..22a64e608f 100755 ---- a/git-send-email.perl -+++ b/git-send-email.perl -@@ -87,8 +87,10 @@ sub usage { - - Automating: - --identity * Use the sendemail. options. -- --to-cmd * Email To: via ` \$patch_path` -- --cc-cmd * Email Cc: via ` \$patch_path` -+ --to-cmd * Email To: via ` \$patch_path`. -+ --cc-cmd * Email Cc: via ` \$patch_path`. -+ --header-cmd * Add headers via ` \$patch_path`. -+ --no-header-cmd * Disable any header command in use. - --suppress-cc * author, self, sob, cc, cccmd, body, bodycc, misc-by, all. - --[no-]cc-cover * Email Cc: addresses in the cover letter. - --[no-]to-cover * Email To: addresses in the cover letter. -@@ -202,7 +204,7 @@ sub format_2822_time { - $author,$sender,$smtp_authpass,$annotate,$compose,$time); - # Things we either get from config, *or* are overridden on the - # command-line. --my ($no_cc, $no_to, $no_bcc, $no_identity); -+my ($no_cc, $no_to, $no_bcc, $no_identity, $no_header_cmd); - my (@config_to, @getopt_to); - my (@config_cc, @getopt_cc); - my (@config_bcc, @getopt_bcc); -@@ -269,7 +271,7 @@ sub do_edit { - # Variables with corresponding config settings - my ($suppress_from, $signed_off_by_cc); - my ($cover_cc, $cover_to); --my ($to_cmd, $cc_cmd); -+my ($to_cmd, $cc_cmd, $header_cmd); - my ($smtp_server, $smtp_server_port, @smtp_server_options); - my ($smtp_authuser, $smtp_encryption, $smtp_ssl_cert_path); - my ($batch_size, $relogin_delay); -@@ -318,6 +320,7 @@ sub do_edit { - "tocmd" => \$to_cmd, - "cc" => \@config_cc, - "cccmd" => \$cc_cmd, -+ "headercmd" => \$header_cmd, - "aliasfiletype" => \$aliasfiletype, - "bcc" => \@config_bcc, - "suppresscc" => \@suppress_cc, -@@ -519,6 +522,8 @@ sub config_regexp { - "compose" => \$compose, - "quiet" => \$quiet, - "cc-cmd=s" => \$cc_cmd, -+ "header-cmd=s" => \$header_cmd, -+ "no-header-cmd" => \$no_header_cmd, - "suppress-from!" => \$suppress_from, - "no-suppress-from" => sub {$suppress_from = 0}, - "suppress-cc=s" => \@suppress_cc, -@@ -1780,16 +1785,16 @@ sub process_file { - $subject = $initial_subject; - $message = ""; - $message_num++; -- # First unfold multiline header fields -+ # Retrieve and unfold header fields. -+ my @header_lines = (); - while(<$fh>) { - last if /^\s*$/; -- if (/^\s+\S/ and @header) { -- chomp($header[$#header]); -- s/^\s+/ /; -- $header[$#header] .= $_; -- } else { -- push(@header, $_); -- } -+ push(@header_lines, $_); -+ } -+ @header = unfold_headers(@header_lines); -+ # Add computed headers, if applicable. -+ unless ($no_header_cmd || ! $header_cmd) { -+ push @header, invoke_header_cmd($header_cmd, $t); - } - # Now parse the header - foreach(@header) { -@@ -2021,15 +2026,63 @@ sub process_file { - } - } - -+# Execute a command and return its output lines as an array. Blank -+# lines which do not appear at the end of the output are reported as -+# errors. -+sub execute_cmd { -+ my ($prefix, $cmd, $file) = @_; -+ my @lines = (); -+ my $seen_blank_line = 0; -+ open my $fh, "-|", "$cmd \Q$file\E" -+ or die sprintf(__("(%s) Could not execute '%s'"), $prefix, $cmd); -+ while (my $line = <$fh>) { -+ die sprintf(__("(%s) Malformed output from '%s'"), $prefix, $cmd) -+ if $seen_blank_line; -+ if ($line =~ /^$/) { -+ $seen_blank_line = $line =~ /^$/; -+ next; -+ } -+ push @lines, $line; -+ } -+ close $fh -+ or die sprintf(__("(%s) failed to close pipe to '%s'"), $prefix, $cmd); -+ return @lines; -+} -+ -+# Process headers lines, unfolding multiline headers as defined by RFC -+# 2822. -+sub unfold_headers { -+ my @headers; -+ foreach(@_) { -+ last if /^\s*$/; -+ if (/^\s+\S/ and @headers) { -+ chomp($headers[$#headers]); -+ s/^\s+/ /; -+ $headers[$#headers] .= $_; -+ } else { -+ push(@headers, $_); -+ } -+ } -+ return @headers; -+} -+ -+# Invoke the provided CMD with FILE as an argument, which should -+# output RFC 2822 email headers. Fold multiline headers and return the -+# headers as an array. -+sub invoke_header_cmd { -+ my ($cmd, $file) = @_; -+ my @lines = execute_cmd("header-cmd", $header_cmd, $file); -+ return unfold_headers(@lines); -+} -+ - # Execute a command (e.g. $to_cmd) to get a list of email addresses - # and return a results array - sub recipients_cmd { - my ($prefix, $what, $cmd, $file) = @_; -- -+ my @lines = (); - my @addresses = (); -- open my $fh, "-|", "$cmd \Q$file\E" -- or die sprintf(__("(%s) Could not execute '%s'"), $prefix, $cmd); -- while (my $address = <$fh>) { -+ @lines = execute_cmd($prefix, $cmd, $file); -+ for my $address (@lines) { - $address =~ s/^\s*//g; - $address =~ s/\s*$//g; - $address = sanitize_address($address); -@@ -2038,8 +2091,6 @@ sub recipients_cmd { - printf(__("(%s) Adding %s: %s from: '%s'\n"), - $prefix, $what, $address, $cmd) unless $quiet; - } -- close $fh -- or die sprintf(__("(%s) failed to close pipe to '%s'"), $prefix, $cmd); - return @addresses; - } - -diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh -index 6520346246..6519eea1ed 100755 ---- a/t/t9001-send-email.sh -+++ b/t/t9001-send-email.sh -@@ -374,13 +374,16 @@ test_expect_success $PREREQ,!AUTOIDENT 'broken implicit ident aborts send-email' - ) - ' - --test_expect_success $PREREQ 'setup tocmd and cccmd scripts' ' -+test_expect_success $PREREQ 'setup cmd scripts' ' - write_script tocmd-sed <<-\EOF && - sed -n -e "s/^tocmd--//p" "$1" - EOF -- write_script cccmd-sed <<-\EOF -+ write_script cccmd-sed <<-\EOF && - sed -n -e "s/^cccmd--//p" "$1" - EOF -+ write_script headercmd-sed <<-\EOF -+ sed -n -e "s/^headercmd--//p" "$1" -+ EOF - ' - - test_expect_success $PREREQ 'tocmd works' ' -@@ -410,6 +413,70 @@ test_expect_success $PREREQ 'cccmd works' ' - grep "^ cccmd@example.com" msgtxt1 - ' - -+test_expect_success $PREREQ 'headercmd works' ' -+ clean_fake_sendmail && -+ cp $patches headercmd.patch && -+ echo "headercmd--X-Debbugs-CC: dummy@example.com" >>headercmd.patch && -+ git send-email \ -+ --from="Example " \ -+ --to=nobody@example.com \ -+ --header-cmd=./headercmd-sed \ -+ --smtp-server="$(pwd)/fake.sendmail" \ -+ headercmd.patch \ -+ && -+ grep "^X-Debbugs-CC: dummy@example.com" msgtxt1 -+' -+ -+test_expect_success $PREREQ '--no-header-cmd works' ' -+ clean_fake_sendmail && -+ cp $patches headercmd.patch && -+ echo "headercmd--X-Debbugs-CC: dummy@example.com" >>headercmd.patch && -+ git send-email \ -+ --from="Example " \ -+ --to=nobody@example.com \ -+ --header-cmd=./headercmd-sed \ -+ --no-header-cmd \ -+ --smtp-server="$(pwd)/fake.sendmail" \ -+ headercmd.patch \ -+ && -+ ! grep "^X-Debbugs-CC: dummy@example.com" msgtxt1 -+' -+ -+test_expect_success $PREREQ 'multiline fields are correctly unfolded' ' -+ clean_fake_sendmail && -+ cp $patches headercmd.patch && -+ write_script headercmd-multiline <<-\EOF && -+ echo "X-Debbugs-CC: someone@example.com -+FoldedField: This is a tale -+ best told using -+ multiple lines." -+ EOF -+ git send-email \ -+ --from="Example " \ -+ --to=nobody@example.com \ -+ --header-cmd=./headercmd-multiline \ -+ --smtp-server="$(pwd)/fake.sendmail" \ -+ headercmd.patch && -+ grep "^FoldedField: This is a tale best told using multiple lines.$" msgtxt1 -+' -+ -+# Blank lines in the middle of the output of a command are invalid. -+test_expect_success $PREREQ 'malform output reported on blank lines in command output' ' -+ clean_fake_sendmail && -+ cp $patches headercmd.patch && -+ write_script headercmd-malformed-output <<-\EOF && -+ echo "X-Debbugs-CC: someone@example.com -+ -+SomeOtherField: someone-else@example.com" -+ EOF -+ ! git send-email \ -+ --from="Example " \ -+ --to=nobody@example.com \ -+ --header-cmd=./headercmd-malformed-output \ -+ --smtp-server="$(pwd)/fake.sendmail" \ -+ headercmd.patch -+' -+ - test_expect_success $PREREQ 'reject long lines' ' - z8=zzzzzzzz && - z64=$z8$z8$z8$z8$z8$z8$z8$z8 && diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 40b9e124d2..468a83fe4a 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -227,15 +227,14 @@ Python 3.3 and later, rather than on Python 2.") (define-public git (package (name "git") - (version "2.40.1") + (version "2.41.0") (source (origin (method url-fetch) (uri (string-append "mirror://kernel.org/software/scm/git/git-" version ".tar.xz")) (sha256 (base32 - "1li1xwgiwccy88bkshsah2kzl1006jg29jp7n32gvjggiswvi4s8")) - (patches (search-patches "git-header-cmd.patch")))) + "0h40arw08xbpi2cbf7pvc947v963rjxz3inb2ar81zjc8byvlj77")))) (build-system gnu-build-system) (native-inputs `(("native-perl" ,perl) @@ -255,7 +254,7 @@ Python 3.3 and later, rather than on Python 2.") version ".tar.xz")) (sha256 (base32 - "04yy5za8963q6xzrirflvxbi1216jzqj8ssvgd9nkld3ifa9q1gy")))) + "0xsqakgy0s60zpa13ilj6zj420kdh8pf4v3nrp1nziwj8ja4qymw")))) ;; For subtree documentation. ("asciidoc" ,asciidoc) ("docbook2x" ,docbook2x) -- cgit 1.4.1 From 4c610d2b2e700a8aca6d5aba344e0dabad386467 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Fri, 12 May 2023 16:18:18 -0700 Subject: gnu: Add fuzzylite. * gnu/packages/games.scm (fuzzylite): New variable. * gnu/packages/patches/fuzzylite-relative-path-in-tests.patch: New file. * gnu/packages/patches/fuzzylite-use-catch2.patch: New file. * gnu/packages/patches/fuzzylite-soften-float-equality.patch: New file. * gnu/local.mk (dist_patch_DATA): Register them here. Signed-off-by: Liliana Marie Prikler --- gnu/local.mk | 3 + gnu/packages/games.scm | 31 ++++ .../patches/fuzzylite-relative-path-in-tests.patch | 15 ++ .../patches/fuzzylite-soften-float-equality.patch | 30 ++++ gnu/packages/patches/fuzzylite-use-catch2.patch | 184 +++++++++++++++++++++ 5 files changed, 263 insertions(+) create mode 100644 gnu/packages/patches/fuzzylite-relative-path-in-tests.patch create mode 100644 gnu/packages/patches/fuzzylite-soften-float-equality.patch create mode 100644 gnu/packages/patches/fuzzylite-use-catch2.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index fa6f76e790..f9444dd857 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1157,6 +1157,9 @@ dist_patch_DATA = \ %D%/packages/patches/freeimage-unbundle.patch \ %D%/packages/patches/fuse-glibc-2.34.patch \ %D%/packages/patches/fuse-overlapping-headers.patch \ + %D%/packages/patches/fuzzylite-relative-path-in-tests.patch \ + %D%/packages/patches/fuzzylite-use-catch2.patch \ + %D%/packages/patches/fuzzylite-soften-float-equality.patch \ %D%/packages/patches/fxdiv-system-libraries.patch \ %D%/packages/patches/gajim-honour-GAJIM_PLUGIN_PATH.patch \ %D%/packages/patches/ganeti-disable-version-symlinks.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index cc4ca0c3e1..5dde152041 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -3645,6 +3645,37 @@ exec ~a/bin/freedink -refdir ~a/share/dink\n" ("bash" ,bash))) (native-inputs '()))) +(define-public fuzzylite + (package + (name "fuzzylite") + (version "6.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/fuzzylite/fuzzylite") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0yay0qc81x0irlvxqpy7jywjxpkmpjabdhq2hdh28r9z85wp2nwb")) + (patches (search-patches "fuzzylite-use-catch2.patch" + "fuzzylite-soften-float-equality.patch" + "fuzzylite-relative-path-in-tests.patch")))) + (build-system cmake-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (add-before 'configure 'switch-to-fuzzylite-dir + (lambda _ + (chdir "fuzzylite")))))) + (native-inputs (list catch2)) + (home-page "https://www.fuzzylite.com/") + (synopsis "Fuzzy logic control binary") + (description + "This package provides fuzzylite, a fuzzy logic control library which +allows one to easily create fuzzy logic controllers in a few steps utilizing +object-oriented programming.") + (license license:gpl3))) + (define-public xboard (package (name "xboard") diff --git a/gnu/packages/patches/fuzzylite-relative-path-in-tests.patch b/gnu/packages/patches/fuzzylite-relative-path-in-tests.patch new file mode 100644 index 0000000000..1a03238246 --- /dev/null +++ b/gnu/packages/patches/fuzzylite-relative-path-in-tests.patch @@ -0,0 +1,15 @@ +Workaround https://github.com/fuzzylite/fuzzylite/issues/85 + +diff --git a/fuzzylite/test/BenchmarkTest.cpp b/fuzzylite/test/BenchmarkTest.cpp +index f868ec29..464d394d 100644 +--- a/fuzzylite/test/BenchmarkTest.cpp ++++ b/fuzzylite/test/BenchmarkTest.cpp +@@ -30,7 +30,7 @@ namespace fl { + } + + TEST_CASE("Benchmarks from FLD files", "[benchmark][fld]") { +- std::string path = "../../examples/"; ++ std::string path = "../examples/"; + typedef std::pair Example; + std::vector examples; + examples.push_back(Example("mamdani/AllTerms", int(1e4))); diff --git a/gnu/packages/patches/fuzzylite-soften-float-equality.patch b/gnu/packages/patches/fuzzylite-soften-float-equality.patch new file mode 100644 index 0000000000..47403605dd --- /dev/null +++ b/gnu/packages/patches/fuzzylite-soften-float-equality.patch @@ -0,0 +1,30 @@ +Origin: https://salsa.debian.org/debian/fuzzylite/-/blob/debian/6.0+dfsg-6/debian/patches/when-testing-large-float-numbers-for-equ.patch +From: Johannes 'josch' Schauer +Date: Sun, 3 Feb 2019 10:33:22 +0100 +X-Dgit-Generated: 6.0+dfsg-2 80960ae38da9db032dfbfec6405398653e8205ff +Subject: when testing large float numbers for equality, use a larger epsilon + + +--- + +--- fuzzylite-6.0+dfsg.orig/fuzzylite/test/BenchmarkTest.cpp ++++ fuzzylite-6.0+dfsg/fuzzylite/test/BenchmarkTest.cpp +@@ -96,7 +96,17 @@ namespace fl { + CHECK(Op::isEq(1.0, Benchmark::convert(1000.0, Benchmark::MilliSeconds, Benchmark::Seconds))); + FL_LOG(Benchmark::convert(1000.0, Benchmark::MilliSeconds, Benchmark::Seconds)); + +- CHECK(Op::isEq(35e9, Benchmark::convert(35, Benchmark::Seconds, Benchmark::NanoSeconds))); ++ scalar eps = ++#ifndef __i386__ ++ fuzzylite::macheps(); ++#else ++ // on i386, due to the 80bit x87 register, double floating point ++ // numbers are handled differently and thus the difference between ++ // 35e9 and the result of Benchmark::convert() will be 2.179e-6, ++ // which is greater than the default epsilon of 1e-6. ++ 1e-5; ++#endif ++ CHECK(Op::isEq(35e9, Benchmark::convert(35, Benchmark::Seconds, Benchmark::NanoSeconds), eps)); + CHECK(Op::isEq(35, Benchmark::convert(35e9, Benchmark::NanoSeconds, Benchmark::Seconds))); + } + diff --git a/gnu/packages/patches/fuzzylite-use-catch2.patch b/gnu/packages/patches/fuzzylite-use-catch2.patch new file mode 100644 index 0000000000..e4aa13a98b --- /dev/null +++ b/gnu/packages/patches/fuzzylite-use-catch2.patch @@ -0,0 +1,184 @@ +Origin: https://salsa.debian.org/debian/fuzzylite/-/blob/debian/6.0+dfsg-6/debian/patches/fix-tests2.patch +From: Ferdinand Thiessen +Date: Mon, 31 Jan 2022 16:06:19 GMT +Subject: Replace Catch with Catch2 and require C++11 for tests +Origin: vendor, https://github.com/fuzzylite/fuzzylite/issues/94 +Bug-Debian: http://bugs.debian.org/1017155 + +--- a/fuzzylite/CMakeLists.txt ++++ b/fuzzylite/CMakeLists.txt +@@ -194,7 +194,9 @@ if(FL_BUILD_BINARY) + endif(FL_BUILD_BINARY) + + if(FL_BUILD_TESTS) ++ find_package(Catch2) + add_executable(fl-test ${fl-headers} ${fl-tests}) ++ target_link_libraries(fl-test Catch2::Catch2) + set_target_properties(fl-test PROPERTIES OUTPUT_NAME fuzzylite-tests) + set_target_properties(fl-test PROPERTIES OUTPUT_NAME fuzzylite-tests IMPORT_PREFIX tmp-) #To prevent LNK1149 in Windows + set_target_properties(fl-test PROPERTIES DEBUG_POSTFIX -debug) +--- a/fuzzylite/test/activation/ThresholdTest.cpp ++++ b/fuzzylite/test/activation/ThresholdTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/BenchmarkTest.cpp ++++ b/fuzzylite/test/BenchmarkTest.cpp +@@ -16,7 +16,7 @@ + + #include "fl/Benchmark.h" + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + #include +--- a/fuzzylite/test/hedge/HedgeFunctionTest.cpp ++++ b/fuzzylite/test/hedge/HedgeFunctionTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/imex/FldExporterTest.cpp ++++ b/fuzzylite/test/imex/FldExporterTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/imex/FllImporterTest.cpp ++++ b/fuzzylite/test/imex/FllImporterTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/imex/RScriptExporterTest.cpp ++++ b/fuzzylite/test/imex/RScriptExporterTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + #include + +--- a/fuzzylite/test/MainTest.cpp ++++ b/fuzzylite/test/MainTest.cpp +@@ -16,7 +16,7 @@ + + #define CATCH_CONFIG_RUNNER + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + + #include "fl/Headers.h" + +--- a/fuzzylite/test/norm/NormFunctionTest.cpp ++++ b/fuzzylite/test/norm/NormFunctionTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/QuickTest.cpp ++++ b/fuzzylite/test/QuickTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/term/AggregatedTest.cpp ++++ b/fuzzylite/test/term/AggregatedTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/term/DiscreteTest.cpp ++++ b/fuzzylite/test/term/DiscreteTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/term/FunctionTest.cpp ++++ b/fuzzylite/test/term/FunctionTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/term/TrapezoidTest.cpp ++++ b/fuzzylite/test/term/TrapezoidTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/term/TriangleTest.cpp ++++ b/fuzzylite/test/term/TriangleTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/variable/VariableTest.cpp ++++ b/fuzzylite/test/variable/VariableTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + #include // std::random_shuffle -- cgit 1.4.1 From 8306d3e52902c0d9cffd9a79b379c917c8cf49be Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Sun, 7 May 2023 17:43:33 -0700 Subject: gnu: Add vcmi. * gnu/packages/games.scm (vcmi): New variable. * gnu/packages/patches/vcmi-disable-privacy-breach.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it here. Signed-off-by: Liliana Marie Prikler --- gnu/local.mk | 1 + gnu/packages/games.scm | 49 ++++++++++++++++++++++ .../patches/vcmi-disable-privacy-breach.patch | 21 ++++++++++ 3 files changed, 71 insertions(+) create mode 100644 gnu/packages/patches/vcmi-disable-privacy-breach.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index f9444dd857..96f4594835 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2053,6 +2053,7 @@ dist_patch_DATA = \ %D%/packages/patches/vboot-utils-fix-format-load-address.patch \ %D%/packages/patches/vboot-utils-fix-tests-show-contents.patch \ %D%/packages/patches/vboot-utils-skip-test-workbuf.patch \ + %D%/packages/patches/vcmi-disable-privacy-breach.patch \ %D%/packages/patches/vinagre-newer-freerdp.patch \ %D%/packages/patches/vinagre-newer-rdp-parameters.patch \ %D%/packages/patches/virtuoso-ose-remove-pre-built-jar-files.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 5dde152041..fdd3a0e21e 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -203,6 +203,7 @@ #:use-module (gnu packages sqlite) #:use-module (gnu packages squirrel) #:use-module (gnu packages swig) + #:use-module (gnu packages tbb) #:use-module (gnu packages tcl) #:use-module (gnu packages terminals) #:use-module (gnu packages texinfo) @@ -11307,6 +11308,54 @@ Magic II (aka HOMM2) game engine. It requires assets and game resources to play; it will look for them at @file{~/.local/share/fheroes2} folder.") (license license:gpl2))) +(define-public vcmi + (package + (name "vcmi") + (version "1.2.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/vcmi/vcmi") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0f3fk1fc2wb7f2j4pxz89dzr8zjnrdh435mijia483a3bq59w7pk")) + (patches (search-patches "vcmi-disable-privacy-breach.patch")))) + (build-system cmake-build-system) + (arguments + (list #:configure-flags #~(list "-DFORCE_BUNDLED_FL=OFF") + ;; Test suites do not seem well supported upstream and are disabled by default. + ;; Pass -DENABLE_TEST to configure to enable. + #:tests? #f)) + (native-inputs + (list boost + ffmpeg + fuzzylite + ;; googletest ; needed for tests, but tests are disabled + libxkbcommon + luajit + minizip + pkg-config + python + ;; XXX: Build currently fails with qtbase-6 and qttools-6 + qtbase-5 + qttools-5 + sdl2 + sdl2-mixer + sdl2-image + sdl2-ttf + tbb + vulkan-headers + zlib)) + (home-page "https://vcmi.eu/") + (synopsis "Turn-based strategy game engine") + (description + "@code{vcmi} is an implementation of the Heroes of Might and +Magic III game engine. It requires assets and game resources to +play; it will look for them at @file{~/.local/share/vcmi} folder.") + (license license:gpl2))) + (define-public apricots (package (name "apricots") diff --git a/gnu/packages/patches/vcmi-disable-privacy-breach.patch b/gnu/packages/patches/vcmi-disable-privacy-breach.patch new file mode 100644 index 0000000000..c03bc66119 --- /dev/null +++ b/gnu/packages/patches/vcmi-disable-privacy-breach.patch @@ -0,0 +1,21 @@ +Origin: https://salsa.debian.org/games-team/vcmi/-/blob/debian/1.1.0+dfsg-1/debian/patches/disable-privacy-breach +From: Johannes Schauer +Subject: do not check remote repositories on startup by default +Forwarded: not-needed + +--- a/config/schemas/settings.json ++++ b/config/schemas/settings.json +@@ -401,11 +401,11 @@ + }, + "autoCheckRepositories" : { + "type" : "boolean", +- "default" : true ++ "default" : false + }, + "updateOnStartup" : { + "type" : "boolean", +- "default" : true ++ "default" : false + }, + "updateConfigUrl" : { + "type" : "string", -- cgit 1.4.1 From 65c77f608916f0c206d0d821db1afa2558c5a74f Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 9 Jul 2023 22:30:15 -0400 Subject: gnu: lightdm: Apply patch to fix VNC server address binding ordering. * gnu/packages/patches/lightdm-vnc-ipv6.patch: New patch file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/display-managers.scm (lightdm): Apply it. * gnu/tests/lightdm.scm (run-lightdm-test): Remove comment and expected fail directive for the "can connect to TCP port 5900 on IPv6" test. Suggested-by: Bruno Victal --- gnu/local.mk | 3 +- gnu/packages/display-managers.scm | 5 +-- gnu/packages/patches/lightdm-vnc-ipv6.patch | 48 +++++++++++++++++++++++++++++ gnu/tests/lightdm.scm | 6 +--- 4 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 gnu/packages/patches/lightdm-vnc-ipv6.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 96f4594835..5aa79d6583 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1426,8 +1426,9 @@ dist_patch_DATA = \ %D%/packages/patches/libvirt-add-install-prefix.patch \ %D%/packages/patches/libziparchive-add-includes.patch \ %D%/packages/patches/lightdm-arguments-ordering.patch \ - %D%/packages/patches/lightdm-vncserver-check.patch \ + %D%/packages/patches/lightdm-vnc-ipv6.patch \ %D%/packages/patches/lightdm-vnc-color-depth.patch \ + %D%/packages/patches/lightdm-vncserver-check.patch \ %D%/packages/patches/localed-xorg-keyboard.patch \ %D%/packages/patches/kcontacts-incorrect-country-name.patch \ %D%/packages/patches/kde-cli-tools-delay-mime-db.patch \ diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm index 9ddcef7021..f6c9283a29 100644 --- a/gnu/packages/display-managers.scm +++ b/gnu/packages/display-managers.scm @@ -12,7 +12,7 @@ ;;; Copyright © 2021 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2021, 2022 Efraim Flashner ;;; Copyright © 2021 Petr Hodina -;;; Copyright © 2022 Maxim Cournoyer +;;; Copyright © 2022, 2023 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -280,7 +280,8 @@ experience for your users, your family and yourself") "1wr60c946p8jz9kb8zi4cd8d4mkcy7infbvlfzwajiglc22nblxn")) (patches (search-patches "lightdm-arguments-ordering.patch" "lightdm-vncserver-check.patch" - "lightdm-vnc-color-depth.patch")))) + "lightdm-vnc-color-depth.patch" + "lightdm-vnc-ipv6.patch")))) (build-system gnu-build-system) (arguments '(#:parallel-tests? #f ; fails when run in parallel diff --git a/gnu/packages/patches/lightdm-vnc-ipv6.patch b/gnu/packages/patches/lightdm-vnc-ipv6.patch new file mode 100644 index 0000000000..68e4363d3e --- /dev/null +++ b/gnu/packages/patches/lightdm-vnc-ipv6.patch @@ -0,0 +1,48 @@ +Submitted upstream: https://github.com/canonical/lightdm/pull/312 + +diff --git a/src/vnc-server.c b/src/vnc-server.c +index d3500764..00a2fc02 100644 +--- a/src/vnc-server.c ++++ b/src/vnc-server.c +@@ -126,18 +126,10 @@ vnc_server_start (VNCServer *server) + + g_return_val_if_fail (server != NULL, FALSE); + +- g_autoptr(GError) ipv4_error = NULL; +- priv->socket = open_tcp_socket (G_SOCKET_FAMILY_IPV4, priv->port, priv->listen_address, &ipv4_error); +- if (ipv4_error) +- g_warning ("Failed to create IPv4 VNC socket: %s", ipv4_error->message); +- +- if (priv->socket) +- { +- GSource *source = g_socket_create_source (priv->socket, G_IO_IN, NULL); +- g_source_set_callback (source, (GSourceFunc) read_cb, server, NULL); +- g_source_attach (source, NULL); +- } +- ++ // Bind to IPv6 first, as this implies binding to 0.0.0.0 in the ++ // Linux kernel default configuration, which would otherwise cause ++ // IPv6 clients to fail with "Error binding to address [::]:5900: ++ // Address already in use" (#266). + g_autoptr(GError) ipv6_error = NULL; + priv->socket6 = open_tcp_socket (G_SOCKET_FAMILY_IPV6, priv->port, priv->listen_address, &ipv6_error); + if (ipv6_error) +@@ -150,6 +142,18 @@ vnc_server_start (VNCServer *server) + g_source_attach (source, NULL); + } + ++ g_autoptr(GError) ipv4_error = NULL; ++ priv->socket = open_tcp_socket (G_SOCKET_FAMILY_IPV4, priv->port, priv->listen_address, &ipv4_error); ++ if (ipv4_error) ++ g_warning ("Failed to create IPv4 VNC socket: %s", ipv4_error->message); ++ ++ if (priv->socket) ++ { ++ GSource *source = g_socket_create_source (priv->socket, G_IO_IN, NULL); ++ g_source_set_callback (source, (GSourceFunc) read_cb, server, NULL); ++ g_source_attach (source, NULL); ++ } ++ + if (!priv->socket && !priv->socket6) + return FALSE; + diff --git a/gnu/tests/lightdm.scm b/gnu/tests/lightdm.scm index 6011d2c515..f1c3b67c8a 100644 --- a/gnu/tests/lightdm.scm +++ b/gnu/tests/lightdm.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2022 Maxim Cournoyer . +;;; Copyright © 2022, 2023 Maxim Cournoyer . ;;; ;;; This file is part of GNU Guix. ;;; @@ -142,10 +142,6 @@ (test-assert "can connect to TCP port 5900 on IPv4" (wait-for-tcp-port 5900 marionette)) - ;; The VNC server fails to listen to IPv6 due to "Error binding to - ;; address [::]:5900: Address already in use" (see: - ;; https://github.com/canonical/lightdm/issues/266). - (test-expect-fail 1) (test-assert "can connect to TCP port 5900 on IPv6" (wait-for-tcp-port 5900 marionette #:address -- cgit 1.4.1 From 15f9870eb36e688fac2af37828971779b6c56916 Mon Sep 17 00:00:00 2001 From: John Kehayias Date: Tue, 11 Jul 2023 12:03:40 -0400 Subject: gnu: rocm: Update to 5.6.0. Update all of the ROCm packages at the same time as they share a version number and should be upgraded together, including llvm-for-rocm. * gnu/packages/llvm.scm (llvm-for-rocm): Update to 5.6.0. [source]{patches}: Remove unneeded patches (linkdl and remove-isystem-usr-include). * gnu/packages/rocm.scm (rocm-cmake, roct-thunk-interface): Update to 5.6.0. (rocclr-src): Update to 5.6.0. [source]{patches}: Add enable-gfx800 patch. (rocm-device-libs): Update to 5.6.0. [inputs]: Update style. (rocm-comgr): Update to 5.6.0. [inputs]: Remove lld. Update style. (rocr-runtime): Update to 5.6.0. [arguments]: Use gexps. Remove configure-flags. Add add-rocm-device-lib-path phase. [inputs]: Add libdrm. Update style. [native-inputs]: Add pkg-config. Update style. (rocm-opencl-runtime): Update to 5.6.0. [source]{patches}: Remove noopencl patch. [arguments]{configure-flags}: Add BUILD_ICD=OFF and FILE_REORG_BACKWARD_COMPATIBILITY=OFF flags. [inputs]: Add opencl-headers. (rocminfo): Update to 5.6.0. [arguments]: Use gexps. Use search-input-file instead of assoc-ref and which. (rocm-bandwidth-test): Update to 5.6.0. [source]{patches}: Add fix-includes patch. * gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch, gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch: Update patches. * gnu/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch, gnu/packages/patches/llvm-roc-5.0.0-linkdl.patch, gnu/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch: Delete files. * gnu/packages/patches/rocm-bandwidth-test-5.5.0-fix-includes.patch, gnu/packages/patches/rocclr-5.6.0-enable-gfx800.patch: New files. * gnu/local.mk (dist_patch_DATA): Update patches. --- gnu/local.mk | 7 +- gnu/packages/llvm.scm | 7 +- ...llvm-roc-4.0.0-remove-isystem-usr-include.patch | 29 ------ gnu/packages/patches/llvm-roc-5.0.0-linkdl.patch | 15 --- .../patches/rocclr-5.6.0-enable-gfx800.patch | 16 ++++ .../rocm-bandwidth-test-5.5.0-fix-includes.patch | 79 ++++++++++++++++ .../patches/rocm-comgr-3.1.0-dependencies.patch | 33 ++++--- .../patches/rocm-opencl-runtime-4.3-noclinfo.patch | 26 +++--- .../patches/rocm-opencl-runtime-4.3-noopencl.patch | 70 -------------- gnu/packages/rocm.scm | 101 +++++++++++---------- 10 files changed, 185 insertions(+), 198 deletions(-) delete mode 100644 gnu/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch delete mode 100644 gnu/packages/patches/llvm-roc-5.0.0-linkdl.patch create mode 100644 gnu/packages/patches/rocclr-5.6.0-enable-gfx800.patch create mode 100644 gnu/packages/patches/rocm-bandwidth-test-5.5.0-fix-includes.patch delete mode 100644 gnu/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 5aa79d6583..c817c9c926 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -50,7 +50,7 @@ # Copyright © 2022 Daniel Meißner # Copyright © 2022 Remco van 't Veer # Copyright © 2022 Artyom V. Poptsov -# Copyright © 2022 John Kehayias +# Copyright © 2022, 2023 John Kehayias # Copyright © 2022 muradm # Copyright © 2022 Hilton Chain # Copyright © 2022 Alex Griffin @@ -1547,8 +1547,6 @@ dist_patch_DATA = \ %D%/packages/patches/llvm-9-fix-bitcast-miscompilation.patch \ %D%/packages/patches/llvm-9-fix-lpad-miscompilation.patch \ %D%/packages/patches/llvm-9-fix-scev-miscompilation.patch \ - %D%/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch \ - %D%/packages/patches/llvm-roc-5.0.0-linkdl.patch \ %D%/packages/patches/lm-sensors-hwmon-attrs.patch \ %D%/packages/patches/lsh-fix-x11-forwarding.patch \ %D%/packages/patches/lsof-fatal-test-failures.patch \ @@ -1880,9 +1878,10 @@ dist_patch_DATA = \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ %D%/packages/patches/rng-tools-revert-build-randstat.patch \ + %D%/packages/patches/rocclr-5.6.0-enable-gfx800.patch \ + %D%/packages/patches/rocm-bandwidth-test-5.5.0-fix-includes.patch \ %D%/packages/patches/rocm-comgr-3.1.0-dependencies.patch \ %D%/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch \ - %D%/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch \ %D%/packages/patches/rottlog-direntry.patch \ %D%/packages/patches/ruby-hiredis-use-system-hiredis.patch \ %D%/packages/patches/ruby-hydra-minimal-no-byebug.patch \ diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 6d83313af6..de5ad3718b 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1462,7 +1462,7 @@ Library.") ;; Based on LLVM 14 as of v5.0.0 (inherit llvm-14) (name "llvm-for-rocm") - (version "5.1.3") ;this must match '%rocm-version' + (version "5.6.0") ;this must match '%rocm-version' (source (origin (method git-fetch) (uri (git-reference @@ -1471,10 +1471,7 @@ Library.") (file-name (git-file-name name version)) (sha256 (base32 - "0j6ydfkwrxwskgnhxc3cmry42n5faqbnwf2747qgf7lz5id8h8g5")) - (patches - (search-patches "llvm-roc-5.0.0-linkdl.patch" - "llvm-roc-4.0.0-remove-isystem-usr-include.patch")))) + "1kg6q6aqijjrwaznj0gr3nd01gykrnqqnk8vz8wyfifr18l9jrgx")))) (arguments (substitute-keyword-arguments (package-arguments llvm-14) ((#:configure-flags flags) diff --git a/gnu/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch b/gnu/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch deleted file mode 100644 index f14ec4ac0d..0000000000 --- a/gnu/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch +++ /dev/null @@ -1,29 +0,0 @@ -Author: Wilfried (justxi) Holzke - -Adopted from https://github.com/justxi/rocm/blob/master/sys-devel/llvm-roc/files/llvm-roc-4.0.0-remove-isystem-usr-include.patch - -Index: llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp -=================================================================== ---- llvm-project-rocm-4.0.0.orig/clang/lib/Driver/ToolChains/AMDGPU.cpp -+++ llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp -@@ -326,11 +326,6 @@ void RocmInstallationDetector::AddHIPInc - // - // ROCm 3.5 does not fully support the wrapper headers. Therefore it needs - // a workaround. -- SmallString<128> P(D.ResourceDir); -- if (UsesRuntimeWrapper) -- llvm::sys::path::append(P, "include", "cuda_wrappers"); -- CC1Args.push_back("-internal-isystem"); -- CC1Args.push_back(DriverArgs.MakeArgString(P)); - } - - if (DriverArgs.hasArg(options::OPT_nogpuinc)) -@@ -341,8 +336,6 @@ void RocmInstallationDetector::AddHIPInc - return; - } - -- CC1Args.push_back("-internal-isystem"); -- CC1Args.push_back(DriverArgs.MakeArgString(getIncludePath())); - if (UsesRuntimeWrapper) - CC1Args.append({"-include", "__clang_hip_runtime_wrapper.h"}); - } diff --git a/gnu/packages/patches/llvm-roc-5.0.0-linkdl.patch b/gnu/packages/patches/llvm-roc-5.0.0-linkdl.patch deleted file mode 100644 index d6ed3aef93..0000000000 --- a/gnu/packages/patches/llvm-roc-5.0.0-linkdl.patch +++ /dev/null @@ -1,15 +0,0 @@ -Taken from the Gentoo patch: -https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/llvm-roc/files/llvm-roc-5.0.0-linkdl.patch - -LLVMOffloadArch should link libdl to fix undefined symbol 'dlsym' when linking - ---- a/llvm/lib/OffloadArch/offload-arch/CMakeLists.txt -+++ b/llvm/lib/OffloadArch/offload-arch/CMakeLists.txt -@@ -3,6 +3,7 @@ add_llvm_tool(offload-arch - ${CMAKE_CURRENT_SOURCE_DIR}/offload-arch.cpp - DEPENDS generated-table LLVMOffloadArch - ) -+target_link_libraries(LLVMOffloadArch PRIVATE ${CMAKE_DL_LIBS}) - target_link_libraries(offload-arch PRIVATE LLVMOffloadArch) - - if(CMAKE_HOST_UNIX) diff --git a/gnu/packages/patches/rocclr-5.6.0-enable-gfx800.patch b/gnu/packages/patches/rocclr-5.6.0-enable-gfx800.patch new file mode 100644 index 0000000000..2948234029 --- /dev/null +++ b/gnu/packages/patches/rocclr-5.6.0-enable-gfx800.patch @@ -0,0 +1,16 @@ +#From xuhuisheng +#at https://github.com/RadeonOpenCompute/ROCm/issues/1659#issuecomment-1041026624 + +diff --git a/utils/flags.hpp b/utils/flags.hpp +index 8f0228cc..2eaa47c5 100644 +--- a/utils/flags.hpp ++++ b/utils/flags.hpp +@@ -245,7 +245,7 @@ release(bool, ROC_SYSTEM_SCOPE_SIGNAL, true, \ + "Enable system scope for signals (uses interrupts).") \ + release(bool, ROC_SKIP_COPY_SYNC, false, \ + "Skips copy syncs if runtime can predict the same engine.") \ +-release(bool, ROC_ENABLE_PRE_VEGA, false, \ ++release(bool, ROC_ENABLE_PRE_VEGA, true, \ + "Enable support of pre-vega ASICs in ROCm path") \ + release(bool, HIP_FORCE_QUEUE_PROFILING, false, \ + "Force command queue profiling by default") \ diff --git a/gnu/packages/patches/rocm-bandwidth-test-5.5.0-fix-includes.patch b/gnu/packages/patches/rocm-bandwidth-test-5.5.0-fix-includes.patch new file mode 100644 index 0000000000..a5404ad62c --- /dev/null +++ b/gnu/packages/patches/rocm-bandwidth-test-5.5.0-fix-includes.patch @@ -0,0 +1,79 @@ +See . + +From a58f9fd4cb5d1120b9ce58c912ca87fa14720f73 Mon Sep 17 00:00:00 2001 +From: pppig236 +Date: Tue, 2 May 2023 15:19:52 -0400 +Subject: [PATCH] fix include for rocm 5.5.0 + +--- + base_test.hpp | 8 +------- + common.hpp | 11 ++--------- + rocm_bandwidth_test.hpp | 8 +------- + 3 files changed, 4 insertions(+), 23 deletions(-) + +diff --git a/base_test.hpp b/base_test.hpp +index 3e79de1..af99a85 100755 +--- a/base_test.hpp ++++ b/base_test.hpp +@@ -42,14 +42,8 @@ + + #ifndef ROC_BANDWIDTH_TEST_BASE_H_ + #define ROC_BANDWIDTH_TEST_BASE_H_ +-#if(defined(RBT_HSA_VERSION_FLAT) && ((RBT_HSA_VERSION_FLAT) < RBT_HSA_VERSION_FILEREORG)) +-// Hsa package with out file reorganization +-// This is for backward compatibility and will be deprecated from future release +-#include "hsa.h" +-#else + // Hsa package with file reorganization +-#include "hsa/hsa.h" +-#endif ++#include + #include + #include + #include +diff --git a/common.hpp b/common.hpp +index d2933a0..3c4858f 100755 +--- a/common.hpp ++++ b/common.hpp +@@ -48,16 +48,9 @@ + #include + #include + #include +-#if(defined(RBT_HSA_VERSION_FLAT) && ((RBT_HSA_VERSION_FLAT) < RBT_HSA_VERSION_FILEREORG)) +-// Hsa package with out file reorganization +-// This is for backward compatibility and will be deprecated from future release +-#include "hsa.h" +-#include "hsa_ext_amd.h" +-#else + // Hsa package with file reorganization +-#include "hsa/hsa.h" +-#include "hsa/hsa_ext_amd.h" +-#endif ++#include ++#include + + using namespace std; + +diff --git a/rocm_bandwidth_test.hpp b/rocm_bandwidth_test.hpp +index f7eb338..b8550a7 100755 +--- a/rocm_bandwidth_test.hpp ++++ b/rocm_bandwidth_test.hpp +@@ -43,14 +43,8 @@ + #ifndef __ROC_BANDWIDTH_TEST_H__ + #define __ROC_BANDWIDTH_TEST_H__ + +-#if(defined(RBT_HSA_VERSION_FLAT) && ((RBT_HSA_VERSION_FLAT) < RBT_HSA_VERSION_FILEREORG)) +-// Hsa package with out file reorganization +-// This is for backward compatibility and will be deprecated from future release +-#include "hsa.h" +-#else + // Hsa package with file reorganization +-#include "hsa/hsa.h" +-#endif ++#include + #include "base_test.hpp" + #include "common.hpp" + +-- +2.40.1 + diff --git a/gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch b/gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch index fc2c74718a..6462b81eb9 100644 --- a/gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch +++ b/gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch @@ -1,4 +1,5 @@ -https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/25 +See https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/25 for +original patch. From c65cba2e73f9118e128b9ab7e655ee0f8a7798e7 Mon Sep 17 00:00:00 2001 From: Craig Andrews @@ -12,23 +13,23 @@ Without these additional required dependencies, linking fails with errors such a 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/comgr/CMakeLists.txt b/lib/comgr/CMakeLists.txt -index 8b5ca2f..a7d226f 100644 +index fd3ae4a..131e581 100644 --- a/lib/comgr/CMakeLists.txt +++ b/lib/comgr/CMakeLists.txt -@@ -294,7 +294,11 @@ install(FILES - DESTINATION "${AMD_COMGR_PACKAGE_PREFIX}") +@@ -322,7 +322,11 @@ install(FILES - set(CLANG_LIBS -- clangFrontendTool) -+ clangFrontendTool -+ clangFrontend -+ clangBasic -+ clangDriver -+ clangSerialization) - - set(LLD_LIBS - lldELF -@@ -305,8 +309,21 @@ if (LLVM_LINK_LLVM_DYLIB) + if(TARGET clangFrontendTool) + set(CLANG_LIBS +- clangFrontendTool) ++ clangFrontendTool ++ clangFrontend ++ clangBasic ++ clangDriver ++ clangSerialization) + else() + set(CLANG_LIBS + clang-cpp) +@@ -337,8 +341,23 @@ if (LLVM_LINK_LLVM_DYLIB) else() llvm_map_components_to_libnames(LLVM_LIBS ${LLVM_TARGETS_TO_BUILD} @@ -38,6 +39,8 @@ index 8b5ca2f..a7d226f 100644 + Symbolize + Support + Object ++ TargetParser ++ Bitreader + BitWriter + MC + MCParser diff --git a/gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch b/gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch index 97376fd421..65ad362307 100644 --- a/gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch +++ b/gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch @@ -1,14 +1,12 @@ Do not build and install clinfo. -diff --git a/CMakeLists.txt.orig b/CMakeLists.txt -index 76847d3..3f62bfe 100644 ---- a/CMakeLists.txt.orig +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0dc5bf4..95a12af 100644 +--- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -15,9 +15,9 @@ option(FILE_REORG_BACKWARD_COMPATIBILITY "Enable File Reorganization backward co - - - set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}/khronos/headers/opencl2.2" CACHE PATH "") - #add_subdirectory(khronos/icd) +@@ -27,7 +27,7 @@ else() + find_package(OpenCL REQUIRED) + endif() add_subdirectory(amdocl) -add_subdirectory(tools/clinfo) +#add_subdirectory(tools/clinfo) @@ -16,14 +14,14 @@ index 76847d3..3f62bfe 100644 if(BUILD_TESTS) add_subdirectory(tests/ocltst) diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt -index 48353eb..cd1e7c1 100644 +index a703f58..c07546a 100644 --- a/packaging/CMakeLists.txt +++ b/packaging/CMakeLists.txt -@@ -5,6 +5,6 @@ set(CPACK_COMPONENTS_ALL binary dev icd) +@@ -12,6 +12,6 @@ endif() set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_RPM_COMPONENT_INSTALL ON) --install(TARGETS clinfo DESTINATION bin COMPONENT binary) -+#install(TARGETS clinfo DESTINATION bin COMPONENT binary) - install(TARGETS amdocl DESTINATION lib COMPONENT binary) - install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION share/doc/${CMAKE_PROJECT_NAME} COMPONENT binary) +-install(TARGETS clinfo DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT binary) ++#install(TARGETS clinfo DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT binary) + install(TARGETS amdocl DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary) + install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT binary) diff --git a/gnu/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch b/gnu/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch deleted file mode 100644 index 9f80d7da9d..0000000000 --- a/gnu/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch +++ /dev/null @@ -1,70 +0,0 @@ -Do not build and install libOpenCL. - ---- b/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -15,9 +15,9 @@ option(FILE_REORG_BACKWARD_COMPATIBILITY "Enable File Reorganization backward co - - - set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}/khronos/headers/opencl2.2" CACHE PATH "") --add_subdirectory(khronos/icd) -+#add_subdirectory(khronos/icd) - add_subdirectory(amdocl) - add_subdirectory(tools/clinfo) - add_subdirectory(tools/cltrace) - if(BUILD_TESTS) - add_subdirectory(tests/ocltst) -@@ -25,16 +25,6 @@ endif() - - ###--- Packaging ------------------------------------------------------------### - --# DEV package --install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/khronos/headers/opencl2.2/CL" -- DESTINATION include -- COMPONENT DEV -- USE_SOURCE_PERMISSIONS -- PATTERN cl_d3d10.h EXCLUDE -- PATTERN cl_d3d11.h EXCLUDE -- PATTERN cl_dx9_media_sharing.h EXCLUDE -- PATTERN cl_egl.h EXCLUDE) -- - ############################# - # Packaging steps - ############################# -@@ -53,8 +43,8 @@ if (DEFINED ROCM_PATCH_VERSION) - set(OPENCL_AMD_ICD_FILE "amdocl64_${ROCM_PATCH_VERSION}.icd") - endif() - --get_target_property(OPENCL_LIB_VERSION_MAJOR OpenCL SOVERSION) --get_target_property(OPENCL_LIB_VERSION_STRING OpenCL VERSION) -+#get_target_property(OPENCL_LIB_VERSION_MAJOR OpenCL SOVERSION) -+#get_target_property(OPENCL_LIB_VERSION_STRING OpenCL VERSION) - - #Set Package Version - set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) -diff --git a/khronos/icd/CMakeLists.txt b/khronos/icd/CMakeLists.txt -index 4bafa86..987dd6f 100644 ---- a/khronos/icd/CMakeLists.txt 2020-06-07 16:05:32.425022904 +0200 -+++ b/khronos/icd/CMakeLists.txt 2020-06-07 16:06:03.273022786 +0200 -@@ -132,7 +132,7 @@ if (BUILD_TESTING) - add_subdirectory (test) - endif() - --install (TARGETS OpenCL -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+#install (TARGETS OpenCL -+# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt -index 48353eb..cd1e7c1 100644 ---- a/packaging/CMakeLists.txt -+++ b/packaging/CMakeLists.txt -@@ -17,5 +17,5 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/khronos/headers/opencl2.2/CL - PATTERN cl_dx9_media_sharing.h EXCLUDE - PATTERN cl_egl.h EXCLUDE ) - --install(TARGETS OpenCL DESTINATION lib COMPONENT icd ) -+#install(TARGETS OpenCL DESTINATION lib COMPONENT icd ) - install(FILES ${CMAKE_SOURCE_DIR}/khronos/icd/LICENSE DESTINATION share/doc/rocm-ocl-icd COMPONENT icd) diff --git a/gnu/packages/rocm.scm b/gnu/packages/rocm.scm index b85b39d783..e883371928 100644 --- a/gnu/packages/rocm.scm +++ b/gnu/packages/rocm.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Lars-Dominik Braun -;;; Copyright © 2022 John Kehayias +;;; Copyright © 2022, 2023 John Kehayias ;;; ;;; This program is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ ;; The components are tightly integrated and can only be upgraded as a unit. If ;; you want to upgrade ROCm, bump this version number and update hashes below. -(define %rocm-version "5.1.3") +(define %rocm-version "5.6.0") (define-public rocm-cmake (package @@ -51,7 +51,7 @@ (file-name (git-file-name name version)) (sha256 (base32 - "1bn3l04qnc1ls9abs15s1sgsrwmkfk0g8jgdjqshrcr3ab8ffcpf")))) + "183s2ksn142r7nl7l56qvyrgvvkdgqfdzmgkfpp4a6g9mjp88ady")))) (build-system cmake-build-system) (arguments `(#:tests? #f)) ; Tests try to use git commit (native-inputs (list git)) @@ -73,13 +73,13 @@ tasks needed for the ROCM software stack.") (file-name (git-file-name name version)) (sha256 (base32 - "07vkrxxc49i72r0lcl6dap0qcw1bignsw920rj4h1mac3bwa8q4j")))) + "1jg96ycy99s9fis8sk1b7qx5p33anw16mqlm07zqbnhry2gqkcbh")))) (build-system cmake-build-system) (arguments `(#:configure-flags (list "-DCMAKE_SKIP_BUILD_RPATH=FALSE" "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"))) - (inputs `(("llvm" ,llvm-for-rocm))) + (inputs (list llvm-for-rocm)) (home-page "https://github.com/RadeonOpenCompute/ROCm-Device-Libs") (synopsis "ROCm Device libraries") (description "AMD-specific device-side language runtime libraries, namely @@ -98,7 +98,7 @@ oclc, ocml, ockl, opencl, hip and hc.") (file-name (git-file-name name version)) (sha256 (base32 - "1achb3216cbm7x2d05xj7j7ivn24y11q2d2p5whw3v4ykgfqql6f")) + "15s2dx0pdvjv3xfccq5prkplcbwps8x9jas5qk93q7kv8wx57p3b")) (patches (search-patches "rocm-comgr-3.1.0-dependencies.patch")))) (build-system cmake-build-system) @@ -108,10 +108,7 @@ oclc, ocml, ockl, opencl, hip and hc.") (add-after 'unpack 'chdir (lambda _ (chdir "lib/comgr")))))) - (inputs - `(("rocm-device-libs" ,rocm-device-libs) - ("llvm" ,llvm-for-rocm) - ("lld" ,lld))) + (inputs (list llvm-for-rocm rocm-device-libs)) (home-page "https://github.com/RadeonOpenCompute/ROCm-CompilerSupport") (synopsis "ROCm Code Object Manager") (description "The Comgr library provides APIs for compiling and inspecting @@ -130,7 +127,7 @@ AMDGPU code objects.") (file-name (git-file-name name version)) (sha256 (base32 - "0k5bchq1jhgraqrhj9q47b45n33wnd2ipwrrj39q51jzxmyyzxj2")))) + "0v8j4gkbb21gqqmz1b4nmampx5ywva99ipsx8lcjr5ckcg84fn9x")))) (build-system cmake-build-system) (arguments `(#:tests? #f)) ; Not sure how to run tests. (inputs (list libdrm numactl)) @@ -153,27 +150,32 @@ driver.") (file-name (git-file-name name version)) (sha256 (base32 - "1j1cy64w13plgsy20mir4xm6x4xnwkyil3g03xnda6ynhd7bkhv7")))) + "07wh7s1kgvpw8ydxmr2wvvn05fdqcmcc20qjbmnc3cbbhxviksyr")))) (build-system cmake-build-system) (arguments - `(#:configure-flags - `(,(string-append - "-DBITCODE_DIR=" - (assoc-ref %build-inputs "rocm-device-libs") - "/amdgcn/bitcode/")) - #:tests? #f ; No tests. - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir - (lambda _ - (chdir "src")))))) + (list + #:tests? #f ; No tests. + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'add-rocm-device-lib-path + (lambda _ + (substitute* "src/image/blit_src/CMakeLists.txt" + (("-O2") + (string-append + "-O2 --rocm-device-lib-path=" + #$(this-package-input "rocm-device-libs") + "/amdgcn/bitcode/"))))) + (add-after 'add-rocm-device-lib-path 'chdir + (lambda _ + (chdir "src")))))) (inputs - `(("libelf" ,libelf) - ("numactl" ,numactl) - ("llvm" ,llvm-for-rocm) - ("roct-thunk-interface" ,roct-thunk-interface) - ("rocm-device-libs" ,rocm-device-libs))) ; For bitcode. - (native-inputs (list xxd)) + (list libdrm + libelf + llvm-for-rocm + numactl + rocm-device-libs ; For bitcode. + roct-thunk-interface)) + (native-inputs (list pkg-config xxd)) (home-page "https://github.com/RadeonOpenCompute/ROCR-Runtime") (synopsis "ROCm Platform Runtime") (description "User-mode API interfaces and libraries necessary for host @@ -182,7 +184,7 @@ applications to launch compute kernels to available HSA ROCm kernel agents.") ;; This is the source only for ROCclr as from v4.5 it should only be built as ;; part of a client. A warning is output if attempting to build stand-alone -;; and there is no install. The previous version is kept as rocclr-4. +;; and there is no install. (define rocclr-src (origin (method git-fetch) @@ -191,7 +193,8 @@ applications to launch compute kernels to available HSA ROCm kernel agents.") (commit (string-append "rocm-" %rocm-version)))) (sha256 (base32 - "0x1frzpz9j1s516vscbdm9g5cqirvv5w7wmq2kyljcygnci7yqar")))) + "1fzvnngxcvxscn718cqfglm4izccx88zjdr3g5ldfqw7hyd034sk")) + (patches (search-patches "rocclr-5.6.0-enable-gfx800.patch")))) (define-public rocm-opencl-runtime (package @@ -206,11 +209,9 @@ applications to launch compute kernels to available HSA ROCm kernel agents.") (file-name (git-file-name name version)) (sha256 (base32 - "1rirvc8h0ahicw1vw4js4jq5gw25x47gmg3gczmyz97c72wvgfiv")) + "1azfxf0ac3mnbyfgn30bz5glwlmaigzdz0cd29jzc4b05hks1yr3")) (patches (search-patches - ;; Do not install libOpenCL, which ocl-icd provides. - "rocm-opencl-runtime-4.3-noopencl.patch" ;; Guix includes a program clinfo already. "rocm-opencl-runtime-4.3-noclinfo.patch")))) (build-system cmake-build-system) @@ -222,7 +223,12 @@ applications to launch compute kernels to available HSA ROCm kernel agents.") (string-append "-DAMD_OPENCL_PATH=" #$(package-source this-package)) ;; The ROCclr source is needed to build the runtime. (string-append "-DROCCLR_PATH=" #$rocclr-src) - (string-append "-DROCM_PATH=" #$output)) + (string-append "-DROCM_PATH=" #$output) + ;; Don't build the ICD loader as we have the opencl-icd-loader + ;; package already. + "-DBUILD_ICD=OFF" + ;; Don't duplicate the install in an "opencl" directory as well. + "-DFILE_REORG_BACKWARD_COMPATIBILITY=OFF") #:phases #~(modify-phases %standard-phases (add-after 'install 'create-icd @@ -238,6 +244,7 @@ applications to launch compute kernels to available HSA ROCm kernel agents.") (list glew mesa numactl + opencl-headers opencl-icd-loader rocm-comgr rocr-runtime)) @@ -258,18 +265,19 @@ and in-process/in-memory compilation.") (file-name (git-file-name name version)) (sha256 (base32 - "0hdfbvn55h5lk5s8vqlmri5r94vlas8v8yjxwd9d70igslk0kr67")))) + "150bvyxp9krq8f7jqd1g5b4l85rih4ch322y4sg1hnciqpabn6a6")))) (build-system cmake-build-system) (arguments - `(#:tests? #f ; No tests. - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-binary-paths - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "rocminfo.cc" - (("lsmod") - (string-append (assoc-ref inputs "kmod") "/bin/lsmod")) - (("grep") (which "grep")))))))) + (list + #:tests? #f ; No tests. + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-binary-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "rocminfo.cc" + (("lsmod") + (search-input-file inputs "bin/lsmod")) + (("grep") (search-input-file inputs "bin/grep")))))))) (inputs (list rocr-runtime kmod)) (home-page "https://github.com/RadeonOpenCompute/rocminfo") @@ -290,7 +298,8 @@ available to ROCm and show their properties.") (file-name (git-file-name name version)) (sha256 (base32 - "0rnn2ms68mvzpcp31dk304sfqnv352i7vb48k7rw3qjahhrjm48c")))) + "0ca6r8xijw3a3hrlgkqqsf3iqyia6sdmidgmjl12f5vypxzp5kmm")) + (patches (search-patches "rocm-bandwidth-test-5.5.0-fix-includes.patch")))) (build-system cmake-build-system) (arguments `(#:tests? #f)) ; No tests. (inputs (list rocr-runtime)) -- cgit 1.4.1