From 0d9f1f15cb0ce1e71943bff9a68e6839d0eae497 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Fri, 4 Mar 2022 19:32:32 +0100 Subject: import: Add hex.pm importer. 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. --- guix/build-system/rebar.scm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'guix/build-system') diff --git a/guix/build-system/rebar.scm b/guix/build-system/rebar.scm index 8a8fb7708c..6ca5abe4d6 100644 --- a/guix/build-system/rebar.scm +++ b/guix/build-system/rebar.scm @@ -26,20 +26,35 @@ #:use-module (guix search-paths) #:use-module (guix build-system) #:use-module (guix build-system gnu) - #:use-module ((guix hexpm-download) #:select (hexpm-uri) #:prefix dl:) #:use-module (ice-9 match) #:use-module (srfi srfi-26) #:export (hexpm-uri + hexpm-package-url %rebar-build-system-modules rebar-build rebar-build-system)) +;;; +;;; Definitions for the hex.pm repository, +;;; + +;; URL and paths from +;; https://github.com/hexpm/specifications/blob/master/endpoints.md +(define %hexpm-repo-url + (make-parameter "https://repo.hex.pm")) + +(define hexpm-package-url + (string-append (%hexpm-repo-url) "/tarballs/")) + +(define (hexpm-uri name version) + "Return a URI string for the package hosted at hex.pm corresponding to NAME +and VERSION." + (string-append hexpm-package-url name "-" version ".tar")) + ;; ;; Standard build procedure for Erlang packages using Rebar. ;; -(define hexpm-uri dl:hexpm-uri) - (define %rebar-build-system-modules ;; Build-side modules imported by default. `((guix build rebar-build-system) -- cgit v1.2.3