unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#40996] [PATCH 0/3] Fix usbguard's warning about 'catch'.
@ 2020-05-01 13:06 Brice Waegeneire
  2020-05-01 13:09 ` [bug#40996] [PATCH 1/3] gnu: Add pegtl Brice Waegeneire
  0 siblings, 1 reply; 8+ messages in thread
From: Brice Waegeneire @ 2020-05-01 13:06 UTC (permalink / raw)
  To: 40996

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#40996] [PATCH 1/3] gnu: Add pegtl.
  2020-05-01 13:06 [bug#40996] [PATCH 0/3] Fix usbguard's warning about 'catch' Brice Waegeneire
@ 2020-05-01 13:09 ` Brice Waegeneire
  2020-05-01 13:09   ` [bug#40996] [PATCH 2/3] gnu: usbguard: Use packaged 'pegtl' Brice Waegeneire
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Brice Waegeneire @ 2020-05-01 13:09 UTC (permalink / raw)
  To: 40996

* 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@nixo.xyz>
 ;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020 Brice Waegeneire <brice@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





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#40996] [PATCH 2/3] gnu: usbguard: Use packaged 'pegtl'.
  2020-05-01 13:09 ` [bug#40996] [PATCH 1/3] gnu: Add pegtl Brice Waegeneire
@ 2020-05-01 13:09   ` Brice Waegeneire
  2020-05-04 20:13     ` Ludovic Courtès
  2020-05-01 13:09   ` [bug#40996] [PATCH 3/3] gnu: usbguard: Fix warning about 'catch' Brice Waegeneire
  2020-05-04 20:13   ` [bug#40996] [PATCH 1/3] gnu: Add pegtl Ludovic Courtès
  2 siblings, 1 reply; 8+ messages in thread
From: Brice Waegeneire @ 2020-05-01 13:09 UTC (permalink / raw)
  To: 40996

* 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





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#40996] [PATCH 3/3] gnu: usbguard: Fix warning about 'catch'.
  2020-05-01 13:09 ` [bug#40996] [PATCH 1/3] gnu: Add pegtl Brice Waegeneire
  2020-05-01 13:09   ` [bug#40996] [PATCH 2/3] gnu: usbguard: Use packaged 'pegtl' Brice Waegeneire
@ 2020-05-01 13:09   ` Brice Waegeneire
  2020-05-04 20:17     ` Ludovic Courtès
  2020-05-04 20:13   ` [bug#40996] [PATCH 1/3] gnu: Add pegtl Ludovic Courtès
  2 siblings, 1 reply; 8+ messages in thread
From: Brice Waegeneire @ 2020-05-01 13:09 UTC (permalink / raw)
  To: 40996

* 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





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#40996] [PATCH 1/3] gnu: Add pegtl.
  2020-05-01 13:09 ` [bug#40996] [PATCH 1/3] gnu: Add pegtl Brice Waegeneire
  2020-05-01 13:09   ` [bug#40996] [PATCH 2/3] gnu: usbguard: Use packaged 'pegtl' Brice Waegeneire
  2020-05-01 13:09   ` [bug#40996] [PATCH 3/3] gnu: usbguard: Fix warning about 'catch' Brice Waegeneire
@ 2020-05-04 20:13   ` Ludovic Courtès
  2 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2020-05-04 20:13 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 40996

Hi!

Brice Waegeneire <brice@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’.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#40996] [PATCH 2/3] gnu: usbguard: Use packaged 'pegtl'.
  2020-05-01 13:09   ` [bug#40996] [PATCH 2/3] gnu: usbguard: Use packaged 'pegtl' Brice Waegeneire
@ 2020-05-04 20:13     ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2020-05-04 20:13 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 40996

Brice Waegeneire <brice@waegenei.re> skribis:

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

LGTM!




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#40996] [PATCH 3/3] gnu: usbguard: Fix warning about 'catch'.
  2020-05-01 13:09   ` [bug#40996] [PATCH 3/3] gnu: usbguard: Fix warning about 'catch' Brice Waegeneire
@ 2020-05-04 20:17     ` Ludovic Courtès
  2020-05-07  9:33       ` bug#40996: " Brice Waegeneire
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2020-05-04 20:17 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 40996

Brice Waegeneire <brice@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’.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40996: [PATCH 3/3] gnu: usbguard: Fix warning about 'catch'.
  2020-05-04 20:17     ` Ludovic Courtès
@ 2020-05-07  9:33       ` Brice Waegeneire
  0 siblings, 0 replies; 8+ messages in thread
From: Brice Waegeneire @ 2020-05-07  9:33 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 40996-done

On 2020-05-04 20:17, Ludovic Courtès wrote:
> Brice Waegeneire <brice@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




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-07  9:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01 13:06 [bug#40996] [PATCH 0/3] Fix usbguard's warning about 'catch' Brice Waegeneire
2020-05-01 13:09 ` [bug#40996] [PATCH 1/3] gnu: Add pegtl Brice Waegeneire
2020-05-01 13:09   ` [bug#40996] [PATCH 2/3] gnu: usbguard: Use packaged 'pegtl' Brice Waegeneire
2020-05-04 20:13     ` Ludovic Courtès
2020-05-01 13:09   ` [bug#40996] [PATCH 3/3] gnu: usbguard: Fix warning about 'catch' Brice Waegeneire
2020-05-04 20:17     ` Ludovic Courtès
2020-05-07  9:33       ` bug#40996: " Brice Waegeneire
2020-05-04 20:13   ` [bug#40996] [PATCH 1/3] gnu: Add pegtl Ludovic Courtès

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).