GNU bug report logs - #40996
[PATCH 0/3] Fix usbguard's warning about 'catch'.

Previous Next

Package: guix-patches;

Reported by: Brice Waegeneire <brice <at> waegenei.re>

Date: Fri, 1 May 2020 13:07:01 UTC

Severity: normal

Tags: patch

Done: Brice Waegeneire <brice <at> waegenei.re>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40996 in the body.
You can then email your comments to 40996 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#40996; Package guix-patches. (Fri, 01 May 2020 13:07:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brice Waegeneire <brice <at> waegenei.re>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 01 May 2020 13:07:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/3] Fix usbguard's warning about 'catch'.
Date: Fri,  1 May 2020 15:06:04 +0200
This patch fix the issue in usbguard reported by Ludo[0] about warnings from
'catch' using a wrong include path, usguard now use a packaged 'pegtl'
dependency instead of the bundled one.

[0]: https://issues.guix.info/issue/40607#11

Brice Waegeneire (3):
  gnu: Add pegtl.
  gnu: usbguard: Use packaged 'pegtl'.
  gnu: usbguard: Fix warning about 'catch'.

 gnu/packages/cpp.scm      | 22 ++++++++++++++++++++++
 gnu/packages/hardware.scm | 29 ++++++++++++++++++-----------
 2 files changed, 40 insertions(+), 11 deletions(-)

-- 
2.26.0





Information forwarded to guix-patches <at> gnu.org:
bug#40996; Package guix-patches. (Fri, 01 May 2020 13:10:02 GMT) Full text and rfc822 format available.

Message #8 received at 40996 <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: 40996 <at> debbugs.gnu.org
Subject: [PATCH 1/3] gnu: Add pegtl.
Date: Fri,  1 May 2020 15:09:28 +0200
* gnu/packages/cpp.scm (pegtl): New variable.
---
 gnu/packages/cpp.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 2248ebfc4b..cdc1c0e0f4 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo <at> nixo.xyz>
 ;;; Copyright © 2020 Roel Janssen <roel <at> gnu.org>
 ;;; Copyright © 2020 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -485,3 +486,24 @@ point and then, after each tween step, plugging back the result.")
 augment the C++ standard library.  The Abseil library code is collected from
 Google's C++ code base.")
     (license license:asl2.0)))
+
+(define-public pegtl
+    (package
+      (name "pegtl")
+      (version "2.8.3")
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/taocpp/PEGTL.git")
+                      (commit version)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "17crgjfdx55imi2dqnz6xpvsxq07390yfgkz5nd2g77ydkvq9db3"))))
+      (build-system cmake-build-system)
+      (home-page "https://github.com/taocpp/PEGTL")
+      (synopsis "Parsing Expression Grammar Template Library")
+      (description "The Parsing Expression Grammar Template Library (PEGTL) is
+a zero-dependency C++ header-only parser combinator library for creating
+parsers according to a Parsing Expression Grammar (PEG).")
+      (license license:expat)))
-- 
2.26.0





Information forwarded to guix-patches <at> gnu.org:
bug#40996; Package guix-patches. (Fri, 01 May 2020 13:10:02 GMT) Full text and rfc822 format available.

Message #11 received at 40996 <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: 40996 <at> debbugs.gnu.org
Subject: [PATCH 2/3] gnu: usbguard: Use packaged 'pegtl'.
Date: Fri,  1 May 2020 15:09:29 +0200
* gnu/packages/hardware.scm (usbguard)[arguments]: Remove configure flag
'--with-bundled-pegtl'.
[inputs]: Add 'pegtl'
---
 gnu/packages/hardware.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index ce3f396d0a..74fd282191 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -24,6 +24,7 @@
   #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
@@ -429,7 +430,6 @@ applications.")
        #:configure-flags
        (list
         "--localstatedir=/var"
-        "--with-bundled-pegtl"
         "--enable-systemd=no"
         "--with-ldap"
         "--with-dbus"
@@ -442,6 +442,7 @@ applications.")
        ("libcap-ng" ,libcap-ng)
        ("libseccomp" ,libseccomp)
        ("libsodium" ,libsodium)
+       ("pegtl" ,pegtl)
        ("polkit" ,polkit)
        ("protobuf" ,protobuf)
        ("libqb" ,libqb)))
-- 
2.26.0





Information forwarded to guix-patches <at> gnu.org:
bug#40996; Package guix-patches. (Fri, 01 May 2020 13:10:03 GMT) Full text and rfc822 format available.

Message #14 received at 40996 <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: 40996 <at> debbugs.gnu.org
Subject: [PATCH 3/3] gnu: usbguard: Fix warning about 'catch'.
Date: Fri,  1 May 2020 15:09:30 +0200
* gnu/packages/hardware.scm (usgbuard)[source]: Get it from git.
[arguments]: Rename phase 'patch-makefile' to 'patch-build-scripts',
adjust it for the source from git and fix 'catch' path.
[native-inputs]: Add 'libtool'.
---
 gnu/packages/hardware.scm | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 74fd282191..de4f82e105 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -389,21 +389,26 @@ applications.")
     (name "usbguard")
     (version "0.7.6")
     (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/USBGuard/usbguard/releases/download/usbguard-"
-                    version "/usbguard-" version ".tar.gz"))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32 "0gzhs8s4aka86mkcjib36z54si939ki4bmk46p6v8kln1fixad3j"))))
+               (method git-fetch)
+               (uri (git-reference
+                     (url "https://github.com/USBGuard/usbguard.git")
+                     (commit (string-append name "-" version))))
+               (file-name (git-file-name name version))
+               (sha256
+                (base32
+                 "1x8pvlfy3b87iqxh2bjzjd4w26fllwd25c4haz9rqkrvrl27nx38"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         (add-after 'configure 'patch-makefile
-           (lambda _
+         (add-after 'unpack 'patch-build-scripts
+           (lambda* (#:key inputs #:allow-other-keys)
+             (delete-file "autogen.sh") ; Want network access
+             (substitute* "configure.ac"
+               (("/usr/include/catch")
+                (string-append (assoc-ref inputs "catch") "/include")))
              ;; Do not create log directory.
-             (substitute* "Makefile" ((".*/log/usbguard.*") ""))
+             (substitute* "Makefile.am" ((".*/log/usbguard.*") ""))
              ;; Disable LDAP tests: they use 'sudo'.
              (substitute* "src/Tests/Makefile.am"
                (("WITH_LDAP") "FALSE"))
@@ -452,6 +457,7 @@ applications.")
        ("automake" ,automake)
        ("bash-completion" ,bash-completion)
        ("gdbus-codegen" ,glib "bin")
+       ("libtool" ,libtool)
        ("umockdev" ,umockdev)
        ("xmllint" ,libxml2)
        ("xsltproc" ,libxslt)
-- 
2.26.0





Information forwarded to guix-patches <at> gnu.org:
bug#40996; Package guix-patches. (Mon, 04 May 2020 20:14:02 GMT) Full text and rfc822 format available.

Message #17 received at 40996 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: 40996 <at> debbugs.gnu.org
Subject: Re: [bug#40996] [PATCH 1/3] gnu: Add pegtl.
Date: Mon, 04 May 2020 22:13:25 +0200
Hi!

Brice Waegeneire <brice <at> waegenei.re> skribis:

> * gnu/packages/cpp.scm (pegtl): New variable.

[...]

> +(define-public pegtl
> +    (package
      ^
Indentation is off.

> +      (synopsis "Parsing Expression Grammar Template Library")

I’d remove at least the capital T and L.  :-)

Otherwise LGTM!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#40996; Package guix-patches. (Mon, 04 May 2020 20:14:02 GMT) Full text and rfc822 format available.

Message #20 received at 40996 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: 40996 <at> debbugs.gnu.org
Subject: Re: [bug#40996] [PATCH 2/3] gnu: usbguard: Use packaged 'pegtl'.
Date: Mon, 04 May 2020 22:13:41 +0200
Brice Waegeneire <brice <at> waegenei.re> skribis:

> * gnu/packages/hardware.scm (usbguard)[arguments]: Remove configure flag
> '--with-bundled-pegtl'.
> [inputs]: Add 'pegtl'

LGTM!




Information forwarded to guix-patches <at> gnu.org:
bug#40996; Package guix-patches. (Mon, 04 May 2020 20:18:01 GMT) Full text and rfc822 format available.

Message #23 received at 40996 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: 40996 <at> debbugs.gnu.org
Subject: Re: [bug#40996] [PATCH 3/3] gnu: usbguard: Fix warning about 'catch'.
Date: Mon, 04 May 2020 22:17:24 +0200
Brice Waegeneire <brice <at> waegenei.re> skribis:

> * gnu/packages/hardware.scm (usgbuard)[source]: Get it from git.
> [arguments]: Rename phase 'patch-makefile' to 'patch-build-scripts',
> adjust it for the source from git and fix 'catch' path.
> [native-inputs]: Add 'libtool'.

[...]

>      (source (origin
> -              (method url-fetch)
> -              (uri (string-append
> -                    "https://github.com/USBGuard/usbguard/releases/download/usbguard-"
> -                    version "/usbguard-" version ".tar.gz"))
> -              (file-name (git-file-name name version))
> -              (sha256
> -               (base32 "0gzhs8s4aka86mkcjib36z54si939ki4bmk46p6v8kln1fixad3j"))))
> +               (method git-fetch)

In this particular case, perhaps you can keep using the tarball, and then…

[...]

> +             (delete-file "autogen.sh") ; Want network access
> +             (substitute* "configure.ac"
> +               (("/usr/include/catch")
> +                (string-append (assoc-ref inputs "catch") "/include")))

… modify ‘configure’ directly, since it’s a simple and unambiguous
change.  That avoids the extra autotools dependencies (actually Autoconf
and Automake were unnecessary before, no?).

Anyway, one way or another, it’s a worthy change, so go for it!

Ludo’.




Reply sent to Brice Waegeneire <brice <at> waegenei.re>:
You have taken responsibility. (Thu, 07 May 2020 09:34:01 GMT) Full text and rfc822 format available.

Notification sent to Brice Waegeneire <brice <at> waegenei.re>:
bug acknowledged by developer. (Thu, 07 May 2020 09:34:01 GMT) Full text and rfc822 format available.

Message #28 received at 40996-done <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 40996-done <at> debbugs.gnu.org
Subject: Re: [bug#40996] [PATCH 3/3] gnu: usbguard: Fix warning about 'catch'.
Date: Thu, 07 May 2020 09:33:04 +0000
On 2020-05-04 20:17, Ludovic Courtès wrote:
> Brice Waegeneire <brice <at> waegenei.re> skribis:
> 
>> * gnu/packages/hardware.scm (usgbuard)[source]: Get it from git.
>> [arguments]: Rename phase 'patch-makefile' to 'patch-build-scripts',
>> adjust it for the source from git and fix 'catch' path.
>> [native-inputs]: Add 'libtool'.
> 
> [...]
> 
>>      (source (origin
>> -              (method url-fetch)
>> -              (uri (string-append
>> -                    
>> "https://github.com/USBGuard/usbguard/releases/download/usbguard-"
>> -                    version "/usbguard-" version ".tar.gz"))
>> -              (file-name (git-file-name name version))
>> -              (sha256
>> -               (base32 
>> "0gzhs8s4aka86mkcjib36z54si939ki4bmk46p6v8kln1fixad3j"))))
>> +               (method git-fetch)
> 
> In this particular case, perhaps you can keep using the tarball, and 
> then…

This part has been dropped.

> [...]
> 
>> +             (delete-file "autogen.sh") ; Want network access
>> +             (substitute* "configure.ac"
>> +               (("/usr/include/catch")
>> +                (string-append (assoc-ref inputs "catch") 
>> "/include")))
> 
> … modify ‘configure’ directly, since it’s a simple and unambiguous
> change.  That avoids the extra autotools dependencies (actually 
> Autoconf
> and Automake were unnecessary before, no?).

Autotools dependencies were needed because I was patching Makefile.am 
files,
but it's not the case anymore by modifying Makefile.in instead.

> Anyway, one way or another, it’s a worthy change, so go for it!

Pushed as f96ddb60962703eaae5433399905b9d81a99ea13.

- Brice




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 04 Jun 2020 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 67 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.