diff mbox series

[bug#49705] gnu: gmnisrv: Fix configure flags.

Message ID 7109666ab6ca0797c583fe62942342a9b0a1be89.1627027028.git.iskarian@mgsn.dev
State Accepted
Headers show
Series [bug#49705] gnu: gmnisrv: Fix configure flags. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Sarah Morgensen July 23, 2021, 8:07 a.m. UTC
Remove the dependency on /etc/mime.types (fixes #49233). Look in /etc
for configuration files rather than /gnu/store/...-gmnisrv.../etc.

* gnu/packages/web.scm (gmnisrv)[arguments]<#:phases> Move logic to...
<#:tests?>: ...here...
<#:make-flags>: ...and here.
<#:configure-flags>: Set --sysconfdir and --with-mimedb.
[propagated-inputs]: Move mailcap to...
[inputs]: ...here (/etc/mime.types is no longer needed).
---
Built, linted, and manually tested. Fixes <https://issues.guix.gnu.org/49233>.

 gnu/packages/web.scm | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)


base-commit: 89ea0918a4a6cc9c250b85c0b713e471b7769c48

Comments

Arun Isaac July 25, 2021, 2:23 p.m. UTC | #1
Hi Sarah,

Thank you for improving our gmnisrv package!

> +         #:make-flags '("CC=gcc")))

This should be (list (string-append "CC=" ,(cc-for-target))) so that the
package cross-compiles correctly. Hard-coding CC=gcc is now deprecated
practice.

I also feel that this patch should be split into at least two patches or
maybe even three. This way, the first line summary in the commit message
is much more descriptive of the change.

1. gnu: gmnisrv: Remove dependency on /etc/mime.types.
2. gnu: gmnisrv: Cross-compile.
3. gnu: gmnisrv: Disable tests using tests?.

WDYT? Feel free to combine patches 2 and 3 if that splitting is a bit
excessive.

Thanks,
Arun
Sarah Morgensen July 25, 2021, 8:37 p.m. UTC | #2
Hi,

Same as before, but with s/gcc/(cc-for-target)/, and split apart.

Arun, thanks for the pointers (and the copyright line; how do I still
forget?)

--
Sarah Morgensen (4):
  gnu: gmnisrv: Disable tests using #:tests?.
  gnu: gmnisrv: Use #:make-flags, and cross-compile.
  gnu: gmnisrv: Remove dependency on /etc/mime.types.
  gnu: gmnisrv: Fix configuration search path.

 gnu/packages/web.scm | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)


base-commit: b81ab18404a684817166dbac260e5a8c68b35389
Arun Isaac July 26, 2021, 9:18 p.m. UTC | #3
Hi Sarah,

> Same as before, but with s/gcc/(cc-for-target)/, and split apart.

Thank you! Pushed with only minor cosmetic changes.

> (and the copyright line; how do I still forget?)

I forget sometimes too. We really need a patch linter to check for this.

Regards,
Arun
diff mbox series

Patch

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 2cc8619b19..12ba55cdc8 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -7985,20 +7985,19 @@  solution for any project's interface needs:
                 (file-name (git-file-name name version))))
       (build-system gnu-build-system)
       (arguments
-       `(#:phases
-         (modify-phases %standard-phases
-           (add-before 'configure 'set-variables
-             (lambda _
-               (setenv "CC" "gcc")
-               #t))
-           (delete 'check))))
+       `(#:tests? #f ; no tests
+         #:configure-flags
+         (list "--sysconfdir=/etc"
+               (string-append "--with-mimedb="
+                              (assoc-ref %build-inputs "mailcap")
+                              "/etc/mime.types"))
+         #:make-flags '("CC=gcc")))
       (inputs
-       `(("openssl" ,openssl)))
+       `(("mailcap" ,mailcap)
+         ("openssl" ,openssl)))
       (native-inputs
        `(("pkg-config" ,pkg-config)
          ("scdoc" ,scdoc)))
-      (propagated-inputs
-       `(("mailcap" ,mailcap)))
       (synopsis "Simple Gemini protocol server")
       (description "gmnisrv is a simple Gemini protocol server written in C.")
       (license (list license:gpl3+