[PATCH v2 08/23] DRAFT import: juliahub: Add updater and recursive-importer.

  • Done
  • quality assurance status badge
Details
One participant
  • Simon Tournier
Owner
unassigned
Submitted by
Simon Tournier
Severity
normal
Merged with

Debbugs page

Simon Tournier wrote 1 years ago
(address . 62202@debbugs.gnu.org)
26c9a5ca41ad1697225de11b5513fcfe04d26f71.1695060058.git.zimon.toutoune@gmail.com
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(-)

Toggle diff (54 lines)
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
Simon Tournier wrote 1 years ago
control message for bug #66090
(address . control@debbugs.gnu.org)
867connqt2.fsf@gmail.com
close 66090
quit
Simon Tournier wrote 1 years ago
control message for bug #66075
(address . control@debbugs.gnu.org)
868r93mc3w.fsf@gmail.com
merge 66075 66092 66091 66090
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 66090@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 66090
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help