[PATCH] gnu: gmnisrv: Fix configure flags.

  • Done
  • quality assurance status badge
Details
2 participants
  • Arun Isaac
  • Sarah Morgensen
Owner
unassigned
Submitted by
Sarah Morgensen
Severity
normal
S
S
Sarah Morgensen wrote on 23 Jul 2021 10:07
(address . guix-patches@gnu.org)
7109666ab6ca0797c583fe62942342a9b0a1be89.1627027028.git.iskarian@mgsn.dev
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(-)

Toggle diff (38 lines)
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+

base-commit: 89ea0918a4a6cc9c250b85c0b713e471b7769c48
--
2.31.1
A
A
Arun Isaac wrote on 25 Jul 2021 16:23
87fsw2fp5a.fsf@systemreboot.net
Hi Sarah,

Thank you for improving our gmnisrv package!

Toggle quote (2 lines)
> + #: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
-----BEGIN PGP SIGNATURE-----

iQFPBAEBCAA5FiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAmD9c/EbHGFydW5pc2Fh
Y0BzeXN0ZW1yZWJvb3QubmV0AAoJEC4l7othgCuzr88H/1kGJwknOwWBPc2LTOOr
Uv9w2JknRK19qWqFbSnOax4HndMVbHdqWyu7ZARDX5wflCay8eY53HUNrJ5Q+xWh
msxwfifYmInyvhSN3+7X7LsotjKOQx4M61CpksBHS7ojgfBqpGmiitRJUDt78NGw
8rTdJJU/VIY7JuzwN+H2tF0SMIIluSQK3algEIuXku/HT163PKSjv1Fk1vAAD0aC
JTddtBYc/t3lD5+R5uD+y6MpffONikbPVkYwaJnTgd64nTssStsITi5cuPdeYGyD
GCb0HKWRmfGQRXUP7zXkzgNLl4HI1/335lVcm3T3ChrXi490Sp4fivkVxXwJydhz
5v8=
=135u
-----END PGP SIGNATURE-----

S
S
Sarah Morgensen wrote on 25 Jul 2021 22:37
[PATCH v2 0/4] gnu: gmnisrv: Fix configure flags.
(address . 49705@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
cover.1627244897.git.iskarian@mgsn.dev
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
--
2.31.1
S
S
Sarah Morgensen wrote on 25 Jul 2021 22:39
[PATCH v2 1/4] gnu: gmnisrv: Disable tests using #:tests?.
(address . 49705@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
de67b995eccd49ee1cfb0b0c31cf5d731a550d66.1627244897.git.iskarian@mgsn.dev
gnu/packages/web.scm (gmnisrv)[arguments]<#:phases>: Undelete check
phase, and...
<#:tests?>: ...disable tests here instead.
---
gnu/packages/web.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index f229397db4..0ac13112c2 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -7983,13 +7983,13 @@ solution for any project's interface needs:
(file-name (git-file-name name version))))
(build-system gnu-build-system)
(arguments
- `(#:phases
+ `(#:tests? #f ; no check target
+ #:phases
(modify-phases %standard-phases
(add-before 'configure 'set-variables
(lambda _
(setenv "CC" "gcc")
- #t))
- (delete 'check))))
+ #t)))))
(inputs
`(("openssl" ,openssl)))
(native-inputs
--
2.31.1
S
S
Sarah Morgensen wrote on 25 Jul 2021 22:39
[PATCH v2 2/4] gnu: gmnisrv: Use #:make-flags, and cross-compile.
(address . 49705@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
14a188df95b64c0c6d8007b9a8a63c81860d8df5.1627244897.git.iskarian@mgsn.dev
gnu/packages/web.scm (gmnisrv)[arguments]<#:phases>{set-variables}: Move
'CC=' to...
<#:make-flags>: ...here, and support cross-compile with (cc-for-target).
---
gnu/packages/web.scm | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

Toggle diff (21 lines)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 0ac13112c2..b106e7c8b6 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -7984,12 +7984,8 @@ solution for any project's interface needs:
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; no check target
- #:phases
- (modify-phases %standard-phases
- (add-before 'configure 'set-variables
- (lambda _
- (setenv "CC" "gcc")
- #t)))))
+ #:make-flags
+ (list (string-append "CC=" ,(cc-for-target)))))
(inputs
`(("openssl" ,openssl)))
(native-inputs
--
2.31.1
S
S
Sarah Morgensen wrote on 25 Jul 2021 22:39
[PATCH v2 3/4] gnu: gmnisrv: Remove dependency on /etc/mime.types.
(address . 49705@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
b575b1136009376fbd970ff2e420fa178d33ca03.1627244897.git.iskarian@mgsn.dev
Remove the dependency on /etc/mime.types (fixes #49233).

gnu/packages/web.scm (gmnisrv)[arguments]<#:configure-flags>: Set
--with-mimedb to directly use mime.types from mailcap.
[propagated-inputs]: Move mailcap to...
[inputs]: ...here (/etc/mime.types no longer need in profiles).
---
gnu/packages/web.scm | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

Toggle diff (28 lines)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index b106e7c8b6..61465c5d44 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -7984,15 +7984,18 @@ solution for any project's interface needs:
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; no check target
+ #:configure-flags
+ (list (string-append "--with-mimedb="
+ (assoc-ref %build-inputs "mailcap")
+ "/etc/mime.types"))
#:make-flags
(list (string-append "CC=" ,(cc-for-target)))))
(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+
--
2.31.1
S
S
Sarah Morgensen wrote on 25 Jul 2021 22:39
[PATCH v2 4/4] gnu: gmnisrv: Fix configuration search path.
(address . 49705@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
ca9c10f4a84350e2fd4ca8737027d12159cceacb.1627244897.git.iskarian@mgsn.dev
Look in /etc for configuration files rather than
/gnu/store/...-gmnisrv.../etc.

gnu/packages/web.scm (gmnisrv)[arguments]<#:configure-flags>: Set
--sysconfdir.
---
gnu/packages/web.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 61465c5d44..e209f9d21d 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -7985,7 +7985,8 @@ solution for any project's interface needs:
(arguments
`(#:tests? #f ; no check target
#:configure-flags
- (list (string-append "--with-mimedb="
+ (list "--sysconfdir=/etc"
+ (string-append "--with-mimedb="
(assoc-ref %build-inputs "mailcap")
"/etc/mime.types"))
#:make-flags
--
2.31.1
A
A
Arun Isaac wrote on 26 Jul 2021 23:18
Re: [PATCH v2 0/4] gnu: gmnisrv: Fix configure flags.
871r7kg4ex.fsf@systemreboot.net
Hi Sarah,

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

Thank you! Pushed with only minor cosmetic changes.

Toggle quote (2 lines)
> (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
-----BEGIN PGP SIGNATURE-----

iQFPBAEBCAA5FiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAmD/JqYbHGFydW5pc2Fh
Y0BzeXN0ZW1yZWJvb3QubmV0AAoJEC4l7othgCuzVpEH/ROuJT4SJiNFEprkxtoo
2KpAE9m596ZuSl35PyzofQI11/Kdwz58H3yQLoZJcza5szf8VoOJkXhMUGdu/z65
5L/Z0C2N6GGRz3P8s2qUrpsnrA4t7jfftv3ig0Jucvkfyg83RhlUiypnuJgoOmN7
jsap/kGZA+AB6UGhGnuKWyqzj8FRAx4GwQf+UeiMOiTwxzEW9wULY2fdghVsYZU3
TDlZlHVWjBqXdB4HI7bOB7bRl7/9ZEkREVzNm8H38xcjL49QWgwNRN46JSX48EZU
XmDswvp44C/FboYD26zbArUbsVrtPJR3VieVYB1SO1frYWXyjQ8vnUh+sFKY0XDO
xsM=
=Ks7X
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 49705@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 49705
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch