Illustration
Where we document how the Guix build system for Erlang has been implemented.

The goal is to set up a Guix build system for Erlang packages. This will be achieved if we can take any correct Guix package definition for a package from Hex and install it using guix install rebar3-pkg.

So far, we did not find a package that does not build.

A definition of the package is:

(use-modules (guix packages) (guix download) (guix build-system rebar) ((guix licenses) #:prefix license:)) (package (name "erlang-telemetry") (version "1.2.1") (source (origin (method url-fetch) (uri (hexpm-uri "telemetry" version)) (sha256 (base32 "1mgyx9zw92g6w8fp9pblm3b0bghwxwwcbslrixq23ipzisfwxnfs")))) (build-system rebar-build-system) (synopsis "Dynamic dispatching library for metrics and instrumentations") (description "Dynamic dispatching library for metrics and instrumentations.") (home-page "https://hexdocs.pm/telemetry/") (license license:asl2.0))

To build this definition, we followed these steps:

  1. guix import hexpm telemetry > telemetry-package.scm
  2. Try to build using guix build -K -f telemetry-package.scm
  3. While the build fails:
    1. Add the various suggestions i.e. (use-modules (guix packages))
    2. When a symbol is undefined, search it in the Guix source tree i.e. rg -F 'license:asl2.0' ~/src/guix
$ guix build -K -f telemetry-package.scm # … successfully built /gnu/store/…-erlang-telemetry-1.2.1.drv /gnu/store/…-erlang-telemetry-1.2.1