guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#54796] [PATCH v3 00/22] Add importer for hex.pm and rebar3 build-sy


From: Ludovic Courtès
Subject: [bug#54796] [PATCH v3 00/22] Add importer for hex.pm and rebar3 build-system for Erlang
Date: Fri, 29 Apr 2022 15:13:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> hex.pm is a package repository for Erlang and Elixir.
>
> * guix/scripts/import.scm (importers): Add "hexpm".
> * guix/scripts/import/hexpm.scm, guix/import/hexpm.scm,
>   guix/hexpm-download.scm: New files.
> * guix/import/utils.scm (source-spec->object): Add "hexpm-fetch" to list of
>   fetch methods.
> * guix/upstream.scm (package-update/hexpm-fetch): New function.
>   (%method-updates) Add it.
> * Makefile.am: Add them.

Please mention tests/hexpm.scm.


[...]

> +(define-module (guix hexpm-download)
> +  #:use-module (srfi srfi-26)
> +  #:export (hexpm-package-url
> +            hexpm-uri))

How about moving these two procedures to (guix build-system rebar3)?
This is what is done in similar cases, for example with ‘pypi-uri’.

> +++ b/guix/scripts/import/hexpm.scm
> @@ -0,0 +1,109 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2014 David Thompson <davet@gnu.org>
> +;;; Copyright © 2016 David Craven <david@craven.ch>
> +;;; Copyright © 2019 Martin Becze <mjbecze@riseup.net>
> +;;; Copyright © 2020, 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>

I think it’s fine to keep just your name here; it’s a short file and one
could argue that the bits found in all these files aren’t inventive.  :-)

> +  #:use-module (srfi srfi-11)
> +  #:use-module (srfi srfi-71)

I think you can drop these two imports.

> +++ b/guix/upstream.scm
> @@ -464,6 +464,7 @@ SOURCE, an <upstream-source>."
>                                          #:key-download key-download)))
>           (values version tarball source))))))
>  
> +

Oops.  :-)

> +++ b/tests/hexpm.scm
> @@ -0,0 +1,257 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2015 David Thompson <davet@gnu.org>
> +;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
> +;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
> +;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
> +;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>

Same comment here.

> +(test-assert "hexpm->guix-package"
> +  ;; Replace network resources with sample data.
> +  (mock ((guix http-client) http-fetch
> +         (lambda (url . rest)

I have a preference for spawning an HTTP server, if that’s possible, as
is done in tests/cpan.scm for instance.

But it’s already been a long ride, so we can keep that for later.

Otherwise LGTM.

Great to see this new importer!

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]