Subject: [bug#66087] [PATCH v2 09/23] DRAFT import: juliahub: Filter out julia stdlibs.

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

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

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

diff --git a/guix/import/juliahub.scm b/guix/import/juliahub.scm
index c38c830caaa0..af08f3d698d0 100644
--- a/guix/import/juliahub.scm
+++ b/guix/import/juliahub.scm
@@ -38,6 +38,47 @@ (define-module (guix import juliahub)
             %juliahub-updater
             juliahub-recursive-import))
 
+;; To update, see file sysimg.jl
+(define %julia-stdlibs
+  (list "julia"
+        "ArgTools"
+        "Artifacts"
+        "Base64"
+        "CRC32c"
+        "FileWatching"
+        "Libdl"
+        "Logging"
+        "Mmap"
+        "NetworkOptions"
+        "SHA"
+        "Serialization"
+        "Sockets"
+        "Unicode"
+        "DelimitedFiles"
+        "LinearAlgebra"
+        "Markdown"
+        "Printf"
+        "Random"
+        "Tar"
+        "Dates"
+        "Distributed"
+        "Future"
+        "InteractiveUtils"
+        "LibGit2"
+        "Profile"
+        "SparseArrays"
+        "UUIDs"
+        "REPL"
+        "SharedArrays"
+        "Statistics"
+        "SuiteSparse"
+        "TOML"
+        "Test"
+        "LibCURL"
+        "Downloads"
+        "Pkg"
+        "LazyArtifacts"))
+
 (define (juliahub-uri name)
   (let* ((url (string-append "https://docs.juliahub.com/" name "/"))
          (port (http-fetch url #:text? #t))
@@ -64,7 +105,9 @@ (define (json->juliahub-direct-dependencies vector)
       (filter-map
        (lambda (el)
          (let ((dep (json->juliahub-dependency el)))
-           (if (juliahub-dependency-direct? dep)
+           (if (and (juliahub-dependency-direct? dep)
+                    (not (member (juliahub-dependency-name dep)
+                                 %julia-stdlibs)))
                dep
                #f)))
        (vector->list vector))))
@@ -74,7 +117,9 @@ (define (json->juliahub-indirect-dependencies vector)
       (filter-map
        (lambda (el)
          (let ((dep (json->juliahub-dependency el)))
-           (if (not (juliahub-dependency-direct? dep))
+           (if (and (not (juliahub-dependency-direct? dep))
+                    (not (member (juliahub-dependency-name dep)
+                                 %julia-stdlibs)))
                dep
                #f)))
        (vector->list vector))))
-- 
2.38.1