unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Janneke Nieuwenhuizen <janneke@gnu.org>
To: 74290@debbugs.gnu.org
Subject: [bug#74290] [PATCH v2 20/40] gnu: pciutils: Support the 64bit Hurd.
Date: Tue, 12 Nov 2024 17:25:29 +0100	[thread overview]
Message-ID: <c14730c47b48a92f6a80dcc2106035d8bd5fc8f2.1731427612.git.janneke@gnu.org> (raw)
In-Reply-To: <cover.1731427612.git.janneke@gnu.org>

* gnu/packages/patches/pciutils-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/pciutils.scm (pciutils)[arguments]: Use g-expressions.  When
building for the 64bit Hurd, use it in new "apply-hurd64-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                               |  1 +
 gnu/packages/patches/pciutils-hurd64.patch | 31 ++++++++++++++++++++++
 gnu/packages/pciutils.scm                  | 25 +++++++++++------
 3 files changed, 49 insertions(+), 8 deletions(-)
 create mode 100644 gnu/packages/patches/pciutils-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index a7e5e903e3..34023909a1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1908,6 +1908,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/pam-krb5-CVE-2020-10595.patch		\
   %D%/packages/patches/pango-skip-libthai-test.patch		\
   %D%/packages/patches/password-store-tree-compat.patch		\
+  %D%/packages/patches/pciutils-hurd64.patch			\
   %D%/packages/patches/pdfpc-build-with-vala-0.56.patch         \
   %D%/packages/patches/petri-foo-0.1.87-fix-recent-file-not-exist.patch			\
   %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \
diff --git a/gnu/packages/patches/pciutils-hurd64.patch b/gnu/packages/patches/pciutils-hurd64.patch
new file mode 100644
index 0000000000..316f12e131
--- /dev/null
+++ b/gnu/packages/patches/pciutils-hurd64.patch
@@ -0,0 +1,31 @@
+Upstream-status: Not presented upstream.
+
+--- pciutils-3.8.0/lib/hurd.c.orig	2024-11-07 15:09:20.728973822 +0100
++++ pciutils-3.8.0/lib/hurd.c	2024-11-07 15:05:08.524682813 +0100
+@@ -213,7 +213,7 @@
+ hurd_read(struct pci_dev *d, int pos, byte * buf, int len)
+ {
+   int err;
+-  size_t nread;
++  mach_msg_type_number_t nread;
+   char *data;
+   mach_port_t device_port = device_port_lookup(d);
+ 
+@@ -266,7 +266,7 @@
+   mach_port_t device_port = device_port_lookup(d);
+   struct pci_bar regions[6];
+   char *buf = (char *) &regions;
+-  size_t size = sizeof(regions);
++  mach_msg_type_number_t size = sizeof(regions);
+ 
+   int err = pci_get_dev_regions(device_port, &buf, &size);
+   if (err)
+@@ -305,7 +305,7 @@
+   struct pci_xrom_bar rom;
+   mach_port_t device_port = device_port_lookup(d);
+   char *buf = (char *) &rom;
+-  size_t size = sizeof(rom);
++  mach_msg_type_number_t size = sizeof(rom);
+ 
+   int err = pci_get_dev_rom(device_port, &buf, &size);
+   if (err)
diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index d2a352eb6b..08f1634113 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
 ;;;
@@ -81,25 +81,34 @@ (define-public pciutils
                 "01aglgw9ds9qiswcbi2lx90lswncikrlyv8mmp4haix8542bvvci"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
          (add-after 'unpack 'unbundle-pci.ids
            (lambda* (#:key native-inputs inputs #:allow-other-keys)
              (copy-file (search-input-file (or native-inputs inputs)
                                            "share/hwdata/pci.ids")
                         "pci.ids")))
+         #$@(if (target-hurd64?)
+               #~((add-after 'unpack 'apply-hurd64-patch
+                    (lambda _
+                      (let ((patch-file
+                             #$(local-file
+                                (search-patch "pciutils-hurd64.patch"))))
+                        (invoke "patch" "--force" "-p1" "-i" patch-file)))))
+               #~())
          (replace 'configure
            (lambda* (#:key outputs #:allow-other-keys)
              ;; There's no 'configure' script, just a raw makefile.
              (substitute* "Makefile"
-               ,@(if (%current-target-system)
-                     `((("^CROSS_COMPILE=.*$")
+               #$@(if (%current-target-system)
+                     #~((("^CROSS_COMPILE=.*$")
                         (string-append "CROSS_COMPILE="
-                                       ,(%current-target-system) "-"
+                                       #$(%current-target-system) "-"
                                        "\n"))
                        (("^HOST=.*$")
                         (string-append "HOST="
-                                       ,(gnu-triplet->nix-system
+                                       #$(gnu-triplet->nix-system
                                          (%current-target-system)) "\n"))
                        ;; Disable 'install' strip option, that would fail when
                        ;; we are cross-compiling.
@@ -139,7 +148,7 @@ (define-public pciutils
              (invoke "make" "install" "install-lib"))))
 
        ;; Make sure programs have an RPATH so they can find libpciutils.so.
-       #:make-flags (list ,(string-append "CC="
+       #:make-flags #~(list #$(string-append "CC="
                                           (if (%current-target-system)
                                               (cc-for-target)
                                               "gcc"))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





  parent reply	other threads:[~2024-11-12 16:30 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
2024-11-10 10:37 ` [bug#74290] [PATCH 01/31] gnu: mig: Update to v1.8+git20231217 Janneke Nieuwenhuizen
2024-11-10 10:37 ` [bug#74290] [PATCH 02/31] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
2024-11-10 11:45   ` janneke
2024-11-10 10:37 ` [bug#74290] [PATCH 03/31] gnu: hurd: Update to v0.9.git20240714 Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 04/31] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 05/31] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 06/31] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 07/31] gnu: bash-minimal: Fix build for " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 08/31] gnu: elfutils: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 09/31] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 10/31] gnu: patch: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 11/31] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 12/31] gnu: libstdc++: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 13/31] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 14/31] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
2024-11-11 18:05   ` janneke
2024-11-10 10:38 ` [bug#74290] [PATCH 15/31] system: image: Add hurd64 image types Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 16/31] gnu: Add libgpg-error-1.50 Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 17/31] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 18/31] gnu: perl: Support cross-building " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 19/31] gnu: openssl-3.0: Support " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 20/31] gnu: pciutils: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 21/31] gnu: libpciaccess: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 22/31] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 23/31] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 24/31] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 25/31] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 26/31] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 27/31] gnu: git-minimal: Support " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 28/31] gnu: inetutils: Fix build for " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 29/31] gnu: grub: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 30/31] gnu: guile-fibers: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 31/31] system: hurd: Use 64bit gnumach " Janneke Nieuwenhuizen
2024-11-10 14:40   ` janneke
2024-11-10 14:15 ` [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka " janneke
2024-11-12  1:17   ` Maxim Cournoyer
2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 01/40] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 02/40] gnu: mig: Update to 1.8+git20231217 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 03/40] gnu: hurd: Update to 0.9.git20240714 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 04/40] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 06/40] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 07/40] gnu: bash-minimal: Fix build for " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 08/40] gnu: elfutils: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 09/40] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 10/40] gnu: patch: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 11/40] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 12/40] gnu: libstdc++: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 13/40] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 14/40] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 15/40] system: image: Add hurd64 image types Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 16/40] gnu: Add libgpg-error-1.50 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 17/40] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 18/40] gnu: perl: Support cross-building " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 19/40] gnu: openssl-3.0: Support " Janneke Nieuwenhuizen
2024-11-12 16:25   ` Janneke Nieuwenhuizen [this message]
2024-11-12 16:25   ` [bug#74290] [PATCH v2 21/40] gnu: libpciaccess: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 22/40] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 23/40] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 24/40] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 25/40] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 26/40] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 27/40] gnu: git-minimal: Support " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 28/40] gnu: inetutils: Fix build for " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 29/40] gnu: grub: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 30/40] gnu: guile-fibers: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 31/40] gnu: m4: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 32/40] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 33/40] gnu: commencement: mig-boot0: Update to 1.8+git20231217 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 34/40] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 35/40] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 36/40] gnu: gettext: Fix cross-build shebangs Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 37/40] gnu: texinfo-4: Fix build for the 64bit Hurd Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 38/40] gnu: flex: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 39/40] system: examples: Add bare-hurd64.tmpl Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 40/40] system: examples: Add devel-hurd64.tmpl Janneke Nieuwenhuizen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c14730c47b48a92f6a80dcc2106035d8bd5fc8f2.1731427612.git.janneke@gnu.org \
    --to=janneke@gnu.org \
    --cc=74290@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).