[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#62202] [PATCH 13/21] import: juliahub: Add support for versions for
From: |
Nicolas Graves |
Subject: |
[bug#62202] [PATCH 13/21] import: juliahub: Add support for versions for juliahub-fetch. |
Date: |
Wed, 15 Mar 2023 13:51:22 +0100 |
---
guix/import/juliahub.scm | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/guix/import/juliahub.scm b/guix/import/juliahub.scm
index b646f93295..6ce0487dba 100644
--- a/guix/import/juliahub.scm
+++ b/guix/import/juliahub.scm
@@ -122,7 +122,7 @@ (define %julia-stdlibs
"Pkg"
"LazyArtifacts"))
-(define (juliahub-uri name)
+(define (juliahub-redirect-uri name)
(let* ((url (string-append "https://docs.juliahub.com/" name "/"))
(port (http-fetch url #:text? #t))
(_ (get-line port))
@@ -134,11 +134,11 @@ (define (juliahub-uri name)
(define (juliahub-url name)
(let* ((url (string-append "https://docs.juliahub.com/" name "/"))
- (uri (juliahub-uri name)))
+ (uri (juliahub-redirect-uri name)))
(string-append url uri "/")))
-(define (juliahub-slug-version name)
- (let* ((uri (juliahub-uri name))
+(define (juliahub-slug+version name)
+ (let* ((uri (juliahub-redirect-uri name))
(slug (string-take uri 5))
(latest-version (string-drop uri 6)))
`(,slug ,latest-version)))
@@ -203,8 +203,12 @@ (define (julia-name->guix-name name)
(define* (juliahub-fetch name #:key (version #f))
"Return a <juliahub-package> record for package NAME, or #f on failure."
- (and=> (json-fetch (string-append (juliahub-url name) "pkg.json"))
- json->juliahub-package))
+ (let ((url (if version
+ (string-append "https://docs.juliahub.com/" name "/"
+ (car (juliahub-slug+version name)) "/"
+ version "/pkg.json")
+ (string-append (juliahub-url name) "pkg.json"))))
+ (and=> (json-fetch url) json->juliahub-package)))
(define (make-julia-sexp name source home-page synopsis description
direct-dependencies test-dependencies-names licenses)
@@ -242,9 +246,9 @@ (define* (juliahub->guix-package package-name
(subdir (assoc-ref package-toml 'subdir))
(tag (latest-git-tag (assoc-ref package-toml 'repo)))
(package (if version
- (juliahub-fetch package-name version)
+ (juliahub-fetch package-name #:version version)
(if tag
- (juliahub-fetch package-name tag)
+ (juliahub-fetch package-name #:version tag)
(juliahub-fetch package-name)))))
(if package
(let-values (((source directory)
--
2.39.2
- [bug#62202] [PATCH 04/21] import: juliahub: Correct source parsing., (continued)
- [bug#62202] [PATCH 04/21] import: juliahub: Correct source parsing., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 03/21] import: juliahub: Add support for native-inputs., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 11/21] import: juliahub: Improve test dependencies parsing., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 09/21] import: juliahub: Improve dependency management., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 06/21] import: juliahub: Add updater and recursive-importer., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 05/21] import: juliahub: Add indirect dependencies., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 08/21] import: juliahub: Simplify juliahub dependency management., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 10/21] import: juliahub: Add functions to parse the git repo for a git tag., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 07/21] import: juliahub: Filter out julia stdlibs., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 12/21] import: juliahub: Handle the case where we have a subdirectory., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 13/21] import: juliahub: Add support for versions for juliahub-fetch.,
Nicolas Graves <=
- [bug#62202] [PATCH 16/21] import: juliahub: Beautify description., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 18/21] import: juliahub: Fix version management., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 14/21] import: juliahub: Filter out stdlibs from test-dependencies., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 15/21] import: juliahub: More robust toml regex parser., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 20/21] import: utils: Rule out texinfo common syntax from @ escape., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 17/21] import: juliahub: Fix license management., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 21/21] import: juliahub: output package names as symbols., Nicolas Graves, 2023/03/15
- [bug#62202] [PATCH 19/21] import: juliahub: Fix undefined homepages., Nicolas Graves, 2023/03/15