diff mbox series

[bug#49929] gnu: Add gmid.

Message ID YQ7Pkgbsmw1Jxwwq@kurosawa.casa.net
State Accepted
Headers show
Series [bug#49929] gnu: Add gmid. | expand

Checks

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

Commit Message

cage Aug. 7, 2021, 6:23 p.m. UTC
---
 gnu/packages/networking.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

Comments

Maxim Cournoyer Feb. 24, 2022, 4:33 a.m. UTC | #1
tags 49929 moreinfo
--

Hello!

cage <cage-dev@twistfold.it> writes:

> ---
>  gnu/packages/networking.scm | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
>
> diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
> index 05fd092b23..0ea07f0f15 100644
> --- a/gnu/packages/networking.scm
> +++ b/gnu/packages/networking.scm
> @@ -44,6 +44,7 @@
>  ;;; Copyright © 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
>  ;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li>
>  ;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
> +;;; Copyright © 2021 cage <cage-dev@twistfold.it>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -4177,3 +4178,38 @@ public key authentication and Kerberos single-sign-on.  It also includes
>  command-line @acronym{SFTP} and @acronym{SCP} implementations.")
>      (home-page "https://www.chiark.greenend.org.uk/~sgtatham/putty/")
>      (license license:expat)))
> +
> +(define-public gmid
> +  (package
> +    (name "gmid")
> +    (version "1.7.2")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "https://github.com/omar-polo/gmid/releases/download/"
> +                           version "/gmid-" version ".tar.gz"))
> +       (sha256
> +        (base32 "0ag5zcwnr5vmy13bc9c36hnv9pflks68b0k6w0ng97inrm37klis"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:tests? #f                    ;no tests

Apparently, the Makefile has a 'regress' target [0] to run a test suite
(the project has a CI enabled, in doubt you can refer to their CI
recipe).

[0]  https://github.com/omar-polo/gmid/blob/master/Makefile

> +       #:phases
> +       (modify-phases %standard-phases
> +         (replace 'configure
> +           ;; The configure script is hand-written, not from GNU autotools.
> +           (lambda* (#:key configure-flags inputs outputs #:allow-other-keys)
> +             (let ((prefix (string-append "PREFIX=" (assoc-ref outputs "out"))))
> +               (setenv "CC" ,(cc-for-target))
> +               (apply invoke "./configure" (list prefix))
> +               #t))))))

Ending phases by #t is obsolete (you can drop it), and you can more
simply write (invoke "./configure" (string-append #$output)), as long as
you replace the backquoted arguments list by a simple (list ...) and
define the phases as a G-exp, e.g.: #~(modify-phases [...])

> +    (native-inputs
> +     `(("pkg-config" ,pkg-config)
> +       ("bison" ,bison)
> +       ("flex" ,flex)))
> +    (inputs
> +     `(("libevent"  ,libevent)
> +       ("libressl"  ,libressl)))

You can use the new style for inputs, as explained in this blog post [1]

[1]  https://guix.gnu.org/en/blog/2021/the-big-change/

> +    (home-page "https://git.omarpolo.com/gmid/about/")
> +    (synopsis "Simple and secure Gemini server")
> +    (description "Gmid is a fast Gemini server written with security in mind.")
> +    (license license:x11)))

The rest looks good to me, well done!

Could you send an update with changes along these lines?

Thank you,

Maxim
diff mbox series

Patch

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index 05fd092b23..0ea07f0f15 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -44,6 +44,7 @@ 
 ;;; Copyright © 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li>
 ;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2021 cage <cage-dev@twistfold.it>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4177,3 +4178,38 @@  public key authentication and Kerberos single-sign-on.  It also includes
 command-line @acronym{SFTP} and @acronym{SCP} implementations.")
     (home-page "https://www.chiark.greenend.org.uk/~sgtatham/putty/")
     (license license:expat)))
+
+(define-public gmid
+  (package
+    (name "gmid")
+    (version "1.7.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/omar-polo/gmid/releases/download/"
+                           version "/gmid-" version ".tar.gz"))
+       (sha256
+        (base32 "0ag5zcwnr5vmy13bc9c36hnv9pflks68b0k6w0ng97inrm37klis"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                    ;no tests
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           ;; The configure script is hand-written, not from GNU autotools.
+           (lambda* (#:key configure-flags inputs outputs #:allow-other-keys)
+             (let ((prefix (string-append "PREFIX=" (assoc-ref outputs "out"))))
+               (setenv "CC" ,(cc-for-target))
+               (apply invoke "./configure" (list prefix))
+               #t))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("bison" ,bison)
+       ("flex" ,flex)))
+    (inputs
+     `(("libevent"  ,libevent)
+       ("libressl"  ,libressl)))
+    (home-page "https://git.omarpolo.com/gmid/about/")
+    (synopsis "Simple and secure Gemini server")
+    (description "Gmid is a fast Gemini server written with security in mind.")
+    (license license:x11)))