[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#62202] [PATCH v2 08/23] DRAFT import: juliahub: Add updater and rec
From: |
Simon Tournier |
Subject: |
[bug#62202] [PATCH v2 08/23] DRAFT import: juliahub: Add updater and recursive-importer. |
Date: |
Mon, 18 Sep 2023 20:03:15 +0200 |
From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
Signed-off-by: Simon Tournier <zimon.toutoune@gmail.com>
---
guix/import/juliahub.scm | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/guix/import/juliahub.scm b/guix/import/juliahub.scm
index fb361a004435..c38c830caaa0 100644
--- a/guix/import/juliahub.scm
+++ b/guix/import/juliahub.scm
@@ -34,7 +34,9 @@ (define-module (guix import juliahub)
#:use-module (json)
#:use-module ((guix licenses) #:prefix license:)
- #:export (juliahub->guix-package))
+ #:export (juliahub->guix-package
+ %juliahub-updater
+ juliahub-recursive-import))
(define (juliahub-uri name)
(let* ((url (string-append "https://docs.juliahub.com/" name "/"))
@@ -197,16 +199,26 @@ (define* (juliahub->guix-package package-name
(append dependencies-names test-dependencies-names))))
(values #f '()))))
+(define (guix-package->juliahub-name package)
+ (let* ((url (juliahub-package-url package))
+ (git-name (car (last-pair (string-split url #\/))))
+ (ungitted-name (if (string-suffix? ".git" git-name)
+ (string-drop-right git-name 4)
+ git-name))
+ (package-name (if (string-suffix? ".jl" ungitted-name)
+ (string-drop-right ungitted-name 4)
+ ungitted-name)))
+ package-name))
+
(define* (import-release package #:key (version #f))
"Return an <upstream-source> for the latest release of PACKAGE."
(let* ((package-name (guix-package->juliahub-name package))
(package (juliahub-fetch package-name))
- (version (or version (juliahub-version gem)))
- (url (rubyjuliahubs-uri gem-name version)))
+ (version (or version (juliahub-package-version package))))
(upstream-source
(package (package-name package))
(version version)
- (urls (list url)))))
+ (urls (list (juliahub-package-url package))))))
(define %juliahub-updater
(upstream-updater
@@ -219,5 +231,5 @@ (define* (juliahub-recursive-import package-name #:optional
version)
(recursive-import package-name
#:repo '()
#:repo->guix-package juliahub->guix-package
- #:guix-name ruby-package-name
+ #:guix-name julia-name->guix-name
#:version version))
--
2.38.1
- [bug#62202] [PATCH v2 01/23] DRAFT guix: import: go: Add optional transform-version to vcs->origin., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 03/23] DRAFT TODO: guix: import: utils: Fix corner cases beautify-descritption., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 02/23] DRAFT TODO guix: import: utils: Add git->origin+dir., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 08/23] DRAFT import: juliahub: Add updater and recursive-importer.,
Simon Tournier <=
- [bug#62202] [PATCH v2 10/23] DRAFT import: juliahub: Simplify juliahub dependency management., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 07/23] DRAFT import: juliahub: Add indirect dependencies., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 16/23] DRAFT import: juliahub: Filter out stdlibs from test-dependencies., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 04/23] DRAFT import: Add julia., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 20/23] DRAFT import: juliahub: Fix version management., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 22/23] DRAFT import: juliahub: output package names as symbols., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 12/23] DRAFT import: juliahub: Add functions to parse the git repo for a git tag., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 23/23] DRAFT guix: import: julia: Fix beautify., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 06/23] DRAFT import: juliahub: Correct source parsing., Simon Tournier, 2023/09/18
- [bug#62202] [PATCH v2 18/23] DRAFT import: juliahub: Beautify description., Simon Tournier, 2023/09/18