GNU bug report logs -
#54796
[PATCH v3 00/22] Add importer for hex.pm and rebar3 build-system for Erlang
Previous Next
Full log
View this message in rfc822 format
Hartmut Goebel <h.goebel <at> 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 <at> gnu.org>
> +;;; Copyright © 2016 David Craven <david <at> craven.ch>
> +;;; Copyright © 2019 Martin Becze <mjbecze <at> riseup.net>
> +;;; Copyright © 2020, 2022 Hartmut Goebel <h.goebel <at> 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 <at> gnu.org>
> +;;; Copyright © 2016 Ricardo Wurmus <rekado <at> elephly.net>
> +;;; Copyright © 2018 Oleg Pykhalov <go.wigust <at> gmail.com>
> +;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
> +;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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’.
This bug report was last modified 2 years and 339 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.