Chris Marusich <cmmarus...@gmail.com> writes:

> There is actually a bug report for this here:
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36150
>
> I have submitted a patch upstream to fix the issue.

Upstream hasn't replied yet, but it's only been a week and a few days.
In the meantime, here are some patches to pull the fix into Guix.  While
I was here, I also taught "guix lint" to correctly check the file name
of patches when they come from an origin record.  I'll commit the sed
change to core-updates, and the lint change to master, in the next
couple days if nobody has any other comments.

-- 
Chris
From 5686aa71488b7ba060b94f8e0c3a857016c0fa9c Mon Sep 17 00:00:00 2001
From: Chris Marusich <cmmarus...@gmail.com>
Date: Tue, 9 Jun 2020 23:35:56 -0700
Subject: [PATCH 1/2] gnu: sed: Make it build on SELinux-enabled kernels.

Fixes: <https://bugs.gnu.org/41498>.

* gnu/packages/base.scm (sed)[origin][patches]: New field.  This adds a
patch that was submitted upstream which fixes an issue that prevents sed
from building on SELinux-enabled kernels.
---
 gnu/packages/base.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 279fe9e3d8..f075ee8f74 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <m...@tobias.gr>
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rek...@elephly.net>
 ;;; Copyright © 2020 Vitaliy Shatrov <d0dybo0d0dy...@protonmail.com>
+;;; Copyright © 2020 Chris Marusich <cmmarus...@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -141,7 +142,21 @@ including, for example, recursive directory searching.")
                                 ".tar.gz"))
             (sha256
              (base32
-              "0alqagh0nliymz23kfjg6g9w3cr086k0sfni56gi8fhzqwa3xksk"))))
+              "0alqagh0nliymz23kfjg6g9w3cr086k0sfni56gi8fhzqwa3xksk"))
+            ;; Remove this patch once upstream releases a fixed version.
+            (patches
+             (list
+              (origin
+                (method url-fetch)
+                (uri (string-append
+                      "https://debbugs.gnu.org/cgi/bugreport.cgi?";
+                      "att=1;msg=16;bug=36150;filename=0001-tests-"
+                      "Export-CONFIG_HEADER-to-test-scripts.patch"))
+                (file-name
+                 "sed-Export-CONFIG_HEADER-to-test-scripts.patch")
+                (sha256
+                 (base32
+                  "0q78qzc0mv4bmsf7wnqj9fjbrwb71xz18v07h0jz2cwnbbj1nwm9")))))))
    (build-system gnu-build-system)
    (synopsis "Stream editor")
    (native-inputs
-- 
2.26.2

From 770051777637f2026bcc56a57d30272e082099e6 Mon Sep 17 00:00:00 2001
From: Chris Marusich <cmmarus...@gmail.com>
Date: Wed, 10 Jun 2020 00:01:50 -0700
Subject: [PATCH 2/2] guix: lint: Support origins in check-patch-file-names.

* guix/lint.scm (check-patch-file-names)[starts-with-package-name?]: New
procedure, extracted from the existing logic.  Using it, add a clause to
the match-lambda to handle origin records.
---
 guix/lint.scm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/guix/lint.scm b/guix/lint.scm
index 6271894360..627016fae0 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <m...@tobias.gr>
 ;;; Copyright © 2017, 2018, 2020 Efraim Flashner <efr...@flashner.co.il>
 ;;; Copyright © 2018, 2019 Arun Isaac <arunis...@systemreboot.net>
+;;; Copyright © 2020 Chris Marusich <cmmarus...@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -669,13 +670,17 @@ patch could not be found."
       (or (and=> (package-source package) origin-patches)
           '()))
 
+    (define (starts-with-package-name? file-name)
+      (and=> (string-contains file-name (package-name package))
+             zero?))
+
     (append
      (if (every (match-lambda        ;patch starts with package name?
                   ((? string? patch)
-                   (and=> (string-contains (basename patch)
-                                           (package-name package))
-                          zero?))
-                  (_  #f))     ;must be an <origin> or something like that.
+                   (starts-with-package-name? (basename patch)))
+                  ((? origin? patch)
+                   (starts-with-package-name? (origin-file-name patch)))
+                  (_  #f))     ;must be some other file-like object
                 patches)
          '()
          (list
-- 
2.26.2

Attachment: signature.asc
Description: PGP signature

Reply via email to