guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/04: gnu: pciutils: Fix compilation error on GNU/Hurd.


From: guix-commits
Subject: 04/04: gnu: pciutils: Fix compilation error on GNU/Hurd.
Date: Wed, 9 Dec 2020 08:14:25 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 3d85c3ec652feb22824f355538b51e6955ded361
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Dec 9 13:55:46 2020 +0100

    gnu: pciutils: Fix compilation error on GNU/Hurd.
    
    * gnu/packages/patches/pciutils-hurd-fix.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Add it.
    * gnu/packages/pciutils.scm (pciutils)[arguments]: Add
    'apply-hurd-patch' phase when (hurd-target?) is true.
    [inputs]: Add "hurd-patch" entry when (hurd-target?) is true.
---
 gnu/local.mk                                 |  1 +
 gnu/packages/patches/pciutils-hurd-fix.patch | 23 +++++++++++++++++++++++
 gnu/packages/pciutils.scm                    | 15 +++++++++++++--
 3 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 90df6f3..67482b8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1435,6 +1435,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/pam-krb5-CVE-2020-10595.patch           \
   %D%/packages/patches/pango-skip-libthai-test.patch           \
   %D%/packages/patches/pciutils-hurd-configure.patch           \
+  %D%/packages/patches/pciutils-hurd-fix.patch                 \
   %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \
   %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch           \
   %D%/packages/patches/samba-fix-fcntl-hint-detection.patch            \
diff --git a/gnu/packages/patches/pciutils-hurd-fix.patch 
b/gnu/packages/patches/pciutils-hurd-fix.patch
new file mode 100644
index 0000000..f1979d4
--- /dev/null
+++ b/gnu/packages/patches/pciutils-hurd-fix.patch
@@ -0,0 +1,23 @@
+Fix a build error on GNU/Hurd for pciutils 3.7.0.
+
+commit 053cf6c8b2acafadf828912828336d90fe9b8696
+Author: Martin Mares <mj@ucw.cz>
+Date:   Sun May 31 11:53:28 2020 +0200
+
+    HURD backend should compile again
+    
+    Fixes a bug introduced by commit 82c06b47dea5a38075ce9d56f743360bc47b4c78.
+
+diff --git a/lib/hurd.c b/lib/hurd.c
+index 7b3b2ae..ccd92f6 100644
+--- a/lib/hurd.c
++++ b/lib/hurd.c
+@@ -307,7 +307,6 @@ hurd_fill_regions(struct pci_dev *d)
+       d->base_addr[i] |= regions[i].is_64 << 2;
+       d->base_addr[i] |= regions[i].is_prefetchable << 3;
+ 
+-      if (flags & PCI_FILL_SIZES)
+-      d->size[i] = regions[i].size;
++      d->size[i] = regions[i].size;
+     }
+ }
diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index a5ed121..d7d224b 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2017, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
@@ -92,7 +92,15 @@
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Install the commands, library, and .pc files.
-             (invoke "make" "install" "install-lib"))))
+             (invoke "make" "install" "install-lib")))
+
+         ,@(if (hurd-target?)
+               '((add-after 'unpack 'apply-hurd-patch
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     (let ((patch (assoc-ref inputs "hurd-patch")))
+                       (invoke "patch" "-p1" "--batch" "-i"
+                               patch)))))
+               '()))
 
        ;; Make sure programs have an RPATH so they can find libpciutils.so.
        #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
@@ -109,6 +117,9 @@
                      (package-supported-systems kmod))
              `(("kmod" ,kmod))
              '())
+       ,@(if (hurd-target?)
+             `(("hurd-patch" ,(search-patch "pciutils-hurd-fix.patch")))
+             '())
        ("zlib" ,zlib)))
     (home-page "https://mj.ucw.cz/sw/pciutils/";)
     (synopsis "Programs for inspecting and manipulating PCI devices")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]