GNU bug report logs - #66090
[PATCH v2 08/23] DRAFT import: juliahub: Add updater and recursive-importer.

Previous Next

Package: guix-patches;

Reported by: Simon Tournier <zimon.toutoune <at> gmail.com>

Date: Mon, 18 Sep 2023 18:06:13 UTC

Severity: normal

Tags: patch

Merged with 66075, 66076, 66077, 66078, 66079, 66080, 66081, 66082, 66083, 66084, 66085, 66086, 66087, 66088, 66089, 66091, 66092

Done: Simon Tournier <zimon.toutoune <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: 62202 <at> debbugs.gnu.org
Cc: Nicolas Graves via Guix-patches via <guix-patches <at> gnu.org>,
 Simon Tournier <zimon.toutoune <at> gmail.com>
Subject: [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 <at> gnu.org>

Signed-off-by: Simon Tournier <zimon.toutoune <at> 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





This bug report was last modified 1 year and 247 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.