Subject: [bug#66075] [PATCH v2 07/23] DRAFT import: juliahub: Add indirect dependencies.

From: Simon Tournier <[email-masked]>
Date: Mon, 18 Sep 2023 20:03:14 +0200

From: Nicolas Graves via Guix-patches via <[email-masked]>

Signed-off-by: Simon Tournier <[email-masked]>
---
 guix/import/juliahub.scm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/guix/import/juliahub.scm b/guix/import/juliahub.scm
index 4c3ceed10904..fb361a004435 100644
--- a/guix/import/juliahub.scm
+++ b/guix/import/juliahub.scm
@@ -67,6 +67,16 @@ (define (json->juliahub-direct-dependencies vector)
                #f)))
        (vector->list vector))))
 
+(define (json->juliahub-indirect-dependencies vector)
+  (if (vector? vector)
+      (filter-map
+       (lambda (el)
+         (let ((dep (json->juliahub-dependency el)))
+           (if (not (juliahub-dependency-direct? dep))
+               dep
+               #f)))
+       (vector->list vector))))
+
 (define (ini-list->extra-dependencies lst)
   (match lst
     (('(extras) ooo ...)
@@ -103,6 +113,9 @@ (define-json-mapping <juliahub-package> make-juliahub-package juliahub-package?
   (direct-dependencies
    juliahub-package-direct-dependencies "deps"
    json->juliahub-direct-dependencies) ;list of <juliahub-dependency>
+  (indirect-dependencies
+   juliahub-package-indirect-dependencies "deps"
+   json->juliahub-indirect-dependencies) ;list of <juliahub-dependency>
   (url juliahub-package-url) ;string
   (uuid juliahub-package-uuid) ;string
   (license juliahub-package-license)) ;string
@@ -181,7 +194,7 @@ (define* (juliahub->guix-package package-name
                      (juliahub-package-direct-dependencies package)
                      test-dependencies-names
                      licenses)
-                    (append dependencies-names test-dependencies))))
+                    (append dependencies-names test-dependencies-names))))
         (values #f '()))))
 
 (define* (import-release package #:key (version #f))
-- 
2.38.1