diff mbox series

[bug#40996,3/3] gnu: usbguard: Fix warning about 'catch'.

Message ID 20200501130930.5888-3-brice@waegenei.re
State Accepted
Headers show
Series Fix usbguard's warning about 'catch'. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Brice Waegeneire May 1, 2020, 1:09 p.m. UTC
* 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(-)

Comments

Ludovic Courtès May 4, 2020, 8:17 p.m. UTC | #1
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’.
Brice Waegeneire May 7, 2020, 9:33 a.m. UTC | #2
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
diff mbox series

Patch

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)