* [bug#42180] [PATCH 01/22] guix: Add extracting-download.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-06 8:08 ` zimoun
2020-07-03 17:43 ` [bug#42180] [PATCH 02/22] guix: Add importer for hex.pm Hartmut Goebel
` (23 subsequent siblings)
24 siblings, 1 reply; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* guix/extracting-download.scm: New file
* Makefile.am (MODULES): Add it.
---
Makefile.am | 1 +
| 172 +++++++++++++++++++++++++++++++++++
2 files changed, 173 insertions(+)
create mode 100644 guix/extracting-download.scm
diff --git a/Makefile.am b/Makefile.am
index 8988cdfa12..71c90e0c27 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -81,6 +81,7 @@ MODULES = \
guix/download.scm \
guix/discovery.scm \
guix/bzr-download.scm \
+ guix/extracting-download.scm \
guix/git-download.scm \
guix/hg-download.scm \
guix/swh.scm \
--git a/guix/extracting-download.scm b/guix/extracting-download.scm
new file mode 100644
index 0000000000..e2dc5643e2
--- /dev/null
+++ b/guix/extracting-download.scm
@@ -0,0 +1,172 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017 Mathieu Lirzin <mthl@gnu.org>
+;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix extracting-download)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 popen)
+ #:use-module ((guix build download) #:prefix build:)
+ #:use-module (guix build utils)
+ #:use-module (guix gexp)
+ #:use-module (guix modules)
+ #:use-module (guix monads)
+ #:use-module (guix packages) ;; for %current-system
+ #:use-module (guix store)
+ #:use-module (guix utils)
+ #:use-module (srfi srfi-26)
+ #:export (http-fetch/extract
+ download-to-store/extract))
+
+;;;
+;;; Produce fixed-output derivations with data extracted from n archive
+;;; fetched over HTTP or FTP.
+;;;
+;;; This is meant to be used for package repositories where the actual source
+;;; archive is packed into another archive, eventually carrying meta-data.
+;;; Using this derivation saves both storing the outer archive and extracting
+;;; the actual one at build time. The hash is calculated on the actual
+;;; archive to ease validating the stored file.
+;;;
+
+(define* (http-fetch/extract url filename-to-extract hash-algo hash
+ #:optional name
+ #:key (system (%current-system)) (guile (default-guile)))
+ "Return a fixed-output derivation that fetches an archive at URL, and
+extracts FILE_TO_EXTRACT from the archive. The FILE_TO_EXTRACT is expected to
+have hash HASH of type HASH-ALGO (a symbol). By default, the file name is the
+base name of URL; optionally, NAME can specify a different file name."
+ (define file-name
+ (match url
+ ((head _ ...)
+ (basename head))
+ (_
+ (basename url))))
+
+ (define gnutls
+ (module-ref (resolve-interface '(gnu packages tls)) 'gnutls))
+
+ (define inputs
+ `(("tar" ,(module-ref (resolve-interface '(gnu packages base))
+ 'tar))))
+
+ (define config.scm
+ (scheme-file "config.scm"
+ #~(begin
+ (define-module (guix config)
+ #:export (%system))
+
+ (define %system
+ #$(%current-system)))))
+
+ (define modules
+ (cons `((guix config) => ,config.scm)
+ (delete '(guix config)
+ (source-module-closure '((guix build download)
+ (guix build utils)
+ (guix utils)
+ (web uri))))))
+
+ (define build
+ (with-imported-modules modules
+ (with-extensions (list gnutls)
+ #~(begin
+ (use-modules (guix build download)
+ (guix build utils)
+ (guix utils)
+ (web uri)
+ (ice-9 match)
+ (ice-9 popen))
+ ;; The code below expects tar to be in $PATH.
+ (set-path-environment-variable "PATH" '("bin")
+ (match '#+inputs
+ (((names dirs outputs ...) ...)
+ dirs)))
+
+ (setvbuf (current-output-port) 'line)
+ (setvbuf (current-error-port) 'line)
+
+ (call-with-temporary-directory
+ (lambda (directory)
+ ;; TODO: Support different archive types, based on content-type
+ ;; or archive name extention.
+ (let* ((file-to-extract (getenv "extract filename"))
+ (port (http-fetch (string->uri (getenv "download url"))
+ #:verify-certificate? #f))
+ (tar (open-pipe* OPEN_WRITE "tar" "-C" directory
+ "-xf" "-" file-to-extract)))
+ (dump-port port tar)
+ (close-port port)
+ (let ((status (close-pipe tar)))
+ (unless (zero? status)
+ (error "tar extraction failure" status)))
+ (copy-file (string-append directory "/"
+ (getenv "extract filename"))
+ #$output))))))))
+
+ (mlet %store-monad ((guile (package->derivation guile system)))
+ (gexp->derivation (or name file-name) build
+
+ ;; Use environment variables and a fixed script name so
+ ;; there's only one script in store for all the
+ ;; downloads.
+ #:script-name "extract-download"
+ #:env-vars
+ `(("download url" . ,url)
+ ("extract filename" . ,filename-to-extract))
+ #:leaked-env-vars '("http_proxy" "https_proxy"
+ "LC_ALL" "LC_MESSAGES" "LANG"
+ "COLUMNS")
+ #:system system
+ #:local-build? #t ; don't offload download
+ #:hash-algo hash-algo
+ #:hash hash
+ #:guile-for-build guile)))
+
+
+(define* (download-to-store/extract store url filename-to-extract
+ #:optional (name (basename url))
+ #:key (log (current-error-port))
+ (verify-certificate? #t))
+ "Download an archive from URL, and extracts FILE_TO_EXTRACT from the archive
+to STORE, either under NAME or URL's basename if omitted. Write progress
+reports to LOG. VERIFY-CERTIFICATE? determines whether or not to validate
+HTTPS server certificates."
+ (call-with-temporary-output-file
+ (lambda (temp port)
+ (let ((result
+ (parameterize ((current-output-port log))
+ (build:url-fetch url temp
+ ;;#:mirrors %mirrors
+ #:verify-certificate?
+ verify-certificate?))))
+ (close port)
+ (and result
+ (call-with-temporary-output-file
+ (lambda (contents port)
+ (let ((tar (open-pipe* OPEN_READ
+ "tar" ;"--auto-compress"
+ "-xf" temp "--to-stdout" filename-to-extract)))
+ (dump-port tar port)
+ (close-port port)
+ (let ((status (close-pipe tar)))
+ (unless (zero? status)
+ (error "tar extraction failure" status)))
+ (add-to-store store name #f "sha256" contents)))))))))
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 01/22] guix: Add extracting-download.
2020-07-03 17:43 ` [bug#42180] [PATCH 01/22] guix: Add extracting-download Hartmut Goebel
@ 2020-07-06 8:08 ` zimoun
2020-07-06 8:15 ` Hartmut Goebel
0 siblings, 1 reply; 78+ messages in thread
From: zimoun @ 2020-07-06 8:08 UTC (permalink / raw)
To: Hartmut Goebel, 42180
Dear,
Thank you for the patchset.
On Fri, 03 Jul 2020 at 19:43, Hartmut Goebel <h.goebel@crazy-compilers.com> wrote:
> * guix/extracting-download.scm: New file
[...]
> diff --git a/guix/extracting-download.scm b/guix/extracting-download.scm
> new file mode 100644
> index 0000000000..e2dc5643e2
> --- /dev/null
> +++ b/guix/extracting-download.scm
> @@ -0,0 +1,172 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
> +;;; Copyright © 2017 Mathieu Lirzin <mthl@gnu.org>
> +;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
> +;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
> +;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
Why these Copyright if the file is new?
All the best,
simon
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 01/22] guix: Add extracting-download.
2020-07-06 8:08 ` zimoun
@ 2020-07-06 8:15 ` Hartmut Goebel
0 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-06 8:15 UTC (permalink / raw)
To: zimoun, 42180
Am 06.07.20 um 10:08 schrieb zimoun:
> Why these Copyright if the file is new?
Since the code is based on another file (I don#t remember which one) and
these are the Copyrights from that file.
--
Regards
Hartmut Goebel
| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 02/22] guix: Add importer for hex.pm.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 01/22] guix: Add extracting-download Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-11-02 14:18 ` [bug#42180] [PATCH 0/1] " pukkamustard
2020-07-03 17:43 ` [bug#42180] [PATCH 03/22] guix: Add rebar3 build-system Hartmut Goebel
` (22 subsequent siblings)
24 siblings, 1 reply; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* 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.
---
Makefile.am | 3 +
guix/hexpm-download.scm | 73 +++++++++
guix/import/hexpm.scm | 299 ++++++++++++++++++++++++++++++++++
guix/import/utils.scm | 1 +
guix/scripts/import.scm | 2 +-
guix/scripts/import/hexpm.scm | 114 +++++++++++++
guix/upstream.scm | 20 ++-
7 files changed, 510 insertions(+), 2 deletions(-)
create mode 100644 guix/hexpm-download.scm
create mode 100644 guix/import/hexpm.scm
create mode 100644 guix/scripts/import/hexpm.scm
diff --git a/Makefile.am b/Makefile.am
index 71c90e0c27..0847edea19 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -84,6 +84,7 @@ MODULES = \
guix/extracting-download.scm \
guix/git-download.scm \
guix/hg-download.scm \
+ guix/hexpm-download.scm \
guix/swh.scm \
guix/monads.scm \
guix/monad-repl.scm \
@@ -229,6 +230,7 @@ MODULES = \
guix/import/gnome.scm \
guix/import/gnu.scm \
guix/import/hackage.scm \
+ guix/import/hexpm.scm \
guix/import/json.scm \
guix/import/kde.scm \
guix/import/launchpad.scm \
@@ -272,6 +274,7 @@ MODULES = \
guix/scripts/import/gem.scm \
guix/scripts/import/gnu.scm \
guix/scripts/import/hackage.scm \
+ guix/scripts/import/hexpm.scm \
guix/scripts/import/json.scm \
guix/scripts/import/nix.scm \
guix/scripts/import/opam.scm \
diff --git a/guix/hexpm-download.scm b/guix/hexpm-download.scm
new file mode 100644
index 0000000000..69d0cf285c
--- /dev/null
+++ b/guix/hexpm-download.scm
@@ -0,0 +1,73 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017 Mathieu Lirzin <mthl@gnu.org>
+;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix hexpm-download)
+ #:use-module (ice-9 match)
+ #:use-module (guix extracting-download)
+ #:use-module (guix packages) ;; for %current-system
+ #:use-module (srfi srfi-26)
+ #:export (hexpm-fetch
+
+ %hexpm-repo-url
+ hexpm-url
+ hexpm-url?
+ hexpm-uri))
+
+;;;
+;;; An <origin> method that fetches a package from the hex.pm repository,
+;;; unwrapping the actual content from the download tarball.
+;;;
+
+(define %hexpm-repo-url
+ (make-parameter "https://repo.hex.pm"))
+(define hexpm-url
+ (string-append (%hexpm-repo-url) "/tarballs/"))
+(define hexpm-url?
+ (cut string-prefix? hexpm-url <>))
+
+(define (hexpm-uri name version)
+ "Return a URI string for the package hosted at hex.pm corresponding to NAME
+and VERSION."
+ (string-append hexpm-url name "-" version ".tar"))
+
+(define* (hexpm-fetch url hash-algo hash
+ #:optional name
+ #:key
+ (filename-to-extract "contents.tar.gz")
+ (system (%current-system)) (guile (default-guile)))
+ "Return a fixed-output derivation that fetches URL and extracts
+\"contents.tar.gz\". The output is expected to have hash HASH of type
+HASH-ALGO (a symbol). By default, the file name is the base name of URL;
+optionally, NAME can specify a different file name. By default, the file name
+is the base name of URL with \".gz\" appended; optionally, NAME can specify a
+different file name."
+ (define file-name
+ (match url
+ ((head _ ...)
+ (basename head))
+ (_
+ (basename url))))
+
+ (http-fetch/extract url "contents.tar.gz" hash-algo hash
+ ;; urls typically end with .tar, but contents is .tar.gz
+ (or name (string-append file-name ".gz"))
+ #:system system #:guile guile))
diff --git a/guix/import/hexpm.scm b/guix/import/hexpm.scm
new file mode 100644
index 0000000000..5c846e990b
--- /dev/null
+++ b/guix/import/hexpm.scm
@@ -0,0 +1,299 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com>
+;;; Copyright © 2016 David Craven <david@craven.ch>
+;;; Copyright © 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix import hexpm)
+ #:use-module (guix base32)
+ #:use-module ((guix download) #:prefix download:)
+ #:use-module (guix hexpm-download)
+ #:use-module (gcrypt hash)
+ #:use-module (guix http-client)
+ #:use-module (guix json)
+ #:use-module (guix import json)
+ #:use-module (guix import utils)
+ #:use-module ((guix build utils)
+ #:select ((package-name->name+version
+ . hyphen-package-name->name+version)
+ dump-port))
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix monads)
+ #:use-module (guix packages)
+ #:use-module (guix upstream)
+ #:use-module (guix utils)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 regex)
+ #:use-module (ice-9 popen)
+ #:use-module (json)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-2)
+ #:use-module (srfi srfi-26)
+ #:export (hexpm->guix-package
+ guix-package->hexpm-name
+ strings->licenses
+ hexpm-recursive-import
+ %hexpm-updater))
+
+\f
+;;;
+;;; Interface to https://hex.pm/api, version 2.
+;;;
+
+(define %hexpm-api-url
+ (make-parameter "https://hex.pm/api"))
+
+(define (package-url name)
+ (string-append (%hexpm-api-url) "/packages/" name))
+
+;; Hexpm Package. /api/packages/${name}
+;; It can have several "releases", each of which has its own set of
+;; requirements, buildtool, etc. - see <hexpm-release> below.
+(define-json-mapping <hexpm-pkgdef> make-hexpm-pkgdef hexpm-pkgdef?
+ json->hexpm
+ (name hexpm-name) ;string
+ (html-url hexpm-html-url "html_url") ;string
+ (docs-html-url hexpm-docs-html-url "docs_html_url") ;string | #nil
+ (meta hexpm-meta "meta" json->hexpm-meta)
+ (versions hexpm-versions "releases" ;list of <hexpm-version>
+ (lambda (vector)
+ (map json->hexpm-version
+ (vector->list vector)))))
+
+;; Hexpm meta.
+(define-json-mapping <hexpm-meta> make-hexpm-meta hexpm-meta?
+ json->hexpm-meta
+ (description hexpm-meta-description) ;string
+ (licenses hexpm-meta-licenses "licenses" ;list of strings
+ (lambda (vector)
+ (or (and vector (vector->list vector))
+ #f))))
+
+;; Hexpm version.
+(define-json-mapping <hexpm-version> make-hexpm-version hexpm-version?
+ json->hexpm-version
+ (number hexpm-version-number "version") ;string
+ (url hexpm-version-url)) ;string
+
+
+(define (lookup-hexpm name)
+ "Look up NAME on https://hex.pm and return the corresopnding <hexpm>
+record or #f if it was not found."
+ (let ((json (json-fetch (package-url name))))
+ (and json
+ (json->hexpm json))))
+
+;; Hexpm release. /api/packages/${name}/releases/${version}
+(define-json-mapping <hexpm-release> make-hexpm-release hexpm-release?
+ json->hexpm-release
+ (number hexpm-release-number "version") ;string
+ (url hexpm-release-url) ;string
+ (requirements hexpm-requirements "requirements")) ;list of <hexpm-dependency>
+;; meta:build_tools -> alist
+
+;; Hexpm dependency. Each dependency (each edge in the graph) is annotated as
+;; being a "normal" dependency or a development dependency. There also
+;; information about the minimum required version, such as "^0.0.41".
+(define-json-mapping <hexpm-dependency> make-hexpm-dependency
+ hexpm-dependency?
+ json->hexpm-dependency
+ (app hexpm-dependency-app "app") ;string
+ (optional hexpm-dependency-optional) ;bool
+ (requirement hexpm-dependency-requirement)) ;string
+
+(define (hexpm-release-dependencies release)
+ "Return the list of dependency names of RELEASE, a <hexpm-release>."
+ (let ((reqs (or (hexpm-requirements release) '#())))
+ (map first reqs))) ;; TODO: also return required version
+
+
+(define (lookup-hexpm-release version*)
+ "Look up RELEASE on hexpm-version-url and return the corresopnding
+<hexpm-release> record or #f if it was not found."
+ (let* ((url (hexpm-version-url version*))
+ (json (json-fetch url)))
+ (json->hexpm-release json)))
+
+\f
+;;;
+;;; Converting hex.pm packages to Guix packages.
+;;;
+
+(define (maybe-arguments arguments)
+ (match arguments
+ (()
+ '())
+ ((args ...)
+ `((arguments (,'quasiquote ,args))))))
+
+(define* (make-hexpm-sexp #:key name version tarball-url
+ home-page synopsis description license
+ #:allow-other-keys)
+ "Return the `package' s-expression for a rust package with the given NAME,
+VERSION, tarball-url, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
+ (call-with-temporary-directory
+ (lambda (directory)
+ (let ((port (http-fetch tarball-url))
+ (tar (open-pipe* OPEN_WRITE "tar" "-C" directory
+ "-xf" "-" "contents.tar.gz")))
+ (dump-port port tar)
+ (close-port port)
+
+ (let ((status (close-pipe tar)))
+ (unless (zero? status)
+ (error "tar extraction failure" status))))
+
+ (let ((guix-name (hexpm-name->package-name name))
+ (sha256 (bytevector->nix-base32-string
+ (call-with-input-file
+ (string-append directory "/contents.tar.gz")
+ port-sha256))))
+
+ `(package
+ (name ,guix-name)
+ (version ,version)
+ (source (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri ,name version))
+ (sha256 (base32 ,sha256))))
+ (build-system ,'rebar3-build-system)
+ (home-page ,(match home-page
+ (() "")
+ (_ home-page)))
+ (synopsis ,synopsis)
+ (description ,(beautify-description description))
+ (license ,(match license
+ (() #f)
+ ((license) license)
+ (_ `(list ,@license)))))))))
+
+(define (strings->licenses strings)
+ (filter-map (lambda (license)
+ (and (not (string-null? license))
+ (not (any (lambda (elem) (string=? elem license))
+ '("AND" "OR" "WITH")))
+ (or (spdx-string->license license)
+ license)))
+ strings))
+
+(define (hexpm-latest-version package)
+ (let ((versions (map hexpm-version-number (hexpm-versions package))))
+ (fold (lambda (a b)
+ (if (version>? a b) a b)) (car versions) versions)))
+
+(define* (hexpm->guix-package package-name #:optional version)
+ "Fetch the metadata for PACKAGE-NAME from hexpms.io, and return the
+`package' s-expression corresponding to that package, or #f on failure.
+When VERSION is specified, attempt to fetch that version; otherwise fetch the
+latest version of PACKAGE-NAME."
+
+ (define package
+ (lookup-hexpm package-name))
+
+ (define version-number
+ (and package
+ (or version
+ (hexpm-latest-version package))))
+
+ (define version*
+ (and package
+ (find (lambda (version)
+ (string=? (hexpm-version-number version)
+ version-number))
+ (hexpm-versions package))))
+
+ (define release
+ (and package version*
+ (lookup-hexpm-release version*)))
+
+ (and package version*
+ (let ((dependencies (hexpm-release-dependencies release))
+ (pkg-meta (hexpm-meta package)))
+ (values
+ (make-hexpm-sexp
+ #:name package-name
+ #:version version-number
+ #:home-page (or (hexpm-docs-html-url package)
+ ;; TODO: Homepage?
+ (hexpm-html-url package))
+ #:synopsis (hexpm-meta-description pkg-meta)
+ #:description (hexpm-meta-description pkg-meta)
+ #:license (or (and=> (hexpm-meta-licenses pkg-meta)
+ strings->licenses))
+ #:tarball-url (hexpm-uri package-name version-number))
+ dependencies))))
+
+(define* (hexpm-recursive-import pkg-name #:optional version)
+ (recursive-import pkg-name #f
+ #:repo->guix-package
+ (lambda (name repo)
+ (let ((version (and (string=? name pkg-name)
+ version)))
+ (hexpm->guix-package name version)))
+ #:guix-name hexpm-name->package-name))
+
+(define (guix-package->hexpm-name package)
+ "Return the hex.pm name of PACKAGE."
+ (define (url->hexpm-name url)
+ (hyphen-package-name->name+version
+ (basename (file-sans-extension url))))
+
+ (match (and=> (package-source package) origin-uri)
+ ((? string? url)
+ (url->hexpm-name url))
+ ((lst ...)
+ (any url->hexpm-name lst))
+ (#f #f)))
+
+(define (hexpm-name->package-name name)
+ (string-append "erlang-" (string-join (string-split name #\_) "-")))
+
+\f
+;;;
+;;; Updater
+;;;
+
+(define (hexpm-package? package)
+ "Return true if PACKAGE is a package from hex.pm."
+ (let ((source-url (and=> (package-source package) origin-uri))
+ (fetch-method (and=> (package-source package) origin-method)))
+ (and (eq? fetch-method hexpm-fetch)
+ (match source-url
+ ((? string?)
+ (hexpm-url? source-url))
+ ((source-url ...)
+ (any hexpm-url? source-url))))))
+
+(define (latest-release package)
+ "Return an <upstream-source> for the latest release of PACKAGE."
+ (let* ((hexpm-name (guix-package->hexpm-name package))
+ (hexpm (lookup-hexpm hexpm-name))
+ (version (hexpm-latest-version hexpm))
+ (url (hexpm-uri hexpm-name version)))
+ (upstream-source
+ (package (package-name package))
+ (version version)
+ (urls (list url)))))
+
+(define %hexpm-updater
+ (upstream-updater
+ (name 'hexpm)
+ (description "Updater for hex.pm packages")
+ (pred hexpm-package?)
+ (latest latest-release)))
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 0cfa1f8321..afd62f9208 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -306,6 +306,7 @@ the expected fields of an <origin> object."
("git-fetch" (@ (guix git-download) git-fetch))
("svn-fetch" (@ (guix svn-download) svn-fetch))
("hg-fetch" (@ (guix hg-download) hg-fetch))
+ ("hexpm-fetch" (@ (guix hexpm-download) hexpm-fetch))
(_ #f)))
(uri (assoc-ref orig "uri"))
(sha256 sha))))))
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index c6cc93fad8..9c0dc2f129 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -76,7 +76,7 @@ rather than \\n."
;;;
(define importers '("gnu" "nix" "pypi" "cpan" "hackage" "stackage" "elpa" "gem"
- "cran" "crate" "texlive" "json" "opam"))
+ "cran" "crate" "texlive" "json" "opam" "hexpm"))
(define (resolve-importer name)
(let ((module (resolve-interface
diff --git a/guix/scripts/import/hexpm.scm b/guix/scripts/import/hexpm.scm
new file mode 100644
index 0000000000..be5625ca46
--- /dev/null
+++ b/guix/scripts/import/hexpm.scm
@@ -0,0 +1,114 @@
+;;; 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 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix scripts import hexpm)
+ #:use-module (guix ui)
+ #:use-module (guix utils)
+ #:use-module (guix scripts)
+ #:use-module (guix import hexpm)
+ #:use-module (guix scripts import)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-11)
+ #:use-module (srfi srfi-37)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 format)
+ #:export (guix-import-hexpm))
+
+\f
+;;;
+;;; Command-line options.
+;;;
+
+(define %default-options
+ '())
+
+(define (show-help)
+ (display (G_ "Usage: guix import hexpm PACKAGE-NAME
+Import and convert the hex.pm package for PACKAGE-NAME.\n"))
+ (display (G_ "
+ -r, --recursive import packages recursively"))
+ (newline)
+ (display (G_ "
+ -h, --help display this help and exit"))
+ (display (G_ "
+ -V, --version display version information and exit"))
+ (newline)
+ (show-bug-report-information))
+
+(define %options
+ ;; Specification of the command-line options.
+ (cons* (option '(#\h "help") #f #f
+ (lambda args
+ (show-help)
+ (exit 0)))
+ (option '(#\V "version") #f #f
+ (lambda args
+ (show-version-and-exit "guix import hexpm")))
+ (option '(#\r "recursive") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'recursive #t result)))
+ %standard-import-options))
+
+\f
+;;;
+;;; Entry point.
+;;;
+
+(define (guix-import-hexpm . args)
+ (define (parse-options)
+ ;; Return the alist of option values.
+ (args-fold* args %options
+ (lambda (opt name arg result)
+ (leave (G_ "~A: unrecognized option~%") name))
+ (lambda (arg result)
+ (alist-cons 'argument arg result))
+ %default-options))
+
+
+ (let* ((opts (parse-options))
+ (args (filter-map (match-lambda
+ (('argument . value)
+ value)
+ (_ #f))
+ (reverse opts))))
+ (match args
+ ((spec)
+ (define-values (name version)
+ (package-name->name+version spec))
+
+ (if (assoc-ref opts 'recursive)
+ (map (match-lambda
+ ((and ('package ('name name) . rest) pkg)
+ `(define-public ,(string->symbol name)
+ ,pkg))
+ (_ #f))
+ (hexpm-recursive-import name version))
+ (let ((sexp (hexpm->guix-package name version)))
+ (unless sexp
+ (leave (G_ "failed to download meta-data for package '~a'~%")
+ (if version
+ (string-append name "@" version)
+ name)))
+ sexp)))
+ (()
+ (leave (G_ "too few arguments~%")))
+ ((many ...)
+ (leave (G_ "too many arguments~%"))))))
diff --git a/guix/upstream.scm b/guix/upstream.scm
index 67d0eeefbb..0a29154ff7 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -24,6 +24,10 @@
#:use-module (guix discovery)
#:use-module ((guix download)
#:select (download-to-store url-fetch))
+ #:use-module ((guix hexpm-download)
+ #:select (hexpm-fetch))
+ #:use-module ((guix extracting-download)
+ #:select (download-to-store/extract))
#:use-module (guix gnupg)
#:use-module (guix packages)
#:use-module (guix ui)
@@ -385,9 +389,23 @@ SOURCE, an <upstream-source>."
#:key-download key-download)))
(values version tarball source))))))
+(define* (package-update/hexpm-fetch store package source
+ #:key key-download)
+ "Return the version, tarball, and SOURCE, to update PACKAGE to
+SOURCE, an <upstream-source>."
+ (match source
+ (($ <upstream-source> _ version urls signature-urls)
+ (let* ((url (first urls))
+ (name (or (origin-file-name (package-source package))
+ (string-append (basename url) ".gz")))
+ (tarball (download-to-store/extract
+ store url "contents.tar.gz" name)))
+ (values version tarball source)))))
+
(define %method-updates
;; Mapping of origin methods to source update procedures.
- `((,url-fetch . ,package-update/url-fetch)))
+ `((,url-fetch . ,package-update/url-fetch)
+ (,hexpm-fetch . ,package-update/hexpm-fetch)))
(define* (package-update store package updaters
#:key (key-download 'interactive))
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 0/1] guix: Add importer for hex.pm.
2020-07-03 17:43 ` [bug#42180] [PATCH 02/22] guix: Add importer for hex.pm Hartmut Goebel
@ 2020-11-02 14:18 ` pukkamustard
2020-11-02 14:18 ` [bug#42180] [PATCH 1/1] " pukkamustard
0 siblings, 1 reply; 78+ messages in thread
From: pukkamustard @ 2020-11-02 14:18 UTC (permalink / raw)
To: 42180; +Cc: pukkamustard
Small fix of commit by Hartmut Goebel that makes patch series compile towards current master.
Hartmut Goebel (1):
guix: Add importer for hex.pm.
Makefile.am | 3 +
guix/hexpm-download.scm | 73 +++++++++
guix/import/hexpm.scm | 298 ++++++++++++++++++++++++++++++++++
guix/import/utils.scm | 1 +
guix/scripts/import.scm | 2 +-
guix/scripts/import/hexpm.scm | 114 +++++++++++++
guix/upstream.scm | 20 ++-
7 files changed, 509 insertions(+), 2 deletions(-)
create mode 100644 guix/hexpm-download.scm
create mode 100644 guix/import/hexpm.scm
create mode 100644 guix/scripts/import/hexpm.scm
--
2.28.0
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 1/1] guix: Add importer for hex.pm.
2020-11-02 14:18 ` [bug#42180] [PATCH 0/1] " pukkamustard
@ 2020-11-02 14:18 ` pukkamustard
0 siblings, 0 replies; 78+ messages in thread
From: pukkamustard @ 2020-11-02 14:18 UTC (permalink / raw)
To: 42180; +Cc: pukkamustard
From: pukkamustard@posteo.net
* 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.
---
Makefile.am | 3 +
guix/hexpm-download.scm | 73 +++++++++
guix/import/hexpm.scm | 298 ++++++++++++++++++++++++++++++++++
guix/import/utils.scm | 1 +
guix/scripts/import.scm | 2 +-
guix/scripts/import/hexpm.scm | 114 +++++++++++++
guix/upstream.scm | 20 ++-
7 files changed, 509 insertions(+), 2 deletions(-)
create mode 100644 guix/hexpm-download.scm
create mode 100644 guix/import/hexpm.scm
create mode 100644 guix/scripts/import/hexpm.scm
diff --git a/Makefile.am b/Makefile.am
index eb1d34198f..32607b7704 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -96,6 +96,7 @@ MODULES = \
guix/extracting-download.scm \
guix/git-download.scm \
guix/hg-download.scm \
+ guix/hexpm-download.scm \
guix/swh.scm \
guix/monads.scm \
guix/monad-repl.scm \
@@ -246,6 +247,7 @@ MODULES = \
guix/import/gnome.scm \
guix/import/gnu.scm \
guix/import/hackage.scm \
+ guix/import/hexpm.scm \
guix/import/json.scm \
guix/import/kde.scm \
guix/import/launchpad.scm \
@@ -289,6 +291,7 @@ MODULES = \
guix/scripts/import/gem.scm \
guix/scripts/import/gnu.scm \
guix/scripts/import/hackage.scm \
+ guix/scripts/import/hexpm.scm \
guix/scripts/import/json.scm \
guix/scripts/import/nix.scm \
guix/scripts/import/opam.scm \
diff --git a/guix/hexpm-download.scm b/guix/hexpm-download.scm
new file mode 100644
index 0000000000..69d0cf285c
--- /dev/null
+++ b/guix/hexpm-download.scm
@@ -0,0 +1,73 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017 Mathieu Lirzin <mthl@gnu.org>
+;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix hexpm-download)
+ #:use-module (ice-9 match)
+ #:use-module (guix extracting-download)
+ #:use-module (guix packages) ;; for %current-system
+ #:use-module (srfi srfi-26)
+ #:export (hexpm-fetch
+
+ %hexpm-repo-url
+ hexpm-url
+ hexpm-url?
+ hexpm-uri))
+
+;;;
+;;; An <origin> method that fetches a package from the hex.pm repository,
+;;; unwrapping the actual content from the download tarball.
+;;;
+
+(define %hexpm-repo-url
+ (make-parameter "https://repo.hex.pm"))
+(define hexpm-url
+ (string-append (%hexpm-repo-url) "/tarballs/"))
+(define hexpm-url?
+ (cut string-prefix? hexpm-url <>))
+
+(define (hexpm-uri name version)
+ "Return a URI string for the package hosted at hex.pm corresponding to NAME
+and VERSION."
+ (string-append hexpm-url name "-" version ".tar"))
+
+(define* (hexpm-fetch url hash-algo hash
+ #:optional name
+ #:key
+ (filename-to-extract "contents.tar.gz")
+ (system (%current-system)) (guile (default-guile)))
+ "Return a fixed-output derivation that fetches URL and extracts
+\"contents.tar.gz\". The output is expected to have hash HASH of type
+HASH-ALGO (a symbol). By default, the file name is the base name of URL;
+optionally, NAME can specify a different file name. By default, the file name
+is the base name of URL with \".gz\" appended; optionally, NAME can specify a
+different file name."
+ (define file-name
+ (match url
+ ((head _ ...)
+ (basename head))
+ (_
+ (basename url))))
+
+ (http-fetch/extract url "contents.tar.gz" hash-algo hash
+ ;; urls typically end with .tar, but contents is .tar.gz
+ (or name (string-append file-name ".gz"))
+ #:system system #:guile guile))
diff --git a/guix/import/hexpm.scm b/guix/import/hexpm.scm
new file mode 100644
index 0000000000..129482ac6e
--- /dev/null
+++ b/guix/import/hexpm.scm
@@ -0,0 +1,298 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com>
+;;; Copyright © 2016 David Craven <david@craven.ch>
+;;; Copyright © 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix import hexpm)
+ #:use-module (guix base32)
+ #:use-module ((guix download) #:prefix download:)
+ #:use-module (guix hexpm-download)
+ #:use-module (gcrypt hash)
+ #:use-module (guix http-client)
+ #:use-module (guix json)
+ #:use-module (guix import json)
+ #:use-module (guix import utils)
+ #:use-module ((guix build utils)
+ #:select ((package-name->name+version
+ . hyphen-package-name->name+version)
+ dump-port))
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix monads)
+ #:use-module (guix packages)
+ #:use-module (guix upstream)
+ #:use-module (guix utils)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 regex)
+ #:use-module (ice-9 popen)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-2)
+ #:use-module (srfi srfi-26)
+ #:export (hexpm->guix-package
+ guix-package->hexpm-name
+ strings->licenses
+ hexpm-recursive-import
+ %hexpm-updater))
+
+\f
+;;;
+;;; Interface to https://hex.pm/api, version 2.
+;;;
+
+(define %hexpm-api-url
+ (make-parameter "https://hex.pm/api"))
+
+(define (package-url name)
+ (string-append (%hexpm-api-url) "/packages/" name))
+
+;; Hexpm Package. /api/packages/${name}
+;; It can have several "releases", each of which has its own set of
+;; requirements, buildtool, etc. - see <hexpm-release> below.
+(define-json-mapping <hexpm-pkgdef> make-hexpm-pkgdef hexpm-pkgdef?
+ json->hexpm
+ (name hexpm-name) ;string
+ (html-url hexpm-html-url "html_url") ;string
+ (docs-html-url hexpm-docs-html-url "docs_html_url") ;string | #nil
+ (meta hexpm-meta "meta" json->hexpm-meta)
+ (versions hexpm-versions "releases" ;list of <hexpm-version>
+ (lambda (vector)
+ (map json->hexpm-version
+ (vector->list vector)))))
+
+;; Hexpm meta.
+(define-json-mapping <hexpm-meta> make-hexpm-meta hexpm-meta?
+ json->hexpm-meta
+ (description hexpm-meta-description) ;string
+ (licenses hexpm-meta-licenses "licenses" ;list of strings
+ (lambda (vector)
+ (or (and vector (vector->list vector))
+ #f))))
+
+;; Hexpm version.
+(define-json-mapping <hexpm-version> make-hexpm-version hexpm-version?
+ json->hexpm-version
+ (number hexpm-version-number "version") ;string
+ (url hexpm-version-url)) ;string
+
+
+(define (lookup-hexpm name)
+ "Look up NAME on https://hex.pm and return the corresopnding <hexpm>
+record or #f if it was not found."
+ (let ((json (json-fetch (package-url name))))
+ (and json
+ (json->hexpm json))))
+
+;; Hexpm release. /api/packages/${name}/releases/${version}
+(define-json-mapping <hexpm-release> make-hexpm-release hexpm-release?
+ json->hexpm-release
+ (number hexpm-release-number "version") ;string
+ (url hexpm-release-url) ;string
+ (requirements hexpm-requirements "requirements")) ;list of <hexpm-dependency>
+;; meta:build_tools -> alist
+
+;; Hexpm dependency. Each dependency (each edge in the graph) is annotated as
+;; being a "normal" dependency or a development dependency. There also
+;; information about the minimum required version, such as "^0.0.41".
+(define-json-mapping <hexpm-dependency> make-hexpm-dependency
+ hexpm-dependency?
+ json->hexpm-dependency
+ (app hexpm-dependency-app "app") ;string
+ (optional hexpm-dependency-optional) ;bool
+ (requirement hexpm-dependency-requirement)) ;string
+
+(define (hexpm-release-dependencies release)
+ "Return the list of dependency names of RELEASE, a <hexpm-release>."
+ (let ((reqs (or (hexpm-requirements release) '#())))
+ (map first reqs))) ;; TODO: also return required version
+
+
+(define (lookup-hexpm-release version*)
+ "Look up RELEASE on hexpm-version-url and return the corresopnding
+<hexpm-release> record or #f if it was not found."
+ (let* ((url (hexpm-version-url version*))
+ (json (json-fetch url)))
+ (json->hexpm-release json)))
+
+\f
+;;;
+;;; Converting hex.pm packages to Guix packages.
+;;;
+
+(define (maybe-arguments arguments)
+ (match arguments
+ (()
+ '())
+ ((args ...)
+ `((arguments (,'quasiquote ,args))))))
+
+(define* (make-hexpm-sexp #:key name version tarball-url
+ home-page synopsis description license
+ #:allow-other-keys)
+ "Return the `package' s-expression for a rust package with the given NAME,
+VERSION, tarball-url, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
+ (call-with-temporary-directory
+ (lambda (directory)
+ (let ((port (http-fetch tarball-url))
+ (tar (open-pipe* OPEN_WRITE "tar" "-C" directory
+ "-xf" "-" "contents.tar.gz")))
+ (dump-port port tar)
+ (close-port port)
+
+ (let ((status (close-pipe tar)))
+ (unless (zero? status)
+ (error "tar extraction failure" status))))
+
+ (let ((guix-name (hexpm-name->package-name name))
+ (sha256 (bytevector->nix-base32-string
+ (call-with-input-file
+ (string-append directory "/contents.tar.gz")
+ port-sha256))))
+
+ `(package
+ (name ,guix-name)
+ (version ,version)
+ (source (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri ,name version))
+ (sha256 (base32 ,sha256))))
+ (build-system ,'rebar3-build-system)
+ (home-page ,(match home-page
+ (() "")
+ (_ home-page)))
+ (synopsis ,synopsis)
+ (description ,(beautify-description description))
+ (license ,(match license
+ (() #f)
+ ((license) license)
+ (_ `(list ,@license)))))))))
+
+(define (strings->licenses strings)
+ (filter-map (lambda (license)
+ (and (not (string-null? license))
+ (not (any (lambda (elem) (string=? elem license))
+ '("AND" "OR" "WITH")))
+ (or (spdx-string->license license)
+ license)))
+ strings))
+
+(define (hexpm-latest-version package)
+ (let ((versions (map hexpm-version-number (hexpm-versions package))))
+ (fold (lambda (a b)
+ (if (version>? a b) a b)) (car versions) versions)))
+
+(define* (hexpm->guix-package package-name #:optional version)
+ "Fetch the metadata for PACKAGE-NAME from hexpms.io, and return the
+`package' s-expression corresponding to that package, or #f on failure.
+When VERSION is specified, attempt to fetch that version; otherwise fetch the
+latest version of PACKAGE-NAME."
+
+ (define package
+ (lookup-hexpm package-name))
+
+ (define version-number
+ (and package
+ (or version
+ (hexpm-latest-version package))))
+
+ (define version*
+ (and package
+ (find (lambda (version)
+ (string=? (hexpm-version-number version)
+ version-number))
+ (hexpm-versions package))))
+
+ (define release
+ (and package version*
+ (lookup-hexpm-release version*)))
+
+ (and package version*
+ (let ((dependencies (hexpm-release-dependencies release))
+ (pkg-meta (hexpm-meta package)))
+ (values
+ (make-hexpm-sexp
+ #:name package-name
+ #:version version-number
+ #:home-page (or (hexpm-docs-html-url package)
+ ;; TODO: Homepage?
+ (hexpm-html-url package))
+ #:synopsis (hexpm-meta-description pkg-meta)
+ #:description (hexpm-meta-description pkg-meta)
+ #:license (or (and=> (hexpm-meta-licenses pkg-meta)
+ strings->licenses))
+ #:tarball-url (hexpm-uri package-name version-number))
+ dependencies))))
+
+(define* (hexpm-recursive-import pkg-name #:optional version)
+ (recursive-import pkg-name #f
+ #:repo->guix-package
+ (lambda (name repo)
+ (let ((version (and (string=? name pkg-name)
+ version)))
+ (hexpm->guix-package name version)))
+ #:guix-name hexpm-name->package-name))
+
+(define (guix-package->hexpm-name package)
+ "Return the hex.pm name of PACKAGE."
+ (define (url->hexpm-name url)
+ (hyphen-package-name->name+version
+ (basename (file-sans-extension url))))
+
+ (match (and=> (package-source package) origin-uri)
+ ((? string? url)
+ (url->hexpm-name url))
+ ((lst ...)
+ (any url->hexpm-name lst))
+ (#f #f)))
+
+(define (hexpm-name->package-name name)
+ (string-append "erlang-" (string-join (string-split name #\_) "-")))
+
+\f
+;;;
+;;; Updater
+;;;
+
+(define (hexpm-package? package)
+ "Return true if PACKAGE is a package from hex.pm."
+ (let ((source-url (and=> (package-source package) origin-uri))
+ (fetch-method (and=> (package-source package) origin-method)))
+ (and (eq? fetch-method hexpm-fetch)
+ (match source-url
+ ((? string?)
+ (hexpm-url? source-url))
+ ((source-url ...)
+ (any hexpm-url? source-url))))))
+
+(define (latest-release package)
+ "Return an <upstream-source> for the latest release of PACKAGE."
+ (let* ((hexpm-name (guix-package->hexpm-name package))
+ (hexpm (lookup-hexpm hexpm-name))
+ (version (hexpm-latest-version hexpm))
+ (url (hexpm-uri hexpm-name version)))
+ (upstream-source
+ (package (package-name package))
+ (version version)
+ (urls (list url)))))
+
+(define %hexpm-updater
+ (upstream-updater
+ (name 'hexpm)
+ (description "Updater for hex.pm packages")
+ (pred hexpm-package?)
+ (latest latest-release)))
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 145515c489..b128580a8b 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -310,6 +310,7 @@ the expected fields of an <origin> object."
("git-fetch" (@ (guix git-download) git-fetch))
("svn-fetch" (@ (guix svn-download) svn-fetch))
("hg-fetch" (@ (guix hg-download) hg-fetch))
+ ("hexpm-fetch" (@ (guix hexpm-download) hexpm-fetch))
(_ #f)))
(uri (assoc-ref orig "uri"))
(sha256 sha))))))
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index 0a3863f965..81fa36956b 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -77,7 +77,7 @@ rather than \\n."
;;;
(define importers '("gnu" "nix" "pypi" "cpan" "hackage" "stackage" "elpa" "gem"
- "cran" "crate" "texlive" "json" "opam"))
+ "cran" "crate" "texlive" "json" "opam" "hexpm"))
(define (resolve-importer name)
(let ((module (resolve-interface
diff --git a/guix/scripts/import/hexpm.scm b/guix/scripts/import/hexpm.scm
new file mode 100644
index 0000000000..be5625ca46
--- /dev/null
+++ b/guix/scripts/import/hexpm.scm
@@ -0,0 +1,114 @@
+;;; 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 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix scripts import hexpm)
+ #:use-module (guix ui)
+ #:use-module (guix utils)
+ #:use-module (guix scripts)
+ #:use-module (guix import hexpm)
+ #:use-module (guix scripts import)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-11)
+ #:use-module (srfi srfi-37)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 format)
+ #:export (guix-import-hexpm))
+
+\f
+;;;
+;;; Command-line options.
+;;;
+
+(define %default-options
+ '())
+
+(define (show-help)
+ (display (G_ "Usage: guix import hexpm PACKAGE-NAME
+Import and convert the hex.pm package for PACKAGE-NAME.\n"))
+ (display (G_ "
+ -r, --recursive import packages recursively"))
+ (newline)
+ (display (G_ "
+ -h, --help display this help and exit"))
+ (display (G_ "
+ -V, --version display version information and exit"))
+ (newline)
+ (show-bug-report-information))
+
+(define %options
+ ;; Specification of the command-line options.
+ (cons* (option '(#\h "help") #f #f
+ (lambda args
+ (show-help)
+ (exit 0)))
+ (option '(#\V "version") #f #f
+ (lambda args
+ (show-version-and-exit "guix import hexpm")))
+ (option '(#\r "recursive") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'recursive #t result)))
+ %standard-import-options))
+
+\f
+;;;
+;;; Entry point.
+;;;
+
+(define (guix-import-hexpm . args)
+ (define (parse-options)
+ ;; Return the alist of option values.
+ (args-fold* args %options
+ (lambda (opt name arg result)
+ (leave (G_ "~A: unrecognized option~%") name))
+ (lambda (arg result)
+ (alist-cons 'argument arg result))
+ %default-options))
+
+
+ (let* ((opts (parse-options))
+ (args (filter-map (match-lambda
+ (('argument . value)
+ value)
+ (_ #f))
+ (reverse opts))))
+ (match args
+ ((spec)
+ (define-values (name version)
+ (package-name->name+version spec))
+
+ (if (assoc-ref opts 'recursive)
+ (map (match-lambda
+ ((and ('package ('name name) . rest) pkg)
+ `(define-public ,(string->symbol name)
+ ,pkg))
+ (_ #f))
+ (hexpm-recursive-import name version))
+ (let ((sexp (hexpm->guix-package name version)))
+ (unless sexp
+ (leave (G_ "failed to download meta-data for package '~a'~%")
+ (if version
+ (string-append name "@" version)
+ name)))
+ sexp)))
+ (()
+ (leave (G_ "too few arguments~%")))
+ ((many ...)
+ (leave (G_ "too many arguments~%"))))))
diff --git a/guix/upstream.scm b/guix/upstream.scm
index 6584d5e4c4..0abf7ce038 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -24,6 +24,10 @@
#:use-module (guix discovery)
#:use-module ((guix download)
#:select (download-to-store url-fetch))
+ #:use-module ((guix hexpm-download)
+ #:select (hexpm-fetch))
+ #:use-module ((guix extracting-download)
+ #:select (download-to-store/extract))
#:use-module (guix gnupg)
#:use-module (guix packages)
#:use-module (guix diagnostics)
@@ -398,9 +402,23 @@ SOURCE, an <upstream-source>."
#:key-download key-download)))
(values version tarball source))))))
+(define* (package-update/hexpm-fetch store package source
+ #:key key-download)
+ "Return the version, tarball, and SOURCE, to update PACKAGE to
+SOURCE, an <upstream-source>."
+ (match source
+ (($ <upstream-source> _ version urls signature-urls)
+ (let* ((url (first urls))
+ (name (or (origin-file-name (package-source package))
+ (string-append (basename url) ".gz")))
+ (tarball (download-to-store/extract
+ store url "contents.tar.gz" name)))
+ (values version tarball source)))))
+
(define %method-updates
;; Mapping of origin methods to source update procedures.
- `((,url-fetch . ,package-update/url-fetch)))
+ `((,url-fetch . ,package-update/url-fetch)
+ (,hexpm-fetch . ,package-update/hexpm-fetch)))
(define* (package-update store package updaters
#:key (key-download 'interactive))
--
2.28.0
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 03/22] guix: Add rebar3 build-system.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 01/22] guix: Add extracting-download Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 02/22] guix: Add importer for hex.pm Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 04/22] gnu: Add erlang-cf Hartmut Goebel
` (21 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* guix/build-system/rebar3.scm, guix/build/rebar3-build-system.scm: New files.
* Makefile.am (MODULES): Add them.
---
Makefile.am | 2 +
guix/build-system/rebar3.scm | 144 +++++++++++++++++++++++++++
guix/build/rebar3-build-system.scm | 155 +++++++++++++++++++++++++++++
3 files changed, 301 insertions(+)
create mode 100644 guix/build-system/rebar3.scm
create mode 100644 guix/build/rebar3-build-system.scm
diff --git a/Makefile.am b/Makefile.am
index 0847edea19..cee96556a2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -142,6 +142,7 @@ MODULES = \
guix/build-system/waf.scm \
guix/build-system/r.scm \
guix/build-system/rakudo.scm \
+ guix/build-system/rebar3.scm \
guix/build-system/ruby.scm \
guix/build-system/scons.scm \
guix/build-system/texlive.scm \
@@ -190,6 +191,7 @@ MODULES = \
guix/build/qt-build-system.scm \
guix/build/r-build-system.scm \
guix/build/rakudo-build-system.scm \
+ guix/build/rebar3-build-system.scm \
guix/build/ruby-build-system.scm \
guix/build/scons-build-system.scm \
guix/build/texlive-build-system.scm \
diff --git a/guix/build-system/rebar3.scm b/guix/build-system/rebar3.scm
new file mode 100644
index 0000000000..ba12eaabd7
--- /dev/null
+++ b/guix/build-system/rebar3.scm
@@ -0,0 +1,144 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build-system rebar3)
+ #:use-module (guix store)
+ #:use-module (guix utils)
+ #:use-module (guix packages)
+ #:use-module (guix derivations)
+ #:use-module (guix search-paths)
+ #:use-module (guix build-system)
+ #:use-module (guix build-system gnu)
+ #:use-module (ice-9 match)
+ #:use-module (srfi srfi-26)
+ #:export (%rebar3-build-system-modules
+ rebar3-build
+ rebar3-build-system))
+
+;;
+;; Standard build procedure for Java packages using Rebar3.
+;;
+
+(define %rebar3-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build rebar3-build-system)
+ (guix build syscalls)
+ ,@%gnu-build-system-modules))
+
+(define (default-rebar3)
+ "Return the default Rebar3 package."
+ ;; Lazily resolve the binding to avoid a circular dependency.
+ (let ((erlang-mod (resolve-interface '(gnu packages erlang))))
+ (module-ref erlang-mod 'rebar3)))
+
+(define (default-erlang)
+ "Return the default Erlang package."
+ ;; Lazily resolve the binding to avoid a circular dependency.
+ (let ((erlang-mod (resolve-interface '(gnu packages erlang))))
+ (module-ref erlang-mod 'erlang)))
+
+(define* (lower name
+ #:key source inputs native-inputs outputs system target
+ (rebar (default-rebar3))
+ (erlang (default-erlang))
+ #:allow-other-keys
+ #:rest arguments)
+ "Return a bag for NAME."
+ (define private-keywords
+ '(#:source #:target #:rebar #:inputs #:native-inputs))
+
+ (and (not target) ;XXX: no cross-compilation
+ (bag
+ (name name)
+ (system system)
+ (host-inputs `(,@(if source
+ `(("source" ,source))
+ '())
+ ,@inputs
+ ;; Keep the standard inputs of 'gnu-build-system'.
+ ,@(standard-packages)))
+ (build-inputs `(("rebar" ,rebar)
+ ("erlang" ,erlang) ;; for escriptize
+ ,@native-inputs))
+ (outputs outputs)
+ (build rebar3-build)
+ (arguments (strip-keyword-arguments private-keywords arguments)))))
+
+(define* (rebar3-build store name inputs
+ #:key
+ (tests? #t)
+ (test-target "eunit")
+ (configure-flags ''())
+ (make-flags ''("skip_deps=true" "-vv"))
+ (build-target "compile")
+ ;; TODO: pkg-name
+ (phases '(@ (guix build rebar3-build-system)
+ %standard-phases))
+ (outputs '("out"))
+ (search-paths '())
+ (system (%current-system))
+ (guile #f)
+ (imported-modules %rebar3-build-system-modules)
+ (modules '((guix build rebar3-build-system)
+ (guix build utils))))
+ "Build SOURCE with INPUTS."
+ (define builder
+ `(begin
+ (use-modules ,@modules)
+ (rebar3-build #:name ,name
+ #:source ,(match (assoc-ref inputs "source")
+ (((? derivation? source))
+ (derivation->output-path source))
+ ((source)
+ source)
+ (source
+ source))
+ #:make-flags ,make-flags
+ #:configure-flags ,configure-flags
+ #:system ,system
+ #:tests? ,tests?
+ #:test-target ,test-target
+ #:build-target ,build-target
+ #:phases ,phases
+ #:outputs %outputs
+ #:search-paths ',(map search-path-specification->sexp
+ search-paths)
+ #:inputs %build-inputs)))
+
+ (define guile-for-build
+ (match guile
+ ((? package?)
+ (package-derivation store guile system #:graft? #f))
+ (#f ; the default
+ (let* ((distro (resolve-interface '(gnu packages commencement)))
+ (guile (module-ref distro 'guile-final)))
+ (package-derivation store guile system #:graft? #f)))))
+
+ (build-expression->derivation store name builder
+ #:inputs inputs
+ #:system system
+ #:modules imported-modules
+ #:outputs outputs
+ #:guile-for-build guile-for-build))
+
+(define rebar3-build-system
+ (build-system
+ (name 'rebar3)
+ (description "The standard Rebar3 build system")
+ (lower lower)))
diff --git a/guix/build/rebar3-build-system.scm b/guix/build/rebar3-build-system.scm
new file mode 100644
index 0000000000..2a6c236676
--- /dev/null
+++ b/guix/build/rebar3-build-system.scm
@@ -0,0 +1,155 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build rebar3-build-system)
+ #:use-module ((guix build gnu-build-system) #:prefix gnu:)
+ #:use-module (guix build syscalls)
+ #:use-module (guix build utils)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 ftw)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-26)
+ #:export (%standard-phases
+ rebar3-build))
+
+;;
+;; Builder-side code of the standard build procedure for Erlang packages using
+;; rebar3.
+;;
+;; Based on https://salsa.debian.org/erlang-team/packages/dh-rebar
+;;
+;; TODO: Think about whether bindir ("ebin"), libdir ("priv") and includedir
+;; "(include") need to be configurable
+
+(define* (erlang-depends #:key inputs #:allow-other-keys)
+ ;;TODO: mimik Debian's erlang-depends
+ ;; https://manpages.debian.org/stretch/erlang-dev/erlang-depends.1.en.html
+ ;;https://salsa.debian.org/erlang-team/packages/erlang/-/blob/master/debian/scripts/erlang-depends.in
+ ;; foreach my $package (@{$dh{DOPACKAGES}}) {
+ ;; doit("erlang-depends", "-p$package")}
+ (define input-directories
+ (match inputs
+ (((_ . dir) ...)
+ dir)))
+ (mkdir-p "_checkouts")
+
+ (for-each
+ (lambda (input-dir)
+ (let ((elibdir (string-append input-dir "/lib/erlang/lib")))
+ (when (directory-exists? elibdir)
+ (for-each
+ (lambda (dirname)
+ (symlink (string-append elibdir "/" dirname)
+ (string-append "_checkouts/" dirname)))
+ (list-directories elibdir)))))
+ input-directories)
+ #t)
+
+(define* (unpack #:key source #:allow-other-keys)
+ "Unpack SOURCE in the working directory, and change directory within the
+source. When SOURCE is a directory, copy it in a sub-directory of the current
+working directory."
+ ;; archives from hexpm typicalls do not contain a directory level
+ ;; TODO: Check if archive contains a directory level
+ (mkdir "source")
+ (chdir "source")
+ (if (file-is-directory? source)
+ (begin
+ ;; Preserve timestamps (set to the Epoch) on the copied tree so that
+ ;; things work deterministically.
+ (copy-recursively source "."
+ #:keep-mtime? #t))
+ (begin
+ (if (string-suffix? ".zip" source)
+ (invoke "unzip" source)
+ (invoke "tar" "xvf" source))))
+ #t)
+
+(define* (build #:key (make-flags '()) (build-target "compile")
+ #:allow-other-keys)
+ (apply invoke `("rebar3" ,build-target ,@make-flags)))
+
+(define* (check #:key target (make-flags '()) (tests? (not target))
+ (test-target "eunit")
+ #:allow-other-keys)
+ (if tests?
+ (apply invoke `("rebar3" ,test-target ,@make-flags))
+ (format #t "test suite not run~%"))
+ #t)
+
+(define (erlang-package? name)
+ "Check if NAME correspond to the name of an Erlang package."
+ (string-prefix? "erlang-" name))
+
+(define (package-name-version->erlang-name name+ver)
+ "Convert the Guix package NAME-VER to the corresponding Erlang name-version
+format. Essentially drop the prefix used in Guix and replace dashes by
+underscores."
+ (let* ((name- (package-name->name+version name+ver)))
+ (string-join
+ (string-split
+ (if (erlang-package? name-) ; checks for "erlang-" prefix
+ (string-drop name- (string-length "erlang-"))
+ name-)
+ #\-)
+ "_")))
+
+(define (list-directories directory)
+ "Return file names of the sub-directory of DIRECTORY."
+ (scandir directory
+ (lambda (file)
+ (and (not (member file '("." "..")))
+ (file-is-directory? (string-append directory "/" file))))))
+
+(define* (install #:key name outputs
+ (pkg-name (package-name-version->erlang-name name))
+ #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (pkg-dir (string-append out "/lib/erlang/lib/" pkg-name)))
+ (for-each
+ (lambda (pkg)
+ (for-each
+ (lambda (dirname)
+ (let ((src-dir (string-append "_build/default/lib/" pkg "/" dirname))
+ (dst-dir (string-append pkg-dir "/" dirname)))
+ (when (file-exists? src-dir)
+ (copy-recursively src-dir dst-dir #:follow-symlinks? #t))
+ (false-if-exception
+ (delete-file (string-append dst-dir "/.gitignore")))))
+ '("ebin" "include" "priv")))
+ (list-directories "_build/default/lib"))
+ (false-if-exception
+ (delete-file (string-append pkg-dir "/priv/Run-eunit-loop.expect")))
+ #t))
+
+(define %standard-phases
+ (modify-phases gnu:%standard-phases
+ (replace 'unpack unpack)
+ (delete 'bootstrap)
+ (delete 'configure)
+ (add-before 'build 'erlang-depends erlang-depends)
+ (replace 'build build)
+ (replace 'check check)
+ (replace 'install install)))
+
+(define* (rebar3-build #:key inputs (phases %standard-phases)
+ #:allow-other-keys #:rest args)
+ "Build the given Erlang package, applying all of PHASES in order."
+ (apply gnu:gnu-build #:inputs inputs #:phases phases args))
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 04/22] gnu: Add erlang-cf.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (2 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 03/22] guix: Add rebar3 build-system Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 05/22] gnu: Add erlang-certifi Hartmut Goebel
` (20 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-cf): New variable.
---
gnu/packages/erlang.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 4b6c0cf105..e8812f3cbd 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2016, 2017 Pjotr Prins <pjotr.guix@thebird.nl>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Nikita <nikita@n0.is>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -24,8 +25,10 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system gnu)
#:use-module (guix build-system emacs)
+ #:use-module (guix build-system rebar3)
#:use-module (guix download)
#:use-module (guix git-download)
+ #:use-module (guix hexpm-download)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (gnu packages)
@@ -231,3 +234,20 @@ built-in support for concurrency, distribution and fault tolerance.")
"This package provides an Emacs major mode for editing Erlang source
files.")
(license license:asl2.0)))
+
+(define-public erlang-cf
+ (package
+ (name "erlang-cf")
+ (version "0.3.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "cf" version))
+ (sha256
+ (base32 "0vnmbb1n899xw2p4x6c3clpzxcqqdsfbfhh1dfy530i3201vr2h4"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/project-fifo/cf")
+ (synopsis "Terminal colour helper for Erlang io and io_lib")
+ (description "This package provides a helper library for termial colour
+printing extending the io:format syntax to add colours.")
+ (license license:expat)))
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 05/22] gnu: Add erlang-certifi.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (3 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 04/22] gnu: Add erlang-cf Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 06/22] gnu: Add erlang-erlware-commons Hartmut Goebel
` (19 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-certifi): New variable.
---
gnu/packages/erlang.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index e8812f3cbd..e55cca7cc6 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -235,6 +235,30 @@ built-in support for concurrency, distribution and fault tolerance.")
files.")
(license license:asl2.0)))
+(define-public erlang-certifi
+ (package
+ (name "erlang-certifi")
+ (version "2.5.2")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "certifi" version))
+ (sha256
+ (base32 "1vb909y1jdhiwd8rc0pyx10dm889j952l05jb25rpa8aycbrvx3l"))))
+ (build-system rebar3-build-system)
+ (inputs
+ `(("parse-trans" ,erlang-parse-trans)))
+ (home-page "https://github.com/certifi/erlang-certifi/")
+ (synopsis "CA bundle adapted from Mozilla for Erlang")
+ (description "This Erlang library contains a CA bundle that you can
+reference in your Erlang application. This is useful for systems that do not
+have CA bundles that Erlang can find itself, or where a uniform set of CAs is
+valuable.
+
+This an Erlang specific port of certifi. The CA bundle is derived from
+Mozilla's canonical set.")
+ (license license:bsd-3))) ;; FIXME
+
(define-public erlang-cf
(package
(name "erlang-cf")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 06/22] gnu: Add erlang-erlware-commons.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (4 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 05/22] gnu: Add erlang-certifi Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 07/22] gnu: Add erlang-cth-readable Hartmut Goebel
` (18 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-erlware-commons): New variable.
---
gnu/packages/erlang.scm | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index e55cca7cc6..ee5c61dea8 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -275,3 +275,24 @@ Mozilla's canonical set.")
(description "This package provides a helper library for termial colour
printing extending the io:format syntax to add colours.")
(license license:expat)))
+
+(define-public erlang-erlware-commons
+ (package
+ (name "erlang-erlware-commons")
+ (version "1.3.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "erlware_commons" version))
+ (sha256
+ (base32 "1cs00ac71bjik8xq82caj19r3ik7zhbh579g74liyxdvbmxqk6i6"))))
+ (build-system rebar3-build-system)
+ (propagated-inputs
+ `(("erlang-cf" ,erlang-cf)))
+ (arguments
+ `(#:tests? #f)) ;; TODO: 1/219 tests fail - very simple one, though
+ (home-page "http://erlware.github.io/erlware_commons/")
+ (synopsis "Additional standard library for Erlang")
+ (description "Erlware Commons is an Erlware project focused on all aspects
+of reusable Erlang components.")
+ (license license:expat)))
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 07/22] gnu: Add erlang-cth-readable.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (5 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 06/22] gnu: Add erlang-erlware-commons Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 08/22] gnu: Add erlang-bbmustache Hartmut Goebel
` (17 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-cth-readable): New variable.
---
gnu/packages/erlang.scm | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index ee5c61dea8..f874e605b9 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -276,6 +276,27 @@ Mozilla's canonical set.")
printing extending the io:format syntax to add colours.")
(license license:expat)))
+(define-public erlang-cth-readable
+ (package
+ (name "erlang-cth-readable")
+ (version "1.4.6")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "cth_readable" version))
+ (sha256
+ (base32 "0kxn983fpsify2kklgwr2fk3b3k1374zldgxqx4k325625xnjgbg"))))
+ (build-system rebar3-build-system)
+ (propagated-inputs
+ `(("erlang-cf" ,erlang-cf)))
+ (arguments
+ `(#:tests? #f)) ;; no test-suite
+ (home-page "https://github.com/ferd/cth_readable")
+ (synopsis "Common Test hooks for more readable logs for Erlang")
+ (description "This package provides an OTP library to be used for CT log
+outputs you want to be readable around all that noise they contain.")
+ (license license:bsd-3)))
+
(define-public erlang-erlware-commons
(package
(name "erlang-erlware-commons")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 08/22] gnu: Add erlang-bbmustache.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (6 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 07/22] gnu: Add erlang-cth-readable Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 09/22] gnu: Add erlang-getopt Hartmut Goebel
` (16 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-bbmustache): New variable.
---
gnu/packages/erlang.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index f874e605b9..fbc2025efe 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -235,6 +235,41 @@ built-in support for concurrency, distribution and fault tolerance.")
files.")
(license license:asl2.0)))
+(define-public erlang-bbmustache
+ (package
+ (name "erlang-bbmustache")
+ (version "1.10.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "bbmustache" version))
+ (sha256
+ (base32 "0dpvi5qyx5kavi88p15501q939yf4dz3xqyc7mpi255rgmhsfnqx"))))
+ (build-system rebar3-build-system)
+ (inputs
+ `(("erlang-edown" ,erlang-edown)
+ ("erlang-getopt" ,erlang-getopt)
+ ("erlang-rebar3-git-vsn" ,erlang-rebar3-git-vsn)))
+ (arguments
+ `(#:tests? #f ;; requires mustache specification file
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'build 'build-escript
+ (lambda _
+ (invoke "rebar3" "as" "dev" "escriptize")
+ #t))
+ (add-after 'install 'install-escript
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out")))
+ (install-file "_build/dev/bin/bbmustache"
+ (string-append out "/bin")))
+ #t)))))
+ (home-page "https://github.com/soranoba/bbmustache/")
+ (synopsis "Binary pattern match Based Mustache template engine for Erlang")
+ (description "This Erlang library provides a Binary pattern match Based
+Mustache template engine")
+ (license license:expat)))
+
(define-public erlang-certifi
(package
(name "erlang-certifi")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 09/22] gnu: Add erlang-getopt.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (7 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 08/22] gnu: Add erlang-bbmustache Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 10/22] gnu: Add erlang-eunit-formatters Hartmut Goebel
` (15 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-getopt): New variable.
---
gnu/packages/erlang.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index fbc2025efe..fcdafe6231 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -352,3 +352,20 @@ outputs you want to be readable around all that noise they contain.")
(description "Erlware Commons is an Erlware project focused on all aspects
of reusable Erlang components.")
(license license:expat)))
+
+(define-public erlang-getopt
+ (package
+ (name "erlang-getopt")
+ (version "1.0.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "getopt" version))
+ (sha256
+ (base32 "1fhqnn4dvcil12cmqmzkmlk14lq5rn7ingld2380i6nl8v2dvm48"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/jcomellas/getopt")
+ (synopsis "Command-line options parser for Erlang")
+ (description "This package provides an Erlang module to parse command line
+arguments using the GNU getopt syntax.")
+ (license license:bsd-3)))
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 10/22] gnu: Add erlang-eunit-formatters.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (8 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 09/22] gnu: Add erlang-getopt Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 11/22] gnu: Add erlang-providers Hartmut Goebel
` (14 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-eunit-formatters): New variable.
---
gnu/packages/erlang.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index fcdafe6231..cb6c2b903e 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -353,6 +353,22 @@ outputs you want to be readable around all that noise they contain.")
of reusable Erlang components.")
(license license:expat)))
+(define-public erlang-eunit-formatters
+ (package
+ (name "erlang-eunit-formatters")
+ (version "0.5.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "eunit_formatters" version))
+ (sha256
+ (base32 "18q3vb12799584kdb998298b6bfh686mzi5s7pkb7djrf93vgf5f"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/seancribbs/eunit_formatters")
+ (synopsis "Better output for eunit suites")
+ (description "This package provides a better output for Erlang eunits.")
+ (license license:asl2.0)))
+
(define-public erlang-getopt
(package
(name "erlang-getopt")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 11/22] gnu: Add erlang-providers.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (9 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 10/22] gnu: Add erlang-eunit-formatters Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 12/22] gnu: Add erlang-parse-trans Hartmut Goebel
` (13 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-providers): New variable.
---
gnu/packages/erlang.scm | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index cb6c2b903e..692d2822bf 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -385,3 +385,21 @@ of reusable Erlang components.")
(description "This package provides an Erlang module to parse command line
arguments using the GNU getopt syntax.")
(license license:bsd-3)))
+
+(define-public erlang-providers
+ (package
+ (name "erlang-providers")
+ (version "1.8.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "providers" version))
+ (sha256
+ (base32 "1pj26xbv9vcx75mhg3bhy4xvhfm7nvqpqdknb4y0y9952knd8bqp"))))
+ (propagated-inputs
+ `(("erlang-getopt" ,erlang-getopt)))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/tsloughter/providers")
+ (synopsis "Erlang providers library")
+ (description "This package provides an Erlang providers library.")
+ (license license:asl2.0)))
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 12/22] gnu: Add erlang-parse-trans.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (10 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 11/22] gnu: Add erlang-providers Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 13/22] gnu: Add erlang-hex-core Hartmut Goebel
` (12 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-parse-trans): New variable.
---
gnu/packages/erlang.scm | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 692d2822bf..bdd3fbaf34 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -386,6 +386,25 @@ of reusable Erlang components.")
arguments using the GNU getopt syntax.")
(license license:bsd-3)))
+(define-public erlang-parse-trans
+ (package
+ (name "erlang-parse-trans")
+ (version "3.3.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "parse_trans" version))
+ (sha256
+ (base32 "1bf4w4c7n1jxg7zf0a2gywfwzj2hg58c11b9rhhjvwcw32cvw0mr"))))
+ (build-system rebar3-build-system)
+ (inputs
+ `(("erlang-getopt" ,erlang-getopt)))
+ (home-page "https://github.com/uwiger/parse_trans")
+ (synopsis "Parse transform utilities for Erlang")
+ (description "This package provides parse transform utilities for
+Erlang.")
+ (license license:asl2.0)))
+
(define-public erlang-providers
(package
(name "erlang-providers")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 13/22] gnu: Add erlang-hex-core.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (11 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 12/22] gnu: Add erlang-parse-trans Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 14/22] gnu: Add erlang-ssl-verify-fun Hartmut Goebel
` (11 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-hex-core): New variable.
---
gnu/packages/erlang.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index bdd3fbaf34..b3fc6f0abb 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -386,6 +386,34 @@ of reusable Erlang components.")
arguments using the GNU getopt syntax.")
(license license:bsd-3)))
+(define-public erlang-hex-core
+ (package
+ (name "erlang-hex-core")
+ (version "0.6.9")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "hex_core" version))
+ (sha256
+ (base32 "13drqw7pdqbmir4wbn0lgrclzhdhm758pb71ra8ysq5zhfrjzdv4"))))
+ (build-system rebar3-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (invoke "rebar3" "as" "test" "proper"))))))
+ (inputs
+ `(("erlang-proper" ,erlang-proper)
+ ("erlang-rebar3-proper" ,erlang-rebar3-proper)))
+ (propagated-inputs
+ `(("erlang-getopt" ,erlang-getopt)))
+ (home-page "https://github.com/hexpm/hex_core")
+ (synopsis "Reference implementation of Hex specifications")
+ (description "This package provides the reference implementation of Hex
+specifications.")
+ (license license:asl2.0)))
+
(define-public erlang-parse-trans
(package
(name "erlang-parse-trans")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 14/22] gnu: Add erlang-ssl-verify-fun.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (12 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 13/22] gnu: Add erlang-hex-core Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 15/22] gnu: Add erlang-relx Hartmut Goebel
` (10 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-ssl-verify-fun): New variable.
---
gnu/packages/erlang.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index b3fc6f0abb..1471d0adfe 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -450,3 +450,20 @@ Erlang.")
(synopsis "Erlang providers library")
(description "This package provides an Erlang providers library.")
(license license:asl2.0)))
+
+(define-public erlang-ssl-verify-fun
+ (package
+ (name "erlang-ssl-verify-fun")
+ (version "1.1.6")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "ssl_verify_fun" version))
+ (sha256
+ (base32 "0bwdqhnmlv0jfs5mrws2a75zngiihnvcni2hj4l65r5abnw050vx"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/deadtrickster/ssl_verify_fun.erl")
+ (synopsis "SSL verification functions for Erlang")
+ (description "This package provides SSL verification functions for
+Erlang.")
+ (license license:expat)))
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 15/22] gnu: Add erlang-relx.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (13 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 14/22] gnu: Add erlang-ssl-verify-fun Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 16/22] gnu: Add rebar3 Hartmut Goebel
` (9 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-relx): New variable.
---
gnu/packages/erlang.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 1471d0adfe..67c3415ec5 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -451,6 +451,32 @@ Erlang.")
(description "This package provides an Erlang providers library.")
(license license:asl2.0)))
+(define-public erlang-relx
+ (package
+ (name "erlang-relx")
+ (version "3.33.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "relx" version))
+ (sha256
+ (base32 "1l7r36cgaphjgki8n67x1vj2q16hdw9qb6yjjxb0bm7ydcdf6m5q"))))
+ (build-system rebar3-build-system)
+ (propagated-inputs
+ `(("erlang-bbmustache" ,erlang-bbmustache)
+ ("erlang-cf" ,erlang-cf)
+ ("erlang-erlware-commons" ,erlang-erlware-commons)
+ ("erlang-getopt" ,erlang-getopt)
+ ("erlang-providers" ,erlang-providers)))
+ (home-page "http://erlware.github.io/relx")
+ (synopsis "Release assembler for Erlang/OTP Releases")
+ (description "Relx assembles releases for an Erlang/OTP release. Given a
+release specification and a list of directories in which to search for OTP
+applications it will generate a release output. That output depends heavily on
+what plugins available and what options are defined, but usually it is simply
+a well configured release directory.")
+ (license license:asl2.0)))
+
(define-public erlang-ssl-verify-fun
(package
(name "erlang-ssl-verify-fun")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 16/22] gnu: Add rebar3.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (14 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 15/22] gnu: Add erlang-relx Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 17/22] gnu: Add erlang-edown Hartmut Goebel
` (8 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (rebar3): New variable.
---
gnu/packages/erlang.scm | 80 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 67c3415ec5..f4ceb096a3 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -493,3 +493,83 @@ a well configured release directory.")
(description "This package provides SSL verification functions for
Erlang.")
(license license:expat)))
+
+(define-public rebar3
+ (package
+ (name "rebar3")
+ (version "3.13.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/erlang/rebar3.git")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "13fzi46h88mmcj4z4anr5fxz7383m1m36wzfv7z3qx9xhaxd5k64"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'bootstrap)
+ (add-after 'unpack 'unpack-dependency-sources
+ (lambda* (#:key inputs #:allow-other-keys)
+ (for-each
+ (lambda (pkgname)
+ (let* ((src (string-append pkgname "-source"))
+ (input (assoc-ref inputs src))
+ (checkouts-dir (string-append "_checkouts/" pkgname))
+ (lib-dir (string-append "_build/default/lib/" pkgname)))
+ ;; dependencies, fetched from hex.pm
+ (mkdir-p checkouts-dir)
+ (invoke "tar" "-xzf" input "-C" checkouts-dir)
+ ;; (mkdir-p "lib/erlang/lib")
+ ;; (copy-recursively (assoc-ref inputs src)
+ ;; (string-append "lib/erlang/lib/" pkgname))
+ ;; other type of dependencies
+ (mkdir-p lib-dir)
+ (copy-recursively checkouts-dir lib-dir)))
+ (list "bbmustache" "certifi" "cf" "cth_readable"
+ "eunit_formatters" "getopt" "hex_core" "erlware_commons"
+ "parse_trans" "relx" "ssl_verify_fun" "providers"))
+ #t))
+ (delete 'configure)
+ (replace 'build
+ (lambda _
+ (setenv "HOME" (getcwd))
+ (invoke "./bootstrap")))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out")))
+ (install-file "rebar3" (string-append out "/bin")))
+ #t))
+ (delete 'check))))
+ (native-inputs
+ `(("erlang" ,erlang)))
+ (inputs
+ `(("bbmustache-source" ,(package-source erlang-bbmustache))
+ ("certifi-source" ,(package-source erlang-certifi))
+ ("cf-source" ,(package-source erlang-cf))
+ ("cth_readable-source" ,(package-source erlang-cth-readable))
+ ("erlware_commons-source" ,(package-source erlang-erlware-commons))
+ ("eunit_formatters-source" ,(package-source erlang-eunit-formatters))
+ ("getopt-source" ,(package-source erlang-getopt))
+ ("hex_core-source" ,(package-source erlang-hex-core))
+ ("parse_trans-source" ,(package-source erlang-parse-trans))
+ ("relx-source" ,(package-source erlang-relx))
+ ("ssl_verify_fun-source" ,(package-source erlang-ssl-verify-fun))
+ ("providers-source" ,(package-source erlang-providers))
+ ))
+ (home-page "https://www.rebar3.org/")
+ (synopsis "Sophisticated build-tool for Erlang projects that follows OTP
+principles")
+ (description "@code{rebar3} is an Erlang build tool that makes it easy to
+compile and test Erlang applications, port drivers and releases.
+
+@code{rebar3} is a self-contained Erlang script, so it's easy to distribute or
+even embed directly in a project. Where possible, rebar uses standard
+Erlang/OTP conventions for project structures, thus minimizing the amount of
+build configuration work. @code{rebar3} also provides dependency management,
+enabling application writers to easily re-use common libraries from a variety
+of locations (git, hg, etc).")
+ (license license:asl2.0)))
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 17/22] gnu: Add erlang-edown.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (15 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 16/22] gnu: Add rebar3 Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 18/22] gnu: Add erlang-jsone Hartmut Goebel
` (7 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-edown): New variable.
---
gnu/packages/erlang.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index f4ceb096a3..69c4795195 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -332,6 +332,23 @@ printing extending the io:format syntax to add colours.")
outputs you want to be readable around all that noise they contain.")
(license license:bsd-3)))
+(define-public erlang-edown
+ (package
+ (name "erlang-edown")
+ (version "0.8.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "edown" version))
+ (sha256
+ (base32 "1782j2nz0gdj839cag1bpimgd80hw034gj8az6lxpib543hk7vix"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/uwiger/edown")
+ (synopsis "Markdown extension for EDoc")
+ (description "This package provides an extension for EDoc for generating
+Markdown.")
+ (license "Apache 2.0")))
+
(define-public erlang-erlware-commons
(package
(name "erlang-erlware-commons")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 18/22] gnu: Add erlang-jsone.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (16 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 17/22] gnu: Add erlang-edown Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 19/22] gnu: Add erlang-proper Hartmut Goebel
` (6 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-jsone): New variable.
---
gnu/packages/erlang.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 69c4795195..cbe3fcadcd 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -431,6 +431,22 @@ arguments using the GNU getopt syntax.")
specifications.")
(license license:asl2.0)))
+(define-public erlang-jsone
+ (package
+ (name "erlang-jsone")
+ (version "1.5.2")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "jsone" version))
+ (sha256
+ (base32 "156dibk3hlvc04i7ss018mgx4bakcz7lagdnn0f2hj7lw8j63dhd"))))
+ (build-system rebar3-build-system)
+ (home-page "https://hexdocs.pm/jsone/")
+ (synopsis "Erlang JSON Library")
+ (description "Erlang JSON Library")
+ (license license:expat)))
+
(define-public erlang-parse-trans
(package
(name "erlang-parse-trans")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 19/22] gnu: Add erlang-proper.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (17 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 18/22] gnu: Add erlang-jsone Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 20/22] gnu: Add erlang-rebar3-raw-deps Hartmut Goebel
` (5 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-proper): New variable.
---
gnu/packages/erlang.scm | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index cbe3fcadcd..8263319c17 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -466,6 +466,25 @@ specifications.")
Erlang.")
(license license:asl2.0)))
+(define-public erlang-proper
+ (package
+ (name "erlang-proper")
+ (version "1.3.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "proper" version))
+ (sha256
+ (base32 "030abhb96inlpxzy4qv3zi4gmzi5s6c1l2cvpn22ww85l1hpzfzr"))))
+ (build-system rebar3-build-system)
+ (home-page "http://proper.softlab.ntua.gr/")
+ (synopsis "QuickCheck-inspired property-based testing tool for Erlang")
+ (description "PropEr is a tool for the automated, semi-random,
+property-based testing of Erlang programs. It is fully integrated with
+Erlang's type language, and can also be used for the model-based random
+testing of stateful systems.")
+ (license "GPL")))
+
(define-public erlang-providers
(package
(name "erlang-providers")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 20/22] gnu: Add erlang-rebar3-raw-deps.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (18 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 19/22] gnu: Add erlang-proper Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 21/22] gnu: Add erlang-rebar3-git-vsn Hartmut Goebel
` (4 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-rebar3-raw-deps): New variable.
---
gnu/packages/erlang.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 8263319c17..9c267250a0 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -503,6 +503,23 @@ testing of stateful systems.")
(description "This package provides an Erlang providers library.")
(license license:asl2.0)))
+(define-public erlang-rebar3-raw-deps
+ (package
+ (name "erlang-rebar3-raw-deps")
+ (version "2.0.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "rebar3_raw_deps" version))
+ (sha256
+ (base32 "1w8whb86yl2mpv67biqnwaam8xpm4pq8yyidifzj1svjyd37hxv7"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/soranoba/rebar3_raw_deps")
+ (synopsis "rebar3 plugin for supporting \"raw\" dependencies")
+ (description "This plugin adds support for \"raw\" dependencies to
+rebar3.")
+ (license license:expat)))
+
(define-public erlang-relx
(package
(name "erlang-relx")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 21/22] gnu: Add erlang-rebar3-git-vsn.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (19 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 20/22] gnu: Add erlang-rebar3-raw-deps Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
2020-07-03 17:43 ` [bug#42180] [PATCH 22/22] gnu: Add erlang-rebar3-proper Hartmut Goebel
` (3 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-rebar3-git-vsn): New variable.
---
gnu/packages/erlang.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 9c267250a0..e927f5db11 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -37,6 +37,7 @@
#:use-module (gnu packages gl)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages perl)
+ #:use-module (gnu packages version-control)
#:use-module (gnu packages tls)
#:use-module (gnu packages wxwidgets))
@@ -503,6 +504,35 @@ testing of stateful systems.")
(description "This package provides an Erlang providers library.")
(license license:asl2.0)))
+(define-public erlang-rebar3-git-vsn
+ (package
+ (name "erlang-rebar3-git-vsn")
+ (version "1.1.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "rebar3_git_vsn" version))
+ (sha256
+ (base32 "1ra4xjyc40r97aqb8aq2rll1v8wkf9jyisnbk34xdqcgv9s9iw7d"))))
+ (build-system rebar3-build-system)
+ (inputs
+ `(("git" ,git)))
+ (arguments
+ `(#:tests? #f ;; depends on rebar TODO: remove this dependency
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((git (assoc-ref inputs "git")))
+ (substitute* "src/rebar3_git_vsn.erl"
+ (("rebar_utils:sh\\(\"git " _)
+ (string-append "rebar_utils:sh(\"" git "/bin/git ")))))))))
+ (home-page "https://github.com/soranoba/rebar3_git_vsn")
+ (synopsis "rebar3 plugin for generating the version from git")
+ (description "This plugin adds support for generating the version from
+git.")
+ (license license:expat)))
+
(define-public erlang-rebar3-raw-deps
(package
(name "erlang-rebar3-raw-deps")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH 22/22] gnu: Add erlang-rebar3-proper.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (20 preceding siblings ...)
2020-07-03 17:43 ` [bug#42180] [PATCH 21/22] gnu: Add erlang-rebar3-git-vsn Hartmut Goebel
@ 2020-07-03 17:43 ` Hartmut Goebel
[not found] ` <handler.42180.B.159379803013215.ack@debbugs.gnu.org>
` (2 subsequent siblings)
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2020-07-03 17:43 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-rebar3-proper): New variable.
---
gnu/packages/erlang.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index e927f5db11..6f347ac37b 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -533,6 +533,23 @@ testing of stateful systems.")
git.")
(license license:expat)))
+(define-public erlang-rebar3-proper
+ (package
+ (name "erlang-rebar3-proper")
+ (version "0.11.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "rebar3_proper" version))
+ (sha256
+ (base32 "0gkbq69bvagh43w384fqgycpyr1p1zd3clwp1klcaicmp0x1syj9"))))
+ (build-system rebar3-build-system)
+ (home-page "http://proper.softlab.ntua.gr/")
+ (synopsis "Rebar3 PropEr plugin")
+ (description "This plugin allows running PropEr test suites from within
+rebar3.")
+ (license "BSD")))
+
(define-public erlang-rebar3-raw-deps
(package
(name "erlang-rebar3-raw-deps")
--
2.21.3
^ permalink raw reply related [flat|nested] 78+ messages in thread
[parent not found: <handler.42180.B.159379803013215.ack@debbugs.gnu.org>]
* [bug#42180] [PATCH v2 01/23] guix: Add extracting-download.
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (22 preceding siblings ...)
[not found] ` <handler.42180.B.159379803013215.ack@debbugs.gnu.org>
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#42180] [PATCH v2 02/23] guix: Add importer for hex.pm Hartmut Goebel
` (22 more replies)
2021-10-07 20:58 ` bug#42180: (no subject) Hartmut Goebel
24 siblings, 23 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180
* guix/extracting-download.scm: New file
* Makefile.am (MODULES): Add it.
---
Makefile.am | 1 +
| 179 +++++++++++++++++++++++++++++++++++
2 files changed, 180 insertions(+)
create mode 100644 guix/extracting-download.scm
diff --git a/Makefile.am b/Makefile.am
index b66789fa0b..f2b6c8e8da 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -96,6 +96,7 @@ MODULES = \
guix/discovery.scm \
guix/android-repo-download.scm \
guix/bzr-download.scm \
+ guix/extracting-download.scm \
guix/git-download.scm \
guix/hg-download.scm \
guix/swh.scm \
--git a/guix/extracting-download.scm b/guix/extracting-download.scm
new file mode 100644
index 0000000000..4b7dcc7e83
--- /dev/null
+++ b/guix/extracting-download.scm
@@ -0,0 +1,179 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017 Mathieu Lirzin <mthl@gnu.org>
+;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix extracting-download)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 popen)
+ #:use-module ((guix build download) #:prefix build:)
+ #:use-module ((guix build utils) #:hide (delete))
+ #:use-module (guix gexp)
+ #:use-module (guix modules)
+ #:use-module (guix monads)
+ #:use-module (guix packages) ;; for %current-system
+ #:use-module (guix store)
+ #:use-module (guix utils)
+ #:use-module (srfi srfi-26)
+ #:export (http-fetch/extract
+ download-to-store/extract))
+
+;;;
+;;; Produce fixed-output derivations with data extracted from n archive
+;;; fetched over HTTP or FTP.
+;;;
+;;; This is meant to be used for package repositories where the actual source
+;;; archive is packed into another archive, eventually carrying meta-data.
+;;; Using this derivation saves both storing the outer archive and extracting
+;;; the actual one at build time. The hash is calculated on the actual
+;;; archive to ease validating the stored file.
+;;;
+
+(define* (http-fetch/extract url filename-to-extract hash-algo hash
+ #:optional name
+ #:key (system (%current-system)) (guile (default-guile)))
+ "Return a fixed-output derivation that fetches an archive at URL, and
+extracts FILE_TO_EXTRACT from the archive. The FILE_TO_EXTRACT is expected to
+have hash HASH of type HASH-ALGO (a symbol). By default, the file name is the
+base name of URL; optionally, NAME can specify a different file name."
+ (define file-name
+ (match url
+ ((head _ ...)
+ (basename head))
+ (_
+ (basename url))))
+
+ (define guile-zlib
+ (module-ref (resolve-interface '(gnu packages guile)) 'guile-zlib))
+
+ (define guile-json
+ (module-ref (resolve-interface '(gnu packages guile)) 'guile-json-4))
+
+ (define gnutls
+ (module-ref (resolve-interface '(gnu packages tls)) 'gnutls))
+
+ (define inputs
+ `(("tar" ,(module-ref (resolve-interface '(gnu packages base))
+ 'tar))))
+
+ (define config.scm
+ (scheme-file "config.scm"
+ #~(begin
+ (define-module (guix config)
+ #:export (%system))
+
+ (define %system
+ #$(%current-system)))))
+
+ (define modules
+ (cons `((guix config) => ,config.scm)
+ (delete '(guix config)
+ (source-module-closure '((guix build download)
+ (guix build utils)
+ (guix utils)
+ (web uri))))))
+
+ (define build
+ (with-imported-modules modules
+ (with-extensions (list guile-json gnutls ;for (guix swh)
+ guile-zlib)
+ #~(begin
+ (use-modules (guix build download)
+ (guix build utils)
+ (guix utils)
+ (web uri)
+ (ice-9 match)
+ (ice-9 popen))
+ ;; The code below expects tar to be in $PATH.
+ (set-path-environment-variable "PATH" '("bin")
+ (match '#+inputs
+ (((names dirs outputs ...) ...)
+ dirs)))
+
+ (setvbuf (current-output-port) 'line)
+ (setvbuf (current-error-port) 'line)
+
+ (call-with-temporary-directory
+ (lambda (directory)
+ ;; TODO: Support different archive types, based on content-type
+ ;; or archive name extention.
+ (let* ((file-to-extract (getenv "extract filename"))
+ (port (http-fetch (string->uri (getenv "download url"))
+ #:verify-certificate? #f))
+ (tar (open-pipe* OPEN_WRITE "tar" "-C" directory
+ "-xf" "-" file-to-extract)))
+ (dump-port port tar)
+ (close-port port)
+ (let ((status (close-pipe tar)))
+ (unless (zero? status)
+ (error "tar extraction failure" status)))
+ (copy-file (string-append directory "/"
+ (getenv "extract filename"))
+ #$output))))))))
+
+ (mlet %store-monad ((guile (package->derivation guile system)))
+ (gexp->derivation (or name file-name) build
+
+ ;; Use environment variables and a fixed script name so
+ ;; there's only one script in store for all the
+ ;; downloads.
+ #:script-name "extract-download"
+ #:env-vars
+ `(("download url" . ,url)
+ ("extract filename" . ,filename-to-extract))
+ #:leaked-env-vars '("http_proxy" "https_proxy"
+ "LC_ALL" "LC_MESSAGES" "LANG"
+ "COLUMNS")
+ #:system system
+ #:local-build? #t ; don't offload download
+ #:hash-algo hash-algo
+ #:hash hash
+ #:guile-for-build guile)))
+
+
+(define* (download-to-store/extract store url filename-to-extract
+ #:optional (name (basename url))
+ #:key (log (current-error-port))
+ (verify-certificate? #t))
+ "Download an archive from URL, and extracts FILE_TO_EXTRACT from the archive
+to STORE, either under NAME or URL's basename if omitted. Write progress
+reports to LOG. VERIFY-CERTIFICATE? determines whether or not to validate
+HTTPS server certificates."
+ (call-with-temporary-output-file
+ (lambda (temp port)
+ (let ((result
+ (parameterize ((current-output-port log))
+ (build:url-fetch url temp
+ ;;#:mirrors %mirrors
+ #:verify-certificate?
+ verify-certificate?))))
+ (close port)
+ (and result
+ (call-with-temporary-output-file
+ (lambda (contents port)
+ (let ((tar (open-pipe* OPEN_READ
+ "tar" ;"--auto-compress"
+ "-xf" temp "--to-stdout" filename-to-extract)))
+ (dump-port tar port)
+ (close-port port)
+ (let ((status (close-pipe tar)))
+ (unless (zero? status)
+ (error "tar extraction failure" status)))
+ (add-to-store store name #f "sha256" contents)))))))))
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 02/23] guix: Add importer for hex.pm.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 19:37 ` Maxime Devos
` (2 more replies)
2021-10-06 15:20 ` [bug#42180] [PATCH v2 03/23] guix: Add rebar3 build-system Hartmut Goebel
` (21 subsequent siblings)
22 siblings, 3 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180
* 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.
---
Makefile.am | 3 +
guix/hexpm-download.scm | 74 +++++++++
guix/import/hexpm.scm | 294 ++++++++++++++++++++++++++++++++++
guix/import/utils.scm | 1 +
guix/scripts/import.scm | 2 +-
guix/scripts/import/hexpm.scm | 114 +++++++++++++
guix/upstream.scm | 20 ++-
7 files changed, 506 insertions(+), 2 deletions(-)
create mode 100644 guix/hexpm-download.scm
create mode 100644 guix/import/hexpm.scm
create mode 100644 guix/scripts/import/hexpm.scm
diff --git a/Makefile.am b/Makefile.am
index f2b6c8e8da..ce79d4bc04 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -99,6 +99,7 @@ MODULES = \
guix/extracting-download.scm \
guix/git-download.scm \
guix/hg-download.scm \
+ guix/hexpm-download.scm \
guix/swh.scm \
guix/monads.scm \
guix/monad-repl.scm \
@@ -262,6 +263,7 @@ MODULES = \
guix/import/gnu.scm \
guix/import/go.scm \
guix/import/hackage.scm \
+ guix/import/hexpm.scm \
guix/import/json.scm \
guix/import/kde.scm \
guix/import/launchpad.scm \
@@ -309,6 +311,7 @@ MODULES = \
guix/scripts/import/gnu.scm \
guix/scripts/import/go.scm \
guix/scripts/import/hackage.scm \
+ guix/scripts/import/hexpm.scm \
guix/scripts/import/json.scm \
guix/scripts/import/minetest.scm \
guix/scripts/import/opam.scm \
diff --git a/guix/hexpm-download.scm b/guix/hexpm-download.scm
new file mode 100644
index 0000000000..dd1d039d73
--- /dev/null
+++ b/guix/hexpm-download.scm
@@ -0,0 +1,74 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017 Mathieu Lirzin <mthl@gnu.org>
+;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix hexpm-download)
+ #:use-module (ice-9 match)
+ #:use-module (guix extracting-download)
+ #:use-module (guix packages) ;; for %current-system
+ #:use-module (srfi srfi-26)
+ #:export (hexpm-fetch
+
+ %hexpm-repo-url
+ hexpm-url
+ hexpm-url?
+ hexpm-uri))
+
+;;;
+;;; An <origin> method that fetches a package from the hex.pm repository,
+;;; unwrapping the actual content from the download tarball.
+;;;
+
+(define %hexpm-repo-url
+ (make-parameter "https://repo.hex.pm"))
+(define hexpm-url
+ (string-append (%hexpm-repo-url) "/tarballs/"))
+(define hexpm-url?
+ (cut string-prefix? hexpm-url <>))
+
+(define (hexpm-uri name version)
+ "Return a URI string for the package hosted at hex.pm corresponding to NAME
+and VERSION."
+ (string-append hexpm-url name "-" version ".tar"))
+
+(define* (hexpm-fetch url hash-algo hash
+ #:optional name
+ #:key
+ (filename-to-extract "contents.tar.gz")
+ (system (%current-system))
+ (guile (default-guile)))
+ "Return a fixed-output derivation that fetches URL and extracts
+\"contents.tar.gz\". The output is expected to have hash HASH of type
+HASH-ALGO (a symbol). By default, the file name is the base name of URL;
+optionally, NAME can specify a different file name. By default, the file name
+is the base name of URL with \".gz\" appended; optionally, NAME can specify a
+different file name."
+ (define file-name
+ (match url
+ ((head _ ...)
+ (basename head))
+ (_
+ (basename url))))
+
+ (http-fetch/extract url "contents.tar.gz" hash-algo hash
+ ;; urls typically end with .tar, but contents is .tar.gz
+ (or name (string-append file-name ".gz"))
+ #:system system #:guile guile))
diff --git a/guix/import/hexpm.scm b/guix/import/hexpm.scm
new file mode 100644
index 0000000000..b47806fb81
--- /dev/null
+++ b/guix/import/hexpm.scm
@@ -0,0 +1,294 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com>
+;;; Copyright © 2016 David Craven <david@craven.ch>
+;;; Copyright © 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2020, 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix import hexpm)
+ #:use-module (guix base32)
+ #:use-module ((guix download) #:prefix download:)
+ #:use-module (guix hexpm-download)
+ #:use-module (gcrypt hash)
+ #:use-module (guix http-client)
+ #:use-module (json)
+ #:use-module (guix import utils)
+ #:use-module ((guix import json) #:select (json-fetch))
+ #:use-module ((guix build utils)
+ #:select ((package-name->name+version
+ . hyphen-package-name->name+version)
+ dump-port))
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix monads)
+ #:use-module (guix packages)
+ #:use-module (guix upstream)
+ #:use-module (guix utils)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 regex)
+ #:use-module (ice-9 popen)
+ ;;#:use-module (json)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-2)
+ #:use-module (srfi srfi-26)
+ #:export (hexpm->guix-package
+ guix-package->hexpm-name
+ strings->licenses
+ hexpm-recursive-import
+ %hexpm-updater))
+
+\f
+;;;
+;;; Interface to https://hex.pm/api, version 2.
+;;; https://github.com/hexpm/specifications/blob/master/apiary.apib
+;;; https://github.com/hexpm/specifications/blob/master/endpoints.md
+;;;
+
+(define %hexpm-api-url
+ (make-parameter "https://hex.pm/api"))
+
+(define (package-url name)
+ (string-append (%hexpm-api-url) "/packages/" name))
+
+;; Hexpm Package. /api/packages/${name}
+;; It can have several "releases", each of which has its own set of
+;; requirements, buildtool, etc. - see <hexpm-release> below.
+(define-json-mapping <hexpm-pkgdef> make-hexpm-pkgdef hexpm-pkgdef?
+ json->hexpm
+ (name hexpm-name) ;string
+ (html-url hexpm-html-url "html_url") ;string
+ (docs-html-url hexpm-docs-html-url "docs_html_url") ;string | #nil
+ (meta hexpm-meta "meta" json->hexpm-meta)
+ (versions hexpm-versions "releases" ;list of <hexpm-version>
+ (lambda (vector)
+ (map json->hexpm-version
+ (vector->list vector)))))
+
+;; Hexpm meta.
+(define-json-mapping <hexpm-meta> make-hexpm-meta hexpm-meta?
+ json->hexpm-meta
+ (description hexpm-meta-description) ;string
+ (licenses hexpm-meta-licenses "licenses" ;list of strings
+ (lambda (vector)
+ (or (and vector (vector->list vector))
+ #f))))
+
+;; Hexpm version.
+(define-json-mapping <hexpm-version> make-hexpm-version hexpm-version?
+ json->hexpm-version
+ (number hexpm-version-number "version") ;string
+ (url hexpm-version-url)) ;string
+
+
+(define (lookup-hexpm name)
+ "Look up NAME on https://hex.pm and return the corresopnding <hexpm>
+record or #f if it was not found."
+ (let ((json (json-fetch (package-url name))))
+ (and json
+ (json->hexpm json))))
+
+;; Hexpm release. /api/packages/${name}/releases/${version}
+(define-json-mapping <hexpm-release> make-hexpm-release hexpm-release?
+ json->hexpm-release
+ (number hexpm-release-number "version") ;string
+ (url hexpm-release-url) ;string
+ (requirements hexpm-requirements "requirements")) ;list of <hexpm-dependency>
+;; meta:build_tools -> alist
+
+;; Hexpm dependency. Each dependency (each edge in the graph) is annotated as
+;; being a "normal" dependency or a development dependency. There also
+;; information about the minimum required version, such as "^0.0.41".
+(define-json-mapping <hexpm-dependency> make-hexpm-dependency
+ hexpm-dependency?
+ json->hexpm-dependency
+ (app hexpm-dependency-app "app") ;string
+ (optional hexpm-dependency-optional) ;bool
+ (requirement hexpm-dependency-requirement)) ;string
+
+(define (hexpm-release-dependencies release)
+ "Return the list of dependency names of RELEASE, a <hexpm-release>."
+ (let ((reqs (or (hexpm-requirements release) '#())))
+ (map first reqs))) ;; TODO: also return required version
+
+
+(define (lookup-hexpm-release version*)
+ "Look up RELEASE on hexpm-version-url and return the corresopnding
+<hexpm-release> record or #f if it was not found."
+ (let* ((url (hexpm-version-url version*))
+ (json (json-fetch url)))
+ (json->hexpm-release json)))
+
+\f
+;;;
+;;; Converting hex.pm packages to Guix packages.
+;;;
+
+(define* (make-hexpm-sexp #:key name version tarball-url
+ home-page synopsis description license
+ #:allow-other-keys)
+ "Return the `package' s-expression for a rust package with the given NAME,
+VERSION, tarball-url, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
+ (call-with-temporary-directory
+ (lambda (directory)
+ (let ((port (http-fetch tarball-url))
+ (tar (open-pipe* OPEN_WRITE "tar" "-C" directory
+ "-xf" "-" "contents.tar.gz")))
+ (dump-port port tar)
+ (close-port port)
+
+ (let ((status (close-pipe tar)))
+ (unless (zero? status)
+ (error "tar extraction failure" status))))
+
+ (let ((guix-name (hexpm-name->package-name name))
+ (sha256 (bytevector->nix-base32-string
+ (call-with-input-file
+ (string-append directory "/contents.tar.gz")
+ port-sha256))))
+
+ `(package
+ (name ,guix-name)
+ (version ,version)
+ (source (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri ,name version))
+ (sha256 (base32 ,sha256))))
+ (build-system ,'rebar3-build-system)
+ (home-page ,(match home-page
+ (() "")
+ (_ home-page)))
+ (synopsis ,synopsis)
+ (description ,(beautify-description description))
+ (license ,(match license
+ (() #f)
+ ((license) license)
+ (_ `(list ,@license)))))))))
+
+(define (strings->licenses strings)
+ (filter-map (lambda (license)
+ (and (not (string-null? license))
+ (not (any (lambda (elem) (string=? elem license))
+ '("AND" "OR" "WITH")))
+ (or (spdx-string->license license)
+ license)))
+ strings))
+
+(define (hexpm-latest-version package)
+ (let ((versions (map hexpm-version-number (hexpm-versions package))))
+ (fold (lambda (a b)
+ (if (version>? a b) a b)) (car versions) versions)))
+
+(define* (hexpm->guix-package package-name #:optional version)
+ "Fetch the metadata for PACKAGE-NAME from hexpms.io, and return the
+`package' s-expression corresponding to that package, or #f on failure.
+When VERSION is specified, attempt to fetch that version; otherwise fetch the
+latest version of PACKAGE-NAME."
+
+ (define package
+ (lookup-hexpm package-name))
+
+ (define version-number
+ (and package
+ (or version
+ (hexpm-latest-version package))))
+
+ (define version*
+ (and package
+ (find (lambda (version)
+ (string=? (hexpm-version-number version)
+ version-number))
+ (hexpm-versions package))))
+
+ (define release
+ (and package version*
+ (lookup-hexpm-release version*)))
+
+ (and package version*
+ (let ((dependencies (hexpm-release-dependencies release))
+ (pkg-meta (hexpm-meta package)))
+ (values
+ (make-hexpm-sexp
+ #:name package-name
+ #:version version-number
+ #:home-page (or (hexpm-docs-html-url package)
+ ;; TODO: Homepage?
+ (hexpm-html-url package))
+ #:synopsis (hexpm-meta-description pkg-meta)
+ #:description (hexpm-meta-description pkg-meta)
+ #:license (or (and=> (hexpm-meta-licenses pkg-meta)
+ strings->licenses))
+ #:tarball-url (hexpm-uri package-name version-number))
+ dependencies))))
+
+(define* (hexpm-recursive-import pkg-name #:optional version)
+ (recursive-import pkg-name #f
+ #:repo->guix-package
+ (lambda (name repo)
+ (let ((version (and (string=? name pkg-name)
+ version)))
+ (hexpm->guix-package name version)))
+ #:guix-name hexpm-name->package-name))
+
+(define (guix-package->hexpm-name package)
+ "Return the hex.pm name of PACKAGE."
+ (define (url->hexpm-name url)
+ (hyphen-package-name->name+version
+ (basename (file-sans-extension url))))
+
+ (match (and=> (package-source package) origin-uri)
+ ((? string? url)
+ (url->hexpm-name url))
+ ((lst ...)
+ (any url->hexpm-name lst))
+ (#f #f)))
+
+(define (hexpm-name->package-name name)
+ (string-append "erlang-" (string-join (string-split name #\_) "-")))
+
+\f
+;;;
+;;; Updater
+;;;
+
+(define (hexpm-package? package)
+ "Return true if PACKAGE is a package from hex.pm."
+ (let ((source-url (and=> (package-source package) origin-uri))
+ (fetch-method (and=> (package-source package) origin-method)))
+ (and (eq? fetch-method hexpm-fetch)
+ (match source-url
+ ((? string?)
+ (hexpm-url? source-url))
+ ((source-url ...)
+ (any hexpm-url? source-url))))))
+
+(define (latest-release package)
+ "Return an <upstream-source> for the latest release of PACKAGE."
+ (let* ((hexpm-name (guix-package->hexpm-name package))
+ (hexpm (lookup-hexpm hexpm-name))
+ (version (hexpm-latest-version hexpm))
+ (url (hexpm-uri hexpm-name version)))
+ (upstream-source
+ (package (package-name package))
+ (version version)
+ (urls (list url)))))
+
+(define %hexpm-updater
+ (upstream-updater
+ (name 'hexpm)
+ (description "Updater for hex.pm packages")
+ (pred hexpm-package?)
+ (latest latest-release)))
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index a180742ca3..aaad247c63 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -359,6 +359,7 @@ the expected fields of an <origin> object."
("git-fetch" (@ (guix git-download) git-fetch))
("svn-fetch" (@ (guix svn-download) svn-fetch))
("hg-fetch" (@ (guix hg-download) hg-fetch))
+ ("hexpm-fetch" (@ (guix hexpm-download) hexpm-fetch))
(_ #f)))
(uri (assoc-ref orig "uri"))
(sha256 sha))))))
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index 40fa6759ae..aaadad4adf 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -79,7 +79,7 @@ rather than \\n."
;;;
(define importers '("gnu" "pypi" "cpan" "hackage" "stackage" "egg" "elpa"
- "gem" "go" "cran" "crate" "texlive" "json" "opam"
+ "gem" "go" "cran" "crate" "texlive" "json" "opam" "hexpm"
"minetest"))
(define (resolve-importer name)
diff --git a/guix/scripts/import/hexpm.scm b/guix/scripts/import/hexpm.scm
new file mode 100644
index 0000000000..be5625ca46
--- /dev/null
+++ b/guix/scripts/import/hexpm.scm
@@ -0,0 +1,114 @@
+;;; 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 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix scripts import hexpm)
+ #:use-module (guix ui)
+ #:use-module (guix utils)
+ #:use-module (guix scripts)
+ #:use-module (guix import hexpm)
+ #:use-module (guix scripts import)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-11)
+ #:use-module (srfi srfi-37)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 format)
+ #:export (guix-import-hexpm))
+
+\f
+;;;
+;;; Command-line options.
+;;;
+
+(define %default-options
+ '())
+
+(define (show-help)
+ (display (G_ "Usage: guix import hexpm PACKAGE-NAME
+Import and convert the hex.pm package for PACKAGE-NAME.\n"))
+ (display (G_ "
+ -r, --recursive import packages recursively"))
+ (newline)
+ (display (G_ "
+ -h, --help display this help and exit"))
+ (display (G_ "
+ -V, --version display version information and exit"))
+ (newline)
+ (show-bug-report-information))
+
+(define %options
+ ;; Specification of the command-line options.
+ (cons* (option '(#\h "help") #f #f
+ (lambda args
+ (show-help)
+ (exit 0)))
+ (option '(#\V "version") #f #f
+ (lambda args
+ (show-version-and-exit "guix import hexpm")))
+ (option '(#\r "recursive") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'recursive #t result)))
+ %standard-import-options))
+
+\f
+;;;
+;;; Entry point.
+;;;
+
+(define (guix-import-hexpm . args)
+ (define (parse-options)
+ ;; Return the alist of option values.
+ (args-fold* args %options
+ (lambda (opt name arg result)
+ (leave (G_ "~A: unrecognized option~%") name))
+ (lambda (arg result)
+ (alist-cons 'argument arg result))
+ %default-options))
+
+
+ (let* ((opts (parse-options))
+ (args (filter-map (match-lambda
+ (('argument . value)
+ value)
+ (_ #f))
+ (reverse opts))))
+ (match args
+ ((spec)
+ (define-values (name version)
+ (package-name->name+version spec))
+
+ (if (assoc-ref opts 'recursive)
+ (map (match-lambda
+ ((and ('package ('name name) . rest) pkg)
+ `(define-public ,(string->symbol name)
+ ,pkg))
+ (_ #f))
+ (hexpm-recursive-import name version))
+ (let ((sexp (hexpm->guix-package name version)))
+ (unless sexp
+ (leave (G_ "failed to download meta-data for package '~a'~%")
+ (if version
+ (string-append name "@" version)
+ name)))
+ sexp)))
+ (()
+ (leave (G_ "too few arguments~%")))
+ ((many ...)
+ (leave (G_ "too many arguments~%"))))))
diff --git a/guix/upstream.scm b/guix/upstream.scm
index 632e9ebc4f..f1fb84eb45 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -24,6 +24,10 @@
#:use-module (guix discovery)
#:use-module ((guix download)
#:select (download-to-store url-fetch))
+ #:use-module ((guix hexpm-download)
+ #:select (hexpm-fetch))
+ #:use-module ((guix extracting-download)
+ #:select (download-to-store/extract))
#:use-module (guix gnupg)
#:use-module (guix packages)
#:use-module (guix diagnostics)
@@ -430,9 +434,23 @@ SOURCE, an <upstream-source>."
#:key-download key-download)))
(values version tarball source))))))
+(define* (package-update/hexpm-fetch store package source
+ #:key key-download)
+ "Return the version, tarball, and SOURCE, to update PACKAGE to
+SOURCE, an <upstream-source>."
+ (match source
+ (($ <upstream-source> _ version urls signature-urls)
+ (let* ((url (first urls))
+ (name (or (origin-file-name (package-source package))
+ (string-append (basename url) ".gz")))
+ (tarball (download-to-store/extract
+ store url "contents.tar.gz" name)))
+ (values version tarball source)))))
+
(define %method-updates
;; Mapping of origin methods to source update procedures.
- `((,url-fetch . ,package-update/url-fetch)))
+ `((,url-fetch . ,package-update/url-fetch)
+ (,hexpm-fetch . ,package-update/hexpm-fetch)))
(define* (package-update store package
#:optional (updaters (force %updaters))
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 02/23] guix: Add importer for hex.pm.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 02/23] guix: Add importer for hex.pm Hartmut Goebel
@ 2021-10-06 19:37 ` Maxime Devos
2021-10-06 20:23 ` Hartmut Goebel
2021-10-06 19:38 ` [bug#42180] [bug#51061] " Maxime Devos
2021-10-07 22:01 ` [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download Ludovic Courtès
2 siblings, 1 reply; 78+ messages in thread
From: Maxime Devos @ 2021-10-06 19:37 UTC (permalink / raw)
To: Hartmut Goebel, 42180
[-- Attachment #1: Type: text/plain, Size: 653 bytes --]
Hartmut Goebel schreef op wo 06-10-2021 om 17:20 [+0200]:
> [...]
> +;;;
> +;;; An <origin> method that fetches a package from the hex.pm repository,
> +;;; unwrapping the actual content from the download tarball.
> +;;;
> +
> +(define %hexpm-repo-url
> + (make-parameter "https://repo.hex.pm"))
> +(define hexpm-url
> + (string-append (%hexpm-repo-url) "/tarballs/"))
Where did you find this URL? I took a look at https://hex.pm to download
the source code of an Erlang package, but I'm not finding any download links
for source code, for, say, <https://hex.pm/packages/idna>. Only diffs and
‘previews’.
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 02/23] guix: Add importer for hex.pm.
2021-10-06 19:37 ` Maxime Devos
@ 2021-10-06 20:23 ` Hartmut Goebel
0 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 20:23 UTC (permalink / raw)
To: Maxime Devos, 42180
[-- Attachment #1: Type: text/plain, Size: 762 bytes --]
Am 06.10.21 um 21:37 schrieb Maxime Devos:
>> + (make-parameter"https://repo.hex.pm"))
>> +(define hexpm-url
>> + (string-append (%hexpm-repo-url) "/tarballs/"))
> Where did you find this URL? I took a look athttps://hex.pm to download
> the source code of an Erlang package, but I'm not finding any download links
> for source code, for, say,<https://hex.pm/packages/idna>. Only diffs and
> ‘previews’.
The hex.pm api is, well, not quite good documented. This URL I found at
<https://github.com/hexpm/specifications/blob/master/endpoints.md>. I'll
add a respective comment.
--
Regards
Hartmut Goebel
| Hartmut Goebel |h.goebel@crazy-compilers.com |
|www.crazy-compilers.com | compilers which you thought are impossible |
[-- Attachment #2: Type: text/html, Size: 1937 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [bug#51061] [PATCH v2 02/23] guix: Add importer for hex.pm.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 02/23] guix: Add importer for hex.pm Hartmut Goebel
2021-10-06 19:37 ` Maxime Devos
@ 2021-10-06 19:38 ` Maxime Devos
2021-10-06 20:25 ` Hartmut Goebel
2021-10-07 22:01 ` [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download Ludovic Courtès
2 siblings, 1 reply; 78+ messages in thread
From: Maxime Devos @ 2021-10-06 19:38 UTC (permalink / raw)
To: Hartmut Goebel, 42180, 51061
[-- Attachment #1: Type: text/plain, Size: 778 bytes --]
Hartmut Goebel schreef op wo 06-10-2021 om 17:20 [+0200]:
> + #:use-module (json)
> + #:use-module (guix import utils)
> + #:use-module ((guix import json) #:select (json-fetch))
> + #:use-module ((guix build utils)
> + #:select ((package-name->name+version
> + . hyphen-package-name->name+version)
> + dump-port))
> + #:use-module ((guix licenses) #:prefix license:)
> + #:use-module (guix monads)
> + #:use-module (guix packages)
> + #:use-module (guix upstream)
> + #:use-module (guix utils)
> + #:use-module (ice-9 match)
> + #:use-module (ice-9 regex)
> + #:use-module (ice-9 popen)
> + ;;#:use-module (json)
The ;;#:use-module (json) can be removed.
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 02/23] guix: Add importer for hex.pm Hartmut Goebel
2021-10-06 19:37 ` Maxime Devos
2021-10-06 19:38 ` [bug#42180] [bug#51061] " Maxime Devos
@ 2021-10-07 22:01 ` Ludovic Courtès
2 siblings, 0 replies; 78+ messages in thread
From: Ludovic Courtès @ 2021-10-07 22:01 UTC (permalink / raw)
To: Hartmut Goebel; +Cc: 42180, 51061
Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
> * 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.
At the very least it misses tests and documentation, like for every
importer, and an entry in po/guix/POTFILES.in. The (guix
hexpm-download), like extracting-download.scm, needs more attention
because it’s a core API.
Again, I’m in favor of reverting until it’s been reviewed in more
detail.
> +++ b/guix/hexpm-download.scm
> @@ -0,0 +1,74 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
> +;;; Copyright © 2017 Mathieu Lirzin <mthl@gnu.org>
> +;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
> +;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
> +;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
The list of copyright holders looks bogus.
> +;;; An <origin> method that fetches a package from the hex.pm repository,
> +;;; unwrapping the actual content from the download tarball.
It would be nice to explain in a few words what “the hex.pm repository”
is (I have no idea.)
> +(define* (hexpm-fetch url hash-algo hash
Why another method?
> +++ b/guix/import/hexpm.scm
> @@ -0,0 +1,294 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com>
> +;;; Copyright © 2016 David Craven <david@craven.ch>
> +;;; Copyright © 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
> +;;; Copyright © 2019 Martin Becze <mjbecze@riseup.net>
> +;;; Copyright © 2020, 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
Please strip it.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 03/23] guix: Add rebar3 build-system.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
2021-10-06 15:20 ` [bug#42180] [PATCH v2 02/23] guix: Add importer for hex.pm Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 18:56 ` [bug#51061] " Maxime Devos
2021-10-07 22:09 ` [bug#42180] bug#51061: " Ludovic Courtès
2021-10-06 15:20 ` [bug#42180] [PATCH v2 04/23] gnu: Add erlang-cf Hartmut Goebel
` (20 subsequent siblings)
22 siblings, 2 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180
* guix/build-system/rebar3.scm, guix/build/rebar3-build-system.scm: New files.
* Makefile.am (MODULES): Add them.
---
Makefile.am | 2 +
guix/build-system/rebar3.scm | 143 +++++++++++++++++++++++++++
guix/build/rebar3-build-system.scm | 150 +++++++++++++++++++++++++++++
3 files changed, 295 insertions(+)
create mode 100644 guix/build-system/rebar3.scm
create mode 100644 guix/build/rebar3-build-system.scm
diff --git a/Makefile.am b/Makefile.am
index ce79d4bc04..bb0b5989d2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -163,6 +163,7 @@ MODULES = \
guix/build-system/waf.scm \
guix/build-system/r.scm \
guix/build-system/rakudo.scm \
+ guix/build-system/rebar3.scm \
guix/build-system/ruby.scm \
guix/build-system/scons.scm \
guix/build-system/texlive.scm \
@@ -216,6 +217,7 @@ MODULES = \
guix/build/r-build-system.scm \
guix/build/renpy-build-system.scm \
guix/build/rakudo-build-system.scm \
+ guix/build/rebar3-build-system.scm \
guix/build/ruby-build-system.scm \
guix/build/scons-build-system.scm \
guix/build/texlive-build-system.scm \
diff --git a/guix/build-system/rebar3.scm b/guix/build-system/rebar3.scm
new file mode 100644
index 0000000000..04601c930e
--- /dev/null
+++ b/guix/build-system/rebar3.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build-system rebar3)
+ #:use-module (guix store)
+ #:use-module (guix utils)
+ #:use-module (guix packages)
+ #:use-module (guix derivations)
+ #:use-module (guix search-paths)
+ #:use-module (guix build-system)
+ #:use-module (guix build-system gnu)
+ #:use-module (ice-9 match)
+ #:use-module (srfi srfi-26)
+ #:export (%rebar3-build-system-modules
+ rebar3-build
+ rebar3-build-system))
+
+;;
+;; Standard build procedure for Erlang packages using Rebar3.
+;;
+
+(define %rebar3-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build rebar3-build-system)
+ ,@%gnu-build-system-modules))
+
+(define (default-rebar3)
+ "Return the default Rebar3 package."
+ ;; Lazily resolve the binding to avoid a circular dependency.
+ (let ((erlang-mod (resolve-interface '(gnu packages erlang))))
+ (module-ref erlang-mod 'rebar3)))
+
+(define (default-erlang)
+ "Return the default Erlang package."
+ ;; Lazily resolve the binding to avoid a circular dependency.
+ (let ((erlang-mod (resolve-interface '(gnu packages erlang))))
+ (module-ref erlang-mod 'erlang)))
+
+(define* (lower name
+ #:key source inputs native-inputs outputs system target
+ (rebar (default-rebar3))
+ (erlang (default-erlang))
+ #:allow-other-keys
+ #:rest arguments)
+ "Return a bag for NAME."
+ (define private-keywords
+ '(#:source #:target #:rebar #:inputs #:native-inputs))
+
+ (and (not target) ;XXX: no cross-compilation
+ (bag
+ (name name)
+ (system system)
+ (host-inputs `(,@(if source
+ `(("source" ,source))
+ '())
+ ,@inputs
+ ;; Keep the standard inputs of 'gnu-build-system'.
+ ,@(standard-packages)))
+ (build-inputs `(("rebar" ,rebar)
+ ("erlang" ,erlang) ;; for escriptize
+ ,@native-inputs))
+ (outputs outputs)
+ (build rebar3-build)
+ (arguments (strip-keyword-arguments private-keywords arguments)))))
+
+(define* (rebar3-build store name inputs
+ #:key
+ (tests? #t)
+ (test-target "eunit")
+ (configure-flags ''())
+ (make-flags ''("skip_deps=true" "-vv"))
+ (build-target "compile")
+ ;; TODO: pkg-name
+ (phases '(@ (guix build rebar3-build-system)
+ %standard-phases))
+ (outputs '("out"))
+ (search-paths '())
+ (system (%current-system))
+ (guile #f)
+ (imported-modules %rebar3-build-system-modules)
+ (modules '((guix build rebar3-build-system)
+ (guix build utils))))
+ "Build SOURCE with INPUTS."
+ (define builder
+ `(begin
+ (use-modules ,@modules)
+ (rebar3-build #:name ,name
+ #:source ,(match (assoc-ref inputs "source")
+ (((? derivation? source))
+ (derivation->output-path source))
+ ((source)
+ source)
+ (source
+ source))
+ #:make-flags ,make-flags
+ #:configure-flags ,configure-flags
+ #:system ,system
+ #:tests? ,tests?
+ #:test-target ,test-target
+ #:build-target ,build-target
+ #:phases ,phases
+ #:outputs %outputs
+ #:search-paths ',(map search-path-specification->sexp
+ search-paths)
+ #:inputs %build-inputs)))
+
+ (define guile-for-build
+ (match guile
+ ((? package?)
+ (package-derivation store guile system #:graft? #f))
+ (#f ; the default
+ (let* ((distro (resolve-interface '(gnu packages commencement)))
+ (guile (module-ref distro 'guile-final)))
+ (package-derivation store guile system #:graft? #f)))))
+
+ (build-expression->derivation store name builder
+ #:inputs inputs
+ #:system system
+ #:modules imported-modules
+ #:outputs outputs
+ #:guile-for-build guile-for-build))
+
+(define rebar3-build-system
+ (build-system
+ (name 'rebar3)
+ (description "The standard Rebar3 build system")
+ (lower lower)))
diff --git a/guix/build/rebar3-build-system.scm b/guix/build/rebar3-build-system.scm
new file mode 100644
index 0000000000..d503fc9944
--- /dev/null
+++ b/guix/build/rebar3-build-system.scm
@@ -0,0 +1,150 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
+;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build rebar3-build-system)
+ #:use-module ((guix build gnu-build-system) #:prefix gnu:)
+ #:use-module ((guix build utils) #:hide (delete))
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 ftw)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-26)
+ #:export (%standard-phases
+ rebar3-build))
+
+;;
+;; Builder-side code of the standard build procedure for Erlang packages using
+;; rebar3.
+;;
+;; TODO: Think about whether bindir ("ebin"), libdir ("priv") and includedir
+;; "(include") need to be configurable
+
+(define %erlang-libdir "/lib/erlang/lib")
+
+(define* (erlang-depends #:key inputs #:allow-other-keys)
+ (define input-directories
+ (match inputs
+ (((_ . dir) ...)
+ dir)))
+ (mkdir-p "_checkouts")
+
+ (for-each
+ (lambda (input-dir)
+ (let ((elibdir (string-append input-dir %erlang-libdir)))
+ (when (directory-exists? elibdir)
+ (for-each
+ (lambda (dirname)
+ (symlink (string-append elibdir "/" dirname)
+ (string-append "_checkouts/" dirname)))
+ (list-directories elibdir)))))
+ input-directories)
+ #t)
+
+(define* (unpack #:key source #:allow-other-keys)
+ "Unpack SOURCE in the working directory, and change directory within the
+source. When SOURCE is a directory, copy it in a sub-directory of the current
+working directory."
+ ;; archives from hexpm typicalls do not contain a directory level
+ ;; TODO: Check if archive contains a directory level
+ (mkdir "source")
+ (chdir "source")
+ (if (file-is-directory? source)
+ (begin
+ ;; Preserve timestamps (set to the Epoch) on the copied tree so that
+ ;; things work deterministically.
+ (copy-recursively source "."
+ #:keep-mtime? #t))
+ (begin
+ (if (string-suffix? ".zip" source)
+ (invoke "unzip" source)
+ (invoke "tar" "xvf" source))))
+ #t)
+
+(define* (build #:key (make-flags '()) (build-target "compile")
+ #:allow-other-keys)
+ (apply invoke `("rebar3" ,build-target ,@make-flags)))
+
+(define* (check #:key target (make-flags '()) (tests? (not target))
+ (test-target "eunit")
+ #:allow-other-keys)
+ (if tests?
+ (apply invoke `("rebar3" ,test-target ,@make-flags))
+ (format #t "test suite not run~%"))
+ #t)
+
+(define (erlang-package? name)
+ "Check if NAME correspond to the name of an Erlang package."
+ (string-prefix? "erlang-" name))
+
+(define (package-name-version->erlang-name name+ver)
+ "Convert the Guix package NAME-VER to the corresponding Erlang name-version
+format. Essentially drop the prefix used in Guix and replace dashes by
+underscores."
+ (let* ((name- (package-name->name+version name+ver)))
+ (string-join
+ (string-split
+ (if (erlang-package? name-) ; checks for "erlang-" prefix
+ (string-drop name- (string-length "erlang-"))
+ name-)
+ #\-)
+ "_")))
+
+(define (list-directories directory)
+ "Return file names of the sub-directory of DIRECTORY."
+ (scandir directory
+ (lambda (file)
+ (and (not (member file '("." "..")))
+ (file-is-directory? (string-append directory "/" file))))))
+
+(define* (install #:key name outputs
+ (pkg-name (package-name-version->erlang-name name))
+ #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (build-dir "_build/default/lib")
+ (pkg-dir (string-append out %erlang-libdir "/" pkg-name)))
+ (for-each
+ (lambda (pkg)
+ (for-each
+ (lambda (dirname)
+ (let ((src-dir (string-append build-dir "/" pkg "/" dirname))
+ (dst-dir (string-append pkg-dir "/" dirname)))
+ (when (file-exists? src-dir)
+ (copy-recursively src-dir dst-dir #:follow-symlinks? #t))
+ (false-if-exception
+ (delete-file (string-append dst-dir "/.gitignore")))))
+ '("ebin" "include" "priv")))
+ (list-directories build-dir))
+ (false-if-exception
+ (delete-file (string-append pkg-dir "/priv/Run-eunit-loop.expect")))
+ #t))
+
+(define %standard-phases
+ (modify-phases gnu:%standard-phases
+ (replace 'unpack unpack)
+ (delete 'bootstrap)
+ (delete 'configure)
+ (add-before 'build 'erlang-depends erlang-depends)
+ (replace 'build build)
+ (replace 'check check)
+ (replace 'install install)))
+
+(define* (rebar3-build #:key inputs (phases %standard-phases)
+ #:allow-other-keys #:rest args)
+ "Build the given Erlang package, applying all of PHASES in order."
+ (apply gnu:gnu-build #:inputs inputs #:phases phases args))
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 03/23] guix: Add rebar3 build-system.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 03/23] guix: Add rebar3 build-system Hartmut Goebel
@ 2021-10-06 18:56 ` Maxime Devos
2021-10-06 20:27 ` [bug#42180] " Hartmut Goebel
2021-10-07 22:09 ` [bug#42180] bug#51061: " Ludovic Courtès
1 sibling, 1 reply; 78+ messages in thread
From: Maxime Devos @ 2021-10-06 18:56 UTC (permalink / raw)
To: Hartmut Goebel, 42180, 51061
[-- Attachment #1: Type: text/plain, Size: 1436 bytes --]
Hartmut Goebel schreef op wo 06-10-2021 om 17:20 [+0200]:
> +(define* (lower name
> + #:key source inputs native-inputs outputs system target
> + (rebar (default-rebar3))
> + (erlang (default-erlang))
> + #:allow-other-keys
> + #:rest arguments)
> + "Return a bag for NAME."
> + (define private-keywords
> + '(#:source #:target #:rebar #:inputs #:native-inputs))
> +
> + (and (not target) ;XXX: no cross-compilation
> + (bag
> + (name name)
> + (system system)
> + (host-inputs `(,@(if source
> + `(("source" ,source))
> + '())
> + ,@inputs
> + ;; Keep the standard inputs of 'gnu-build-system'.
> + ,@(standard-packages)))
(standard-packages) contains packages like gcc, coreutils, bash, ...,
which should be in build-inputs. Not that it matters much here,
as this procedure doesn't support cross-compilation.
> + (build-inputs `(("rebar" ,rebar)
> + ("erlang" ,erlang) ;; for escriptize
> + ,@native-inputs))
> + (outputs outputs)
> + (build rebar3-build)
> + (arguments (strip-keyword-arguments private-keywords arguments)))))
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [bug#51061] [PATCH v2 03/23] guix: Add rebar3 build-system.
2021-10-06 18:56 ` [bug#51061] " Maxime Devos
@ 2021-10-06 20:27 ` Hartmut Goebel
2021-10-06 21:25 ` Maxime Devos
0 siblings, 1 reply; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 20:27 UTC (permalink / raw)
To: Maxime Devos, 42180, 51061
[-- Attachment #1: Type: text/plain, Size: 789 bytes --]
Am 06.10.21 um 20:56 schrieb Maxime Devos:
>> + (host-inputs `(,@(if source
>> + `(("source" ,source))
>> + '())
>> + ,@inputs
>> + ;; Keep the standard inputs of 'gnu-build-system'.
>> + ,@(standard-packages)))
> (standard-packages) contains packages like gcc, coreutils, bash, ...,
> which should be in build-inputs. Not that it matters much here,
> as this procedure doesn't support cross-compilation.
Not sure what you want to tell me. Anything you recommend me to change?
--
Regards
Hartmut Goebel
| Hartmut Goebel |h.goebel@crazy-compilers.com |
|www.crazy-compilers.com | compilers which you thought are impossible |
[-- Attachment #2: Type: text/html, Size: 1471 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [bug#51061] [PATCH v2 03/23] guix: Add rebar3 build-system.
2021-10-06 20:27 ` [bug#42180] " Hartmut Goebel
@ 2021-10-06 21:25 ` Maxime Devos
2021-10-06 21:36 ` Hartmut Goebel
0 siblings, 1 reply; 78+ messages in thread
From: Maxime Devos @ 2021-10-06 21:25 UTC (permalink / raw)
To: Hartmut Goebel, 42180, 51061
[-- Attachment #1: Type: text/plain, Size: 927 bytes --]
Hartmut Goebel schreef op wo 06-10-2021 om 22:27 [+0200]:
> Am 06.10.21 um 20:56 schrieb Maxime Devos:
> > > + (host-inputs `(,@(if source
> > > + `(("source" ,source))
> > > + '())
> > > + ,@inputs
> > > + ;; Keep the standard inputs of 'gnu-build-system'.
> > > + ,@(standard-packages)))
> >
> > (standard-packages) contains packages like gcc, coreutils, bash, ...,
> > which should be in build-inputs. Not that it matters much here,
> > as this procedure doesn't support cross-compilation.
‘this procedure’ was a bit ambigious here, I meant the procedure 'lower'
that is being defined.
>
> Not sure what you want to tell me. Anything you recommend me to change?
I recommend moving ,@(standard-packages) from host-inputs to build-inputs.
Greetings,
Maxime
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 03/23] guix: Add rebar3 build-system.
2021-10-06 21:25 ` Maxime Devos
@ 2021-10-06 21:36 ` Hartmut Goebel
2021-10-06 21:47 ` [bug#42180] " Maxime Devos
0 siblings, 1 reply; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 21:36 UTC (permalink / raw)
To: Maxime Devos, 42180, 51061
Am 06.10.21 um 23:25 schrieb Maxime Devos:
>
>> Not sure what you want to tell me. Anything you recommend me to change?
> I recommend moving ,@(standard-packages) from host-inputs to build-inputs.
Okay, I'll change this.
Anyhow, I'm curious: Other modules (e.g. guix/build-system/python.scm)
have ",@(standard-packages)" in host-inputs.
--
Regards
Hartmut Goebel
| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [bug#51061] [PATCH v2 03/23] guix: Add rebar3 build-system.
2021-10-06 21:36 ` Hartmut Goebel
@ 2021-10-06 21:47 ` Maxime Devos
2021-10-07 20:57 ` Hartmut Goebel
0 siblings, 1 reply; 78+ messages in thread
From: Maxime Devos @ 2021-10-06 21:47 UTC (permalink / raw)
To: Hartmut Goebel, 42180, 51061
[-- Attachment #1: Type: text/plain, Size: 825 bytes --]
Hartmut Goebel schreef op wo 06-10-2021 om 23:36 [+0200]:
> Am 06.10.21 um 23:25 schrieb Maxime Devos:
> > > Not sure what you want to tell me. Anything you recommend me to change?
> > I recommend moving ,@(standard-packages) from host-inputs to build-inputs.
>
> Okay, I'll change this.
>
> Anyhow, I'm curious: Other modules (e.g. guix/build-system/python.scm)
> have ",@(standard-packages)" in host-inputs.
These build systems are most likely buggy, and these build systems
have a ‘(not target) ; XXX: no cross-compilation’ comment, so I wouldn't
recommend looking at them to determine how to split packages between
host-inputs (= inputs & propagated-inputs but for bags) and build-inputs
(= native-inputs but for bags). Instead, I recommend looking at
'gnu-build-system'.
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [bug#51061] [PATCH v2 03/23] guix: Add rebar3 build-system.
2021-10-06 21:47 ` [bug#42180] " Maxime Devos
@ 2021-10-07 20:57 ` Hartmut Goebel
2021-10-07 22:20 ` [bug#51061] [PATCH v2 01/23] guix: Add extracting-download Ludovic Courtès
0 siblings, 1 reply; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-07 20:57 UTC (permalink / raw)
To: Maxime Devos, 42180, 51061
Hi Maxime,
thanks for the review. I applied the changes as discussed, fixed some
last-minute bug in the importer :-) and pushed as
f86f7e24b39928247729020df0134e2e1c4cde62.
--
Regards
Hartmut Goebel
| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 01/23] guix: Add extracting-download.
2021-10-07 20:57 ` Hartmut Goebel
@ 2021-10-07 22:20 ` Ludovic Courtès
2021-10-08 9:49 ` Hartmut Goebel
2021-10-08 20:25 ` [bug#51061] " Hartmut Goebel
0 siblings, 2 replies; 78+ messages in thread
From: Ludovic Courtès @ 2021-10-07 22:20 UTC (permalink / raw)
To: Hartmut Goebel; +Cc: 42180, Maxime Devos, GNU Guix maintainers, 51061
Hi,
Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
> thanks for the review. I applied the changes as discussed, fixed some
> last-minute bug in the importer :-) and pushed as
> f86f7e24b39928247729020df0134e2e1c4cde62.
That’s really not how we work, nor how we should work IMO. There were
~24h between the time you sent this series and the time you pushed it,
only quick comments on 2 patches out of 23, and zero “LGTMs”.
I would very much like us to stick to our standards, in particular when
proposing changes or additions to core APIs under (guix …). These
things just cannot go in without proper review; they cannot go in
without adequate testing and documentation, as has always been done in
these areas.
Perhaps views differ on what “proper review” is, and we can discuss it
if in doubt. For one thing, and I thought you were familiar with it
since you’ve been around for some time, when someone is done reviewing a
specific bit, they explicitly say so with “LGTM” or similar.
Now, how do we move forward? I would prefer a single patch reverting
all 23 patches now rather than a myriad of tiny fixups hastily reviewed.
WDYT?
I should say that while I’m unhappy with the way this has been done, I’m
glad you’re made this much progress on the Erlang front, and I think
it’s a nice addition.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 01/23] guix: Add extracting-download.
2021-10-07 22:20 ` [bug#51061] [PATCH v2 01/23] guix: Add extracting-download Ludovic Courtès
@ 2021-10-08 9:49 ` Hartmut Goebel
2021-10-09 13:16 ` [bug#42180] bug#51061: " Ludovic Courtès
2021-10-08 20:25 ` [bug#51061] " Hartmut Goebel
1 sibling, 1 reply; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-08 9:49 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 42180, Maxime Devos, GNU Guix maintainers, 51061
Hi Ludo,
> That’s really not how we work, nor how we should work IMO. There were
> ~24h between the time you sent this series and the time you pushed it,
> only quick comments on 2 patches out of 23, and zero “LGTMs”.
I apologize for pushing the patch series that fast. I can't tell what
exactly did make be rush on this - maybe I just wanted to get this from
my table. Not good, anyhow.
> Now, how do we move forward? I would prefer a single patch reverting
> all 23 patches now rather than a myriad of tiny fixups hastily reviewed.
> WDYT?
Fine for me. (I'd appreciate if someone else would do this, as I'm not
sure about a meaningful commit message. An I'll be offline during the
day today.)
I'll then provide a new set of three patches - split by topic: 1)
extracting downloader, 2) hexpm-importer, 3) rebar-build-system and
required packages.
WDYT?
--
Regards
Hartmut Goebel
| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download.
2021-10-08 9:49 ` Hartmut Goebel
@ 2021-10-09 13:16 ` Ludovic Courtès
0 siblings, 0 replies; 78+ messages in thread
From: Ludovic Courtès @ 2021-10-09 13:16 UTC (permalink / raw)
To: Hartmut Goebel; +Cc: 42180, Maxime Devos, GNU Guix maintainers, 51061
Hi Hartmut,
Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
>> That’s really not how we work, nor how we should work IMO. There were
>> ~24h between the time you sent this series and the time you pushed it,
>> only quick comments on 2 patches out of 23, and zero “LGTMs”.
>
> I apologize for pushing the patch series that fast. I can't tell what
> exactly did make be rush on this - maybe I just wanted to get this
> from my table. Not good, anyhow.
OK. For the record, the process is documented here:
https://guix.gnu.org/manual/devel/en/html_node/Commit-Access.html
If you think something needs to be clarified, please let us know.
> Fine for me. (I'd appreciate if someone else would do this, as I'm not
> sure about a meaningful commit message. An I'll be offline during the
> day today.)
I see Tobias reverted them (thanks!).
> I'll then provide a new set of three patches - split by topic: 1)
> extracting downloader, 2) hexpm-importer, 3) rebar-build-system and
> required packages.
Yes. Please, do take into account the partial review I’ve already done.
In particular, be sure to follow our standards in terms of testing and
documentation (it’s fine to delay documentation for a v2/v3 of the patch
series until we’ve agreed on the interfaces; the commits that will be
pushed will have to include code, documentation, and tests.)
Thanks for your message,
Ludo’.
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 01/23] guix: Add extracting-download.
2021-10-07 22:20 ` [bug#51061] [PATCH v2 01/23] guix: Add extracting-download Ludovic Courtès
2021-10-08 9:49 ` Hartmut Goebel
@ 2021-10-08 20:25 ` Hartmut Goebel
1 sibling, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-08 20:25 UTC (permalink / raw)
To: Ludovic Courtès, GNU Guix maintainers; +Cc: 42180, 51061
Am 08.10.21 um 00:20 schrieb Ludovic Courtès:
> Now, how do we move forward? I would prefer a single patch reverting
> all 23 patches now rather than a myriad of tiny fixups hastily reviewed.
> WDYT?
How should the commit message's first line look like? (I did not find a
suitable example.)
"Revert hasty commits for extracting-downloader, hexpm importer and rebar3"?
I would go ahead and revert my faulty commit series. Since I'll be
offline tomorrow (Saturday), I would not mind if somebody else is
quicker. If it has time until Saturday, I'd bee happy to apply the
commit then.
Sorry to bother you with this late at Friday evening. And sorry again
for not following the process.
--
Regards
Hartmut Goebel
| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 03/23] guix: Add rebar3 build-system Hartmut Goebel
2021-10-06 18:56 ` [bug#51061] " Maxime Devos
@ 2021-10-07 22:09 ` Ludovic Courtès
1 sibling, 0 replies; 78+ messages in thread
From: Ludovic Courtès @ 2021-10-07 22:09 UTC (permalink / raw)
To: Hartmut Goebel; +Cc: 42180, 51061
Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
> * guix/build-system/rebar3.scm, guix/build/rebar3-build-system.scm: New files.
> * Makefile.am (MODULES): Add them.
This looks OK, except it’s undocumented:
https://guix.gnu.org/manual/en/html_node/Build-Systems.html
I’d be in favor of reverting until we can see the doc.
Also, I would have suggested not adding new build systems on ‘master’:
they’ll have to be adjusted on ‘core-updates-frozen’, and I’d rather
distribute the workload on this and avoid merge issues.
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
Is Ricardo involved?
> + (for-each
> + (lambda (pkg)
> + (for-each
> + (lambda (dirname)
> + (let ((src-dir (string-append build-dir "/" pkg "/" dirname))
> + (dst-dir (string-append pkg-dir "/" dirname)))
> + (when (file-exists? src-dir)
> + (copy-recursively src-dir dst-dir #:follow-symlinks? #t))
> + (false-if-exception
> + (delete-file (string-append dst-dir "/.gitignore")))))
> + '("ebin" "include" "priv")))
Regarding the style, please avoid abbreviations: ‘source’, not
‘src-dir’, etc.
https://guix.gnu.org/manual/en/html_node/Formatting-Code.html
The root of a package directory should follow the usual layout: bin,
sbin, share, lib, libexec. I think we should not have “ebin” and
“priv”, unless there’s a very good justification.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 04/23] gnu: Add erlang-cf.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
2021-10-06 15:20 ` [bug#42180] [PATCH v2 02/23] guix: Add importer for hex.pm Hartmut Goebel
2021-10-06 15:20 ` [bug#42180] [PATCH v2 03/23] guix: Add rebar3 build-system Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 05/23] gnu: Add erlang-certifi Hartmut Goebel
` (19 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-cf): New variable.
---
gnu/packages/erlang.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 32bc12ebb8..4c5cfafb64 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2016, 2017 Pjotr Prins <pjotr.guix@thebird.nl>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Nikita <nikita@n0.is>
+;;; Copyright © 2020, 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2021 Oskar Köök <oskar@maatriks.ee>
;;; Copyright © 2021 Cees de Groot <cg@evrl.com>
;;;
@@ -26,8 +27,10 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system gnu)
#:use-module (guix build-system emacs)
+ #:use-module (guix build-system rebar3)
#:use-module (guix download)
#:use-module (guix git-download)
+ #:use-module (guix hexpm-download)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (gnu packages)
@@ -221,3 +224,20 @@ built-in support for concurrency, distribution and fault tolerance.")
"This package provides an Emacs major mode for editing Erlang source
files.")
(license license:asl2.0)))
+
+(define-public erlang-cf
+ (package
+ (name "erlang-cf")
+ (version "0.3.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "cf" version))
+ (sha256
+ (base32 "0vnmbb1n899xw2p4x6c3clpzxcqqdsfbfhh1dfy530i3201vr2h4"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/project-fifo/cf")
+ (synopsis "Terminal colour helper for Erlang io and io_lib")
+ (description "This package provides a helper library for termial colour
+printing extending the io:format syntax to add colours.")
+ (license license:expat)))
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 05/23] gnu: Add erlang-certifi.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (2 preceding siblings ...)
2021-10-06 15:20 ` [bug#42180] [PATCH v2 04/23] gnu: Add erlang-cf Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#42180] [PATCH v2 06/23] gnu: Add erlang-erlware-commons Hartmut Goebel
` (18 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-certifi): New variable.
---
gnu/packages/erlang.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 4c5cfafb64..320b89e8f2 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -225,6 +225,30 @@ built-in support for concurrency, distribution and fault tolerance.")
files.")
(license license:asl2.0)))
+(define-public erlang-certifi
+ (package
+ (name "erlang-certifi")
+ (version "2.7.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "certifi" version))
+ (sha256
+ (base32 "1ssiajvll5nilrnsg23ja3qz2fmvnbhy176c8i0gqj0h1alismn9"))))
+ (build-system rebar3-build-system)
+ (inputs
+ `(("parse-trans" ,erlang-parse-trans)))
+ (home-page "https://github.com/certifi/erlang-certifi/")
+ (synopsis "CA bundle adapted from Mozilla for Erlang")
+ (description "This Erlang library contains a CA bundle that you can
+reference in your Erlang application. This is useful for systems that do not
+have CA bundles that Erlang can find itself, or where a uniform set of CAs is
+valuable.
+
+This an Erlang specific port of certifi. The CA bundle is derived from
+Mozilla's canonical set.")
+ (license license:bsd-3)))
+
(define-public erlang-cf
(package
(name "erlang-cf")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 06/23] gnu: Add erlang-erlware-commons.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (3 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 05/23] gnu: Add erlang-certifi Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 07/23] gnu: Add erlang-cth-readable Hartmut Goebel
` (17 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-erlware-commons): New variable.
---
gnu/packages/erlang.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 320b89e8f2..8e91655fbb 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -265,3 +265,26 @@ Mozilla's canonical set.")
(description "This package provides a helper library for termial colour
printing extending the io:format syntax to add colours.")
(license license:expat)))
+
+(define-public erlang-erlware-commons
+ (package
+ (name "erlang-erlware-commons")
+ (version "1.6.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "erlware_commons" version))
+ (sha256
+ (base32 "0xc3kiylingqrrnzhxm2j2n5gr3hxqgpibhi9nva9bwjs4n155fm"))))
+ (build-system rebar3-build-system)
+ (propagated-inputs
+ `(("erlang-cf" ,erlang-cf)))
+ (native-inputs
+ `(("git" ,git))) ;; Required for tests
+ (arguments
+ `(#:tests? #f)) ;; TODO: 1/219 tests fail - very simple one, though
+ (home-page "http://erlware.github.io/erlware_commons/")
+ (synopsis "Additional standard library for Erlang")
+ (description "Erlware Commons is an Erlware project focused on all aspects
+of reusable Erlang components.")
+ (license license:expat)))
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 07/23] gnu: Add erlang-cth-readable.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (4 preceding siblings ...)
2021-10-06 15:20 ` [bug#42180] [PATCH v2 06/23] gnu: Add erlang-erlware-commons Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 08/23] gnu: Add erlang-bbmustache Hartmut Goebel
` (16 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-cth-readable): New variable.
---
gnu/packages/erlang.scm | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 8e91655fbb..bbd63518f1 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -266,6 +266,27 @@ Mozilla's canonical set.")
printing extending the io:format syntax to add colours.")
(license license:expat)))
+(define-public erlang-cth-readable
+ (package
+ (name "erlang-cth-readable")
+ (version "1.5.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "cth_readable" version))
+ (sha256
+ (base32 "0hqzgd8fvs4d1bhpm6dkm3bm2jik4qbl78s514r5ivwjxw1dzrds"))))
+ (build-system rebar3-build-system)
+ (propagated-inputs
+ `(("erlang-cf" ,erlang-cf)))
+ (arguments
+ `(#:tests? #f)) ;; no test-suite
+ (home-page "https://github.com/ferd/cth_readable")
+ (synopsis "Common Test hooks for more readable logs for Erlang")
+ (description "This package provides an OTP library to be used for CT log
+outputs you want to be readable around all that noise they contain.")
+ (license license:bsd-3)))
+
(define-public erlang-erlware-commons
(package
(name "erlang-erlware-commons")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 08/23] gnu: Add erlang-bbmustache.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (5 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 07/23] gnu: Add erlang-cth-readable Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#42180] [PATCH v2 09/23] gnu: Add erlang-getopt Hartmut Goebel
` (15 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-bbmustache): New variable.
---
gnu/packages/erlang.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index bbd63518f1..f230bb02c5 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -225,6 +225,40 @@ built-in support for concurrency, distribution and fault tolerance.")
files.")
(license license:asl2.0)))
+(define-public erlang-bbmustache
+ (package
+ (name "erlang-bbmustache")
+ (version "1.12.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "bbmustache" version))
+ (sha256
+ (base32 "0wbfayx6940zf57bpwg1m9sk3cpgam2q8n0w74alkrc4gc7hn47w"))))
+ (build-system rebar3-build-system)
+ (inputs
+ `(("erlang-edown" ,erlang-edown)
+ ("erlang-getopt" ,erlang-getopt)
+ ("erlang-rebar3-git-vsn" ,erlang-rebar3-git-vsn)))
+ (arguments
+ `(#:tests? #f ;; requires mustache specification file
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'build 'build-escript
+ (lambda _
+ (invoke "rebar3" "as" "dev" "escriptize")))
+ (add-after 'install 'install-escript
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out")))
+ (install-file "_build/dev/bin/bbmustache"
+ (string-append out "/bin")))
+ #t)))))
+ (home-page "https://github.com/soranoba/bbmustache/")
+ (synopsis "Binary pattern match Based Mustache template engine for Erlang")
+ (description "This Erlang library provides a Binary pattern match Based
+Mustache template engine")
+ (license license:expat)))
+
(define-public erlang-certifi
(package
(name "erlang-certifi")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 09/23] gnu: Add erlang-getopt.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (6 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 08/23] gnu: Add erlang-bbmustache Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 10/23] gnu: Add erlang-eunit-formatters Hartmut Goebel
` (14 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-getopt): New variable.
---
gnu/packages/erlang.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index f230bb02c5..ca2bfa1683 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -343,3 +343,20 @@ outputs you want to be readable around all that noise they contain.")
(description "Erlware Commons is an Erlware project focused on all aspects
of reusable Erlang components.")
(license license:expat)))
+
+(define-public erlang-getopt
+ (package
+ (name "erlang-getopt")
+ (version "1.0.2")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "getopt" version))
+ (sha256
+ (base32 "1yxs36l1ll56zrxn81kw5qd8fv1q14myhjylk7dk31palg7jl725"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/jcomellas/getopt")
+ (synopsis "Command-line options parser for Erlang")
+ (description "This package provides an Erlang module to parse command line
+arguments using the GNU getopt syntax.")
+ (license license:bsd-3)))
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 10/23] gnu: Add erlang-eunit-formatters.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (7 preceding siblings ...)
2021-10-06 15:20 ` [bug#42180] [PATCH v2 09/23] gnu: Add erlang-getopt Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 11/23] gnu: Add erlang-providers Hartmut Goebel
` (13 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-eunit-formatters): New variable.
---
gnu/packages/erlang.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index ca2bfa1683..d2e4da87ed 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -344,6 +344,22 @@ outputs you want to be readable around all that noise they contain.")
of reusable Erlang components.")
(license license:expat)))
+(define-public erlang-eunit-formatters
+ (package
+ (name "erlang-eunit-formatters")
+ (version "0.5.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "eunit_formatters" version))
+ (sha256
+ (base32 "18q3vb12799584kdb998298b6bfh686mzi5s7pkb7djrf93vgf5f"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/seancribbs/eunit_formatters")
+ (synopsis "Better output for eunit suites")
+ (description "This package provides a better output for Erlang eunits.")
+ (license license:asl2.0)))
+
(define-public erlang-getopt
(package
(name "erlang-getopt")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 11/23] gnu: Add erlang-providers.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (8 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 10/23] gnu: Add erlang-eunit-formatters Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 12/23] gnu: Add erlang-parse-trans Hartmut Goebel
` (12 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-providers): New variable.
---
gnu/packages/erlang.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index d2e4da87ed..8fd7342c29 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -376,3 +376,23 @@ of reusable Erlang components.")
(description "This package provides an Erlang module to parse command line
arguments using the GNU getopt syntax.")
(license license:bsd-3)))
+
+(define-public erlang-providers
+ (package
+ (name "erlang-providers")
+ (version "1.9.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "providers" version))
+ (sha256
+ (base32 "0rq5zrqrsv2zgg84yfgh1faahnl4hkn92lja43iqihyiy181813z"))))
+ (propagated-inputs
+ `(("erlang-cf" ,erlang-cf)
+ ("erlang-erlware-commons" ,erlang-erlware-commons)
+ ("erlang-getopt" ,erlang-getopt)))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/tsloughter/providers")
+ (synopsis "Erlang providers library")
+ (description "This package provides an Erlang providers library.")
+ (license license:asl2.0)))
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 12/23] gnu: Add erlang-parse-trans.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (9 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 11/23] gnu: Add erlang-providers Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#42180] [PATCH v2 13/23] gnu: Add erlang-hex-core Hartmut Goebel
` (11 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-parse-trans): New variable.
---
gnu/packages/erlang.scm | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 8fd7342c29..9448ba3d91 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -377,6 +377,25 @@ of reusable Erlang components.")
arguments using the GNU getopt syntax.")
(license license:bsd-3)))
+(define-public erlang-parse-trans
+ (package
+ (name "erlang-parse-trans")
+ (version "3.4.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "parse_trans" version))
+ (sha256
+ (base32 "1g3ablipihi8z64j9195pmrlf7gymyi21j2da9y509igs3q1sxfc"))))
+ (build-system rebar3-build-system)
+ (inputs
+ `(("erlang-getopt" ,erlang-getopt)))
+ (home-page "https://github.com/uwiger/parse_trans")
+ (synopsis "Parse transform utilities for Erlang")
+ (description "This package provides parse transform utilities for
+Erlang.")
+ (license license:asl2.0)))
+
(define-public erlang-providers
(package
(name "erlang-providers")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 13/23] gnu: Add erlang-hex-core.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (10 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 12/23] gnu: Add erlang-parse-trans Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 14/23] gnu: Add erlang-ssl-verify-fun Hartmut Goebel
` (10 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-hex-core): New variable.
---
gnu/packages/erlang.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 9448ba3d91..fe984f6fea 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -377,6 +377,35 @@ of reusable Erlang components.")
arguments using the GNU getopt syntax.")
(license license:bsd-3)))
+(define-public erlang-hex-core
+ (package
+ (name "erlang-hex-core")
+ (version "0.8.2")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "hex_core" version))
+ (sha256
+ (base32 "15fybnqxl5lzkpd8fjj1fxmj8cxcdpkxn0cvwc41cv0vxv3pw797"))))
+ (build-system rebar3-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "rebar3" "as" "test" "proper")))))))
+ (inputs
+ `(("erlang-proper" ,erlang-proper)
+ ("erlang-rebar3-proper" ,erlang-rebar3-proper)))
+ (propagated-inputs
+ `(("erlang-getopt" ,erlang-getopt)))
+ (home-page "https://github.com/hexpm/hex_core")
+ (synopsis "Reference implementation of Hex specifications")
+ (description "This package provides the reference implementation of Hex
+specifications.")
+ (license license:asl2.0)))
+
(define-public erlang-parse-trans
(package
(name "erlang-parse-trans")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 14/23] gnu: Add erlang-ssl-verify-fun.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (11 preceding siblings ...)
2021-10-06 15:20 ` [bug#42180] [PATCH v2 13/23] gnu: Add erlang-hex-core Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 15/23] gnu: Add erlang-relx Hartmut Goebel
` (9 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-ssl-verify-fun): New variable.
---
gnu/packages/erlang.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index fe984f6fea..8f60f4be30 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -444,3 +444,20 @@ Erlang.")
(synopsis "Erlang providers library")
(description "This package provides an Erlang providers library.")
(license license:asl2.0)))
+
+(define-public erlang-ssl-verify-fun
+ (package
+ (name "erlang-ssl-verify-fun")
+ (version "1.1.6")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "ssl_verify_fun" version))
+ (sha256
+ (base32 "0bwdqhnmlv0jfs5mrws2a75zngiihnvcni2hj4l65r5abnw050vx"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/deadtrickster/ssl_verify_fun.erl")
+ (synopsis "SSL verification functions for Erlang")
+ (description "This package provides SSL verification functions for
+Erlang.")
+ (license license:expat)))
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 15/23] gnu: Add erlang-relx.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (12 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 14/23] gnu: Add erlang-ssl-verify-fun Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 16/23] gnu: Add rebar3 Hartmut Goebel
` (8 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-relx): New variable.
---
gnu/packages/erlang.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 8f60f4be30..fcb7ba65b5 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -445,6 +445,32 @@ Erlang.")
(description "This package provides an Erlang providers library.")
(license license:asl2.0)))
+(define-public erlang-relx
+ (package
+ (name "erlang-relx")
+ (version "4.5.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "relx" version))
+ (sha256
+ (base32 "12fjcb5b992ixxkc7v7v55ln1i5qak7dzmzqvf6hx50l1ip3hh58"))))
+ (build-system rebar3-build-system)
+ (propagated-inputs
+ `(("erlang-bbmustache" ,erlang-bbmustache)
+ ("erlang-cf" ,erlang-cf)
+ ("erlang-erlware-commons" ,erlang-erlware-commons)
+ ("erlang-getopt" ,erlang-getopt)
+ ("erlang-providers" ,erlang-providers)))
+ (home-page "https://erlware.github.io/relx/")
+ (synopsis "Release assembler for Erlang/OTP Releases")
+ (description "Relx assembles releases for an Erlang/OTP release. Given a
+release specification and a list of directories in which to search for OTP
+applications it will generate a release output. That output depends heavily on
+what plugins available and what options are defined, but usually it is simply
+a well configured release directory.")
+ (license license:asl2.0)))
+
(define-public erlang-ssl-verify-fun
(package
(name "erlang-ssl-verify-fun")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 16/23] gnu: Add rebar3.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (13 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 15/23] gnu: Add erlang-relx Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#42180] [PATCH v2 17/23] gnu: Add erlang-edown Hartmut Goebel
` (7 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (rebar3): New variable.
---
gnu/packages/erlang.scm | 74 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index fcb7ba65b5..c424fb1420 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -487,3 +487,77 @@ a well configured release directory.")
(description "This package provides SSL verification functions for
Erlang.")
(license license:expat)))
+
+(define-public rebar3
+ (package
+ (name "rebar3")
+ (version "3.17.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/erlang/rebar3.git")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "02sk3whrbprzlih4pgcsd6ngmassfjfmkz21gwvb7mq64pib40k6"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'bootstrap)
+ (add-after 'unpack 'unpack-dependency-sources
+ (lambda* (#:key inputs #:allow-other-keys)
+ (for-each
+ (lambda (pkgname)
+ (let* ((src (string-append pkgname "-source"))
+ (input (assoc-ref inputs src))
+ (checkouts-dir (string-append "_checkouts/" pkgname))
+ (lib-dir (string-append "_build/default/lib/" pkgname)))
+ (mkdir-p checkouts-dir)
+ (invoke "tar" "-xzf" input "-C" checkouts-dir)
+ (mkdir-p lib-dir)
+ (copy-recursively checkouts-dir lib-dir)))
+ (list "bbmustache" "certifi" "cf" "cth_readable"
+ "eunit_formatters" "getopt" "hex_core" "erlware_commons"
+ "parse_trans" "relx" "ssl_verify_fun" "providers"))
+ #t))
+ (delete 'configure)
+ (replace 'build
+ (lambda _
+ (setenv "HOME" (getcwd))
+ (invoke "./bootstrap")))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out")))
+ (install-file "rebar3" (string-append out "/bin")))
+ #t))
+ (delete 'check))))
+ (native-inputs
+ `(("erlang" ,erlang)))
+ (inputs
+ `(("bbmustache-source" ,(package-source erlang-bbmustache))
+ ("certifi-source" ,(package-source erlang-certifi))
+ ("cf-source" ,(package-source erlang-cf))
+ ("cth_readable-source" ,(package-source erlang-cth-readable))
+ ("erlware_commons-source" ,(package-source erlang-erlware-commons))
+ ("eunit_formatters-source" ,(package-source erlang-eunit-formatters))
+ ("getopt-source" ,(package-source erlang-getopt))
+ ("hex_core-source" ,(package-source erlang-hex-core))
+ ("parse_trans-source" ,(package-source erlang-parse-trans))
+ ("relx-source" ,(package-source erlang-relx))
+ ("ssl_verify_fun-source" ,(package-source erlang-ssl-verify-fun))
+ ("providers-source" ,(package-source erlang-providers))))
+ (home-page "https://www.rebar3.org/")
+ (synopsis "Sophisticated build-tool for Erlang projects that follows OTP
+principles")
+ (description "@code{rebar3} is an Erlang build tool that makes it easy to
+compile and test Erlang applications, port drivers and releases.
+
+@code{rebar3} is a self-contained Erlang script, so it's easy to distribute or
+even embed directly in a project. Where possible, rebar uses standard
+Erlang/OTP conventions for project structures, thus minimizing the amount of
+build configuration work. @code{rebar3} also provides dependency management,
+enabling application writers to easily re-use common libraries from a variety
+of locations (git, hg, etc).")
+ (license license:asl2.0)))
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 17/23] gnu: Add erlang-edown.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (14 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 16/23] gnu: Add rebar3 Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#42180] [PATCH v2 18/23] gnu: Add erlang-jsone Hartmut Goebel
` (6 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-edown): New variable.
---
gnu/packages/erlang.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index c424fb1420..b2ba8b22fe 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -321,6 +321,23 @@ printing extending the io:format syntax to add colours.")
outputs you want to be readable around all that noise they contain.")
(license license:bsd-3)))
+(define-public erlang-edown
+ (package
+ (name "erlang-edown")
+ (version "0.8.4")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "edown" version))
+ (sha256
+ (base32 "1khk5yxqjix2irsr02i0zpkv52myakpw4ahsr4fcy81l3xlk58dx"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/uwiger/edown")
+ (synopsis "Markdown extension for EDoc")
+ (description "This package provides an extension for EDoc for generating
+Markdown.")
+ (license license:asl2.0)))
+
(define-public erlang-erlware-commons
(package
(name "erlang-erlware-commons")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 18/23] gnu: Add erlang-jsone.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (15 preceding siblings ...)
2021-10-06 15:20 ` [bug#42180] [PATCH v2 17/23] gnu: Add erlang-edown Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 19/23] gnu: Add erlang-proper Hartmut Goebel
` (5 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-jsone): New variable.
---
gnu/packages/erlang.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index b2ba8b22fe..df822d5466 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -423,6 +423,29 @@ arguments using the GNU getopt syntax.")
specifications.")
(license license:asl2.0)))
+(define-public erlang-jsone
+ (package
+ (name "erlang-jsone")
+ (version "1.6.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "jsone" version))
+ (sha256
+ (base32 "1wdbj4a736bg2fh4qk7y3h6lsdi84ivvypgbkphzy0mfz7nkc97p"))))
+ (build-system rebar3-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'disable-covertool
+ (lambda _
+ (substitute* "rebar.config"
+ (("\\{project_plugins, \\[covertool\\]\\}\\." _) "")))))))
+ (home-page "https://github.com/sile/jsone/")
+ (synopsis "Erlang JSON Library")
+ (description "An Erlang library for encoding and decoding JSON data.")
+ (license license:expat)))
+
(define-public erlang-parse-trans
(package
(name "erlang-parse-trans")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 19/23] gnu: Add erlang-proper.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (16 preceding siblings ...)
2021-10-06 15:20 ` [bug#42180] [PATCH v2 18/23] gnu: Add erlang-jsone Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 20/23] gnu: Add erlang-rebar3-raw-deps Hartmut Goebel
` (4 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-proper): New variable.
---
gnu/packages/erlang.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index df822d5466..3c6ee9038a 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -465,6 +465,32 @@ specifications.")
Erlang.")
(license license:asl2.0)))
+(define-public erlang-proper
+ (package
+ (name "erlang-proper")
+ (version "1.4.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "proper" version))
+ (sha256
+ (base32 "1b0srk0swbns6807vxwhj1hfrql7r14arysaax99kvl12f4q3qci"))))
+ (build-system rebar3-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'disable-covertool
+ (lambda _
+ (substitute* "rebar.config"
+ (("\\{plugins, \\[covertool\\]\\}\\." _) "")))))))
+ (home-page "https://proper-testing.github.io/")
+ (synopsis "QuickCheck-inspired property-based testing tool for Erlang")
+ (description "PropEr is a tool for the automated, semi-random,
+property-based testing of Erlang programs. It is fully integrated with
+Erlang's type language, and can also be used for the model-based random
+testing of stateful systems.")
+ (license license:gpl3+)))
+
(define-public erlang-providers
(package
(name "erlang-providers")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 20/23] gnu: Add erlang-rebar3-raw-deps.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (17 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 19/23] gnu: Add erlang-proper Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#42180] [PATCH v2 21/23] gnu: Add erlang-rebar3-git-vsn Hartmut Goebel
` (3 subsequent siblings)
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-rebar3-raw-deps): New variable.
---
gnu/packages/erlang.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 3c6ee9038a..6003bec251 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -511,6 +511,23 @@ testing of stateful systems.")
(description "This package provides an Erlang providers library.")
(license license:asl2.0)))
+(define-public erlang-rebar3-raw-deps
+ (package
+ (name "erlang-rebar3-raw-deps")
+ (version "2.0.0")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "rebar3_raw_deps" version))
+ (sha256
+ (base32 "1w8whb86yl2mpv67biqnwaam8xpm4pq8yyidifzj1svjyd37hxv7"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/soranoba/rebar3_raw_deps")
+ (synopsis "Rebar3 plugin for supporting \"raw\" dependencies")
+ (description "This plugin adds support for \"raw\" dependencies to
+rebar3.")
+ (license license:expat)))
+
(define-public erlang-relx
(package
(name "erlang-relx")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 21/23] gnu: Add erlang-rebar3-git-vsn.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (18 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 20/23] gnu: Add erlang-rebar3-raw-deps Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 18:43 ` Maxime Devos
2021-10-06 15:20 ` [bug#51061] [PATCH v2 22/23] gnu: Add erlang-rebar3-proper Hartmut Goebel
` (2 subsequent siblings)
22 siblings, 1 reply; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180
* gnu/packages/erlang.scm (erlang-rebar3-git-vsn): New variable.
---
gnu/packages/erlang.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 6003bec251..0e8a277970 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -38,6 +38,7 @@
#:use-module (gnu packages gl)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages perl)
+ #:use-module (gnu packages version-control)
#:use-module (gnu packages tls)
#:use-module (gnu packages wxwidgets))
@@ -511,6 +512,35 @@ testing of stateful systems.")
(description "This package provides an Erlang providers library.")
(license license:asl2.0)))
+(define-public erlang-rebar3-git-vsn
+ (package
+ (name "erlang-rebar3-git-vsn")
+ (version "1.1.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "rebar3_git_vsn" version))
+ (sha256
+ (base32 "1ra4xjyc40r97aqb8aq2rll1v8wkf9jyisnbk34xdqcgv9s9iw7d"))))
+ (build-system rebar3-build-system)
+ (inputs
+ `(("git" ,git)))
+ (arguments
+ `(#:tests? #f ;; depends on rebar TODO: remove this dependency
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((git (assoc-ref inputs "git")))
+ (substitute* "src/rebar3_git_vsn.erl"
+ (("rebar_utils:sh\\(\"git " _)
+ (string-append "rebar_utils:sh(\"" git "/bin/git ")))))))))
+ (home-page "https://github.com/soranoba/rebar3_git_vsn")
+ (synopsis "Rebar3 plugin for generating the version from git")
+ (description "This plugin adds support for generating the version from
+a git checkout.")
+ (license license:expat)))
+
(define-public erlang-rebar3-raw-deps
(package
(name "erlang-rebar3-raw-deps")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 21/23] gnu: Add erlang-rebar3-git-vsn.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 21/23] gnu: Add erlang-rebar3-git-vsn Hartmut Goebel
@ 2021-10-06 18:43 ` Maxime Devos
2021-10-06 21:09 ` Hartmut Goebel
0 siblings, 1 reply; 78+ messages in thread
From: Maxime Devos @ 2021-10-06 18:43 UTC (permalink / raw)
To: Hartmut Goebel, 42180
[-- Attachment #1: Type: text/plain, Size: 1678 bytes --]
Hartmut Goebel schreef op wo 06-10-2021 om 17:20 [+0200]:
> * gnu/packages/erlang.scm (erlang-rebar3-git-vsn): New variable.
> ---
> gnu/packages/erlang.scm | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
> index 6003bec251..0e8a277970 100644
> --- a/gnu/packages/erlang.scm
> +++ b/gnu/packages/erlang.scm
> @@ -38,6 +38,7 @@
> #:use-module (gnu packages gl)
> #:use-module (gnu packages ncurses)
> #:use-module (gnu packages perl)
> + #:use-module (gnu packages version-control)
> #:use-module (gnu packages tls)
> #:use-module (gnu packages wxwidgets))
>
> @@ -511,6 +512,35 @@ testing of stateful systems.")
> (description "This package provides an Erlang providers library.")
> (license license:asl2.0)))
>
> +(define-public erlang-rebar3-git-vsn
> + (package
> + (name "erlang-rebar3-git-vsn")
> + (version "1.1.1")
> + (source
> + (origin
> + (method hexpm-fetch)
> + (uri (hexpm-uri "rebar3_git_vsn" version))
> + (sha256
> + (base32 "1ra4xjyc40r97aqb8aq2rll1v8wkf9jyisnbk34xdqcgv9s9iw7d"))))
> + (build-system rebar3-build-system)
> + (inputs
> + `(("git" ,git)))
> + (arguments
> + `(#:tests? #f ;; depends on rebar TODO: remove this dependency
I think you meant: ‘TODO: add this dependency here’.
I notice there's a ‘rebar’ package, which is also an implicit
input of rebar5-build-system, so maybe this ‘TODO: ’ has already been
resolved, and #:tests? can be set to #true?
Likewise for other packages.
Greetings,
Maxime
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] [PATCH v2 21/23] gnu: Add erlang-rebar3-git-vsn.
2021-10-06 18:43 ` Maxime Devos
@ 2021-10-06 21:09 ` Hartmut Goebel
0 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 21:09 UTC (permalink / raw)
To: Maxime Devos, 42180
[-- Attachment #1: Type: text/plain, Size: 846 bytes --]
Am 06.10.21 um 20:43 schrieb Maxime Devos:
>> + `(#:tests? #f ;; depends on rebar TODO: remove this dependency
> I think you meant: ‘TODO: add this dependency here’.
> I notice there's a ‘rebar’ package, which is also an implicit
> input of rebar5-build-system, so maybe this ‘TODO: ’ has already been
> resolved, and #:tests? can be set to #true?
Thanks for pointing on this. Now that rebar3 is packaged, this very
package could of course use it. I tried to make it work:
;; Running the tests require binary artifact (tar-file containing
;; samples git repos)
So I need to keep the tests disabled, just for a different reason :-\
--
Regards
Hartmut Goebel
| Hartmut Goebel |h.goebel@crazy-compilers.com |
|www.crazy-compilers.com | compilers which you thought are impossible |
[-- Attachment #2: Type: text/html, Size: 1597 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 22/23] gnu: Add erlang-rebar3-proper.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (19 preceding siblings ...)
2021-10-06 15:20 ` [bug#42180] [PATCH v2 21/23] gnu: Add erlang-rebar3-git-vsn Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-06 15:20 ` [bug#51061] [PATCH v2 23/23] gnu: Add erlang-covertool Hartmut Goebel
2021-10-07 21:55 ` [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download Ludovic Courtès
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-rebar3-proper): New variable.
---
gnu/packages/erlang.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 0e8a277970..6a79ee25d3 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -541,6 +541,23 @@ testing of stateful systems.")
a git checkout.")
(license license:expat)))
+(define-public erlang-rebar3-proper
+ (package
+ (name "erlang-rebar3-proper")
+ (version "0.12.1")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "rebar3_proper" version))
+ (sha256
+ (base32 "0j3a9byxbdrfinynq2xdz5mz7s4vpdlsmv7lln80lpqxswnafpfv"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/ferd/rebar3_proper")
+ (synopsis "Rebar3 PropEr plugin")
+ (description "This plugin allows running PropEr test suites from within
+rebar3.")
+ (license license:bsd-3)))
+
(define-public erlang-rebar3-raw-deps
(package
(name "erlang-rebar3-raw-deps")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 23/23] gnu: Add erlang-covertool.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (20 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 22/23] gnu: Add erlang-rebar3-proper Hartmut Goebel
@ 2021-10-06 15:20 ` Hartmut Goebel
2021-10-07 21:55 ` [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download Ludovic Courtès
22 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-06 15:20 UTC (permalink / raw)
To: 42180, 51061
* gnu/packages/erlang.scm (erlang-covertool): New variable.
---
gnu/packages/erlang.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 6a79ee25d3..a55a4707fd 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -301,6 +301,26 @@ Mozilla's canonical set.")
printing extending the io:format syntax to add colours.")
(license license:expat)))
+(define-public erlang-covertool
+ (package
+ (name "erlang-covertool")
+ (version "2.0.4")
+ (source
+ (origin
+ (method hexpm-fetch)
+ (uri (hexpm-uri "covertool" version))
+ (sha256
+ (base32 "10krv66nabzrgkz4k3gfp7zx1x9030vnkhc0n1f1chwzwf4sa6nx"))))
+ (build-system rebar3-build-system)
+ (home-page "https://github.com/covertool/covertool")
+ (synopsis "Convert Erlang cover data into Cobertura XML reports")
+ (description "This package provides a build tool and plugin to convert
+exported Erlang cover data sets into Cobertura XML reports, which can then be
+feed to the Jenkins Cobertura plug-in.
+
+On @emph{hex.pm}, this plugin was previously called @code{rebar_covertool}.")
+ (license license:bsd-2)))
+
(define-public erlang-cth-readable
(package
(name "erlang-cth-readable")
--
2.30.2
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download.
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
` (21 preceding siblings ...)
2021-10-06 15:20 ` [bug#51061] [PATCH v2 23/23] gnu: Add erlang-covertool Hartmut Goebel
@ 2021-10-07 21:55 ` Ludovic Courtès
2021-10-07 22:25 ` [bug#51061] " Tobias Geerinckx-Rice via Guix-patches via
2021-10-08 5:49 ` [bug#51061] " Maxime Devos
22 siblings, 2 replies; 78+ messages in thread
From: Ludovic Courtès @ 2021-10-07 21:55 UTC (permalink / raw)
To: Hartmut Goebel; +Cc: 42180, 51061
Hi Hartmut,
Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
> * guix/extracting-download.scm: New file
> * Makefile.am (MODULES): Add it.
I see you already pushed this change, but AFAICS it hasn’t seen any real
review—not great. We don’t commit the whole project to supporting new
APIs at this level without first having collectively looked into them.
I’ll make some quick comments for now. You might consider reverting to
leave people enough time to comment without pressure.
First, could you explain the rationale and use cases?
I can imagine reasons to do it this way, but also reasons to not do it
this way.
[...]
> +++ b/guix/extracting-download.scm
> @@ -0,0 +1,179 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
> +;;; Copyright © 2017 Mathieu Lirzin <mthl@gnu.org>
> +;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
> +;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
> +;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
This many people? :-)
> +(define* (http-fetch/extract url filename-to-extract hash-algo hash
> + #:optional name
> + #:key (system (%current-system)) (guile (default-guile)))
Why ‘http-fetch’ when we have a generic ‘url-fetch’?
We’d rather like to see ‘url-fetch/extract’, and it should be expressed
in ~10 lines around (@ (guix download) url-fetch).
> + "Return a fixed-output derivation that fetches an archive at URL, and
> +extracts FILE_TO_EXTRACT from the archive. The FILE_TO_EXTRACT is expected to
> +have hash HASH of type HASH-ALGO (a symbol). By default, the file name is the
> +base name of URL; optionally, NAME can specify a different file name."
> + (define file-name
> + (match url
> + ((head _ ...)
> + (basename head))
> + (_
> + (basename url))))
> +
> + (define guile-zlib
> + (module-ref (resolve-interface '(gnu packages guile)) 'guile-zlib))
> +
> + (define guile-json
> + (module-ref (resolve-interface '(gnu packages guile)) 'guile-json-4))
> +
> + (define gnutls
> + (module-ref (resolve-interface '(gnu packages tls)) 'gnutls))
> +
> + (define inputs
> + `(("tar" ,(module-ref (resolve-interface '(gnu packages base))
> + 'tar))))
> +
> + (define config.scm
> + (scheme-file "config.scm"
> + #~(begin
> + (define-module (guix config)
> + #:export (%system))
> +
> + (define %system
> + #$(%current-system)))))
> +
> + (define modules
> + (cons `((guix config) => ,config.scm)
> + (delete '(guix config)
> + (source-module-closure '((guix build download)
> + (guix build utils)
> + (guix utils)
> + (web uri))))))
> +
> + (define build
> + (with-imported-modules modules
> + (with-extensions (list guile-json gnutls ;for (guix swh)
> + guile-zlib)
This is really problematic: this code imports a ton of modules from the
host side. (guix utils) is typically never imported on the build side
because it pulls in everything. (web uri) must not be imported because
it’s part of Guile (I think there’s a warning for this). All the
boilerplate above is because we’re importing the world.
> +(define* (download-to-store/extract store url filename-to-extract
> + #:optional (name (basename url))
> + #:key (log (current-error-port))
> + (verify-certificate? #t))
What about this one? What’s the intended use case?
Last, we’ve put a lot of effort over the years in properly documenting
things, like:
https://guix.gnu.org/manual/en/html_node/origin-Reference.html#index-url_002dfetch
This should be held to the same standards.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#51061] [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download.
2021-10-07 21:55 ` [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download Ludovic Courtès
@ 2021-10-07 22:25 ` Tobias Geerinckx-Rice via Guix-patches via
2021-10-07 22:34 ` Tobias Geerinckx-Rice via Guix-patches via
2021-10-08 5:49 ` [bug#51061] " Maxime Devos
1 sibling, 1 reply; 78+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2021-10-07 22:25 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: h.goebel, 42180, 51061, guix-maintainers
[-- Attachment #1: Type: text/plain, Size: 557 bytes --]
Ludovic Courtès 写道:
> I see you already pushed this change, but AFAICS it hasn’t seen
> any real
> review—not great. We don’t commit the whole project to
> supporting new
> APIs at this level without first having collectively looked into
> them.
>
> I’ll make some quick comments for now. You might consider
> reverting to
> leave people enough time to comment without pressure.
Yes, I think we should revert the series for now. Though let's
give maintainers [CC'd] a day (or so) to chime in.
Kind regards,
T G-R
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download.
2021-10-07 22:25 ` [bug#51061] " Tobias Geerinckx-Rice via Guix-patches via
@ 2021-10-07 22:34 ` Tobias Geerinckx-Rice via Guix-patches via
2021-10-08 9:10 ` Hartmut Goebel
0 siblings, 1 reply; 78+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2021-10-07 22:34 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: h.goebel, 42180, 51061, guix-maintainers
[-- Attachment #1: Type: text/plain, Size: 288 bytes --]
Tobias Geerinckx-Rice 写道:
> Yes, I think we should revert the series for now. Though let's
> give
> maintainers [CC'd] a day (or so) to chime in.
…that is, unless you want to go ahead & do so already, Hartmut :-)
No need to wait if you agree.
Kind regards,
T G-R
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download.
2021-10-07 22:34 ` Tobias Geerinckx-Rice via Guix-patches via
@ 2021-10-08 9:10 ` Hartmut Goebel
2021-10-08 9:39 ` Hartmut Goebel
0 siblings, 1 reply; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-08 9:10 UTC (permalink / raw)
To: Tobias Geerinckx-Rice, Ludovic Courtès
Cc: 42180, 51061, guix-maintainers
Hi,
I'm sorry for the trouble. I'll revert the series - if not yet done by
someone else.
--
Regards
Hartmut Goebel
| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download.
2021-10-08 9:10 ` Hartmut Goebel
@ 2021-10-08 9:39 ` Hartmut Goebel
2021-10-08 21:00 ` Tobias Geerinckx-Rice via Guix-patches via
0 siblings, 1 reply; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-08 9:39 UTC (permalink / raw)
To: Tobias Geerinckx-Rice, Ludovic Courtès
Cc: 42180, 51061, guix-maintainers
Am 08.10.21 um 11:10 schrieb Hartmut Goebel:
> I'll revert the series
I'd prefer if someone else would revert the series. I'm unsure about how
you want this to be done and I didn't spot an appropriate example for
reverting a series in the commit history.
Thanks - and sorry again for the trouble!
--
Regards
Hartmut Goebel
| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download.
2021-10-08 9:39 ` Hartmut Goebel
@ 2021-10-08 21:00 ` Tobias Geerinckx-Rice via Guix-patches via
0 siblings, 0 replies; 78+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2021-10-08 21:00 UTC (permalink / raw)
To: Hartmut Goebel; +Cc: ludo, 42180, 51061, guix-maintainers
[-- Attachment #1: Type: text/plain, Size: 878 bytes --]
Hartmut,
Thanks for the quick reply!
Hartmut Goebel 写道:
> Am 08.10.21 um 11:10 schrieb Hartmut Goebel:
>> I'll revert the series
>
> I'd prefer if someone else would revert the series. I'm unsure
> about
> how you want this to be done and I didn't spot an appropriate
> example
> for reverting a series in the commit history.
I saw no value in 23 noise commits, so here's what I did:
$ git log f63c79bf7674df012517f8e9148f94c611e35f32\
..f86f7e24b39928247729020df0134e2e1c4cde62 --format=oneline |
while read c _; do git revert --no-commit $c; done
Then just used the standard git reversion message, but with a
commit range[0].
> Thanks - and sorry again for the trouble!
Absolutely no worries.
Kind regards,
T G-R
[0]:
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=a1679b74c9aa20bb51bc4add82ebb7ba78926b9c
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#51061] [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download.
2021-10-07 21:55 ` [bug#42180] bug#51061: [PATCH v2 01/23] guix: Add extracting-download Ludovic Courtès
2021-10-07 22:25 ` [bug#51061] " Tobias Geerinckx-Rice via Guix-patches via
@ 2021-10-08 5:49 ` Maxime Devos
2021-10-08 7:05 ` [bug#51061] " Ludovic Courtès
1 sibling, 1 reply; 78+ messages in thread
From: Maxime Devos @ 2021-10-08 5:49 UTC (permalink / raw)
To: Ludovic Courtès, Hartmut Goebel; +Cc: 42180, 51061
[-- Attachment #1: Type: text/plain, Size: 359 bytes --]
Ludovic Courtès schreef op do 07-10-2021 om 23:55 [+0200]:
> Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
>
> > * guix/extracting-download.scm: New file
> > * Makefile.am (MODULES): Add it.
One potential problem, is that there doesn't seem to be code to fallback
to SWH. Does SWH work on tarballs inside tarballs?
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 78+ messages in thread
* [bug#51061] [PATCH v2 01/23] guix: Add extracting-download.
2021-10-08 5:49 ` [bug#51061] " Maxime Devos
@ 2021-10-08 7:05 ` Ludovic Courtès
0 siblings, 0 replies; 78+ messages in thread
From: Ludovic Courtès @ 2021-10-08 7:05 UTC (permalink / raw)
To: Maxime Devos; +Cc: Hartmut Goebel, 42180, 51061
Hi!
Maxime Devos <maximedevos@telenet.be> skribis:
> Ludovic Courtès schreef op do 07-10-2021 om 23:55 [+0200]:
>> Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
>>
>> > * guix/extracting-download.scm: New file
>> > * Makefile.am (MODULES): Add it.
>
> One potential problem, is that there doesn't seem to be code to fallback
> to SWH. Does SWH work on tarballs inside tarballs?
Good point. SWH may archive tarballs inside tarballs as-is, but we’ll
have to check on concrete examples.
Ludo’.
^ permalink raw reply [flat|nested] 78+ messages in thread
* bug#42180: (no subject)
2020-07-03 17:40 [bug#42180] [PATCH 00/22] Add extracting download, importer for hex.pm and rebar3 build-system for Erlang Hartmut Goebel
` (23 preceding siblings ...)
2021-10-06 15:20 ` [bug#42180] [PATCH v2 01/23] guix: Add extracting-download Hartmut Goebel
@ 2021-10-07 20:58 ` Hartmut Goebel
24 siblings, 0 replies; 78+ messages in thread
From: Hartmut Goebel @ 2021-10-07 20:58 UTC (permalink / raw)
To: 42180-close, 51061-close
^ permalink raw reply [flat|nested] 78+ messages in thread