summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-05-18 16:33:37 +0200
committerLudovic Courtès <ludo@gnu.org>2023-05-31 23:25:26 +0200
commitd46d1bee1ea93d8fba97d7f8cadd142c493dc3bf (patch)
tree154c0a0fc30b31ca7662183781925b0ae8fee330 /guix
parenta738c1a0c75af8b65ab5cad893e9ac2af6633d29 (diff)
import: elpa: Updater provides input list.
* guix/import/elpa.scm (elpa-dependency->upstream-input): New procedure. (latest-release): Add 'inputs' field. * tests/elpa.scm ("package-latest-release"): New test.
Diffstat (limited to 'guix')
-rw-r--r--guix/import/elpa.scm30
1 files changed, 28 insertions, 2 deletions
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 1313a8aa67..e65cf6683b 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -272,6 +272,25 @@ the package named PACKAGE-NAME."
(assq-ref recipe ':fetcher))
#f)))
+(define (elpa-dependency->upstream-input dependency)
+ "Convert DEPENDENCY, an sexp as returned by 'elpa-package-inputs', into an
+<upstream-input>."
+ (match dependency
+ ((name version)
+ (and (not (emacs-standard-library? (symbol->string name)))
+ (upstream-input
+ (name (symbol->string name))
+ (downstream-name (elpa-guix-name name))
+ (type 'propagated)
+ (min-version (if (pair? version)
+ (string-join (map number->string version) ".")
+ #f))
+ (max-version (match version
+ (() #f)
+ ((_) #f)
+ ((_ _) #f)
+ (_ min-version))))))))
+
(define default-files-spec
;; This contains more than just the things contained in %default-include and
;; %default-exclude, presumably because this includes source files (*.in,
@@ -421,12 +440,19 @@ type '<elpa-package>'."
(elpa-version->string raw-version))))
(url (match info
((_ raw-version reqs synopsis kind . rest)
- (package-source-url kind name version repo)))))
+ (package-source-url kind name version repo))))
+ (inputs (match info
+ ((name raw-version reqs . _)
+ (filter-map elpa-dependency->upstream-input
+ (if (eq? 'nil reqs)
+ '()
+ reqs))))))
(upstream-source
(package (package-name package))
(version version)
(urls (list url))
- (signature-urls (list (string-append url ".sig"))))))))
+ (signature-urls (list (string-append url ".sig")))
+ (inputs inputs))))))
(define elpa-repository
(memoize