[PATCH v2 10/23] DRAFT import: juliahub: Simplify juliahub dependency management.

  • 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)
d21d6314221dd876b598a86a655b658821c3334f.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 | 42 ++++++++++++++--------------------------
1 file changed, 14 insertions(+), 28 deletions(-)

Toggle diff (80 lines)
diff --git a/guix/import/juliahub.scm b/guix/import/juliahub.scm
index af08f3d698d0..b1eeb736a824 100644
--- a/guix/import/juliahub.scm
+++ b/guix/import/juliahub.scm
@@ -100,26 +100,13 @@ (define (juliahub-slug-version name)
(latest-version (string-drop uri 6)))
`(,slug ,latest-version)))
-(define (json->juliahub-direct-dependencies vector)
+(define (json->juliahub-dependencies vector)
(if (vector? vector)
(filter-map
(lambda (el)
(let ((dep (json->juliahub-dependency el)))
- (if (and (juliahub-dependency-direct? dep)
- (not (member (juliahub-dependency-name dep)
- %julia-stdlibs)))
- dep
- #f)))
- (vector->list vector))))
-
-(define (json->juliahub-indirect-dependencies vector)
- (if (vector? vector)
- (filter-map
- (lambda (el)
- (let ((dep (json->juliahub-dependency el)))
- (if (and (not (juliahub-dependency-direct? dep))
- (not (member (juliahub-dependency-name dep)
- %julia-stdlibs)))
+ (if (not (member (juliahub-dependency-name dep)
+ %julia-stdlibs))
dep
#f)))
(vector->list vector))))
@@ -157,12 +144,9 @@ (define-json-mapping <juliahub-package> make-juliahub-package juliahub-package?
(readme juliahub-package-readme) ;string
(version juliahub-package-version) ;string
(description juliahub-package-description) ;string
- (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>
+ (dependencies
+ juliahub-package-dependencies "deps"
+ json->juliahub-dependencies) ;list of <juliahub-dependency>
(url juliahub-package-url) ;string
(uuid juliahub-package-uuid) ;string
(license juliahub-package-license)) ;string
@@ -184,7 +168,7 @@ (define* (juliahub-fetch name #:key (version #f))
json->juliahub-package))
(define (make-julia-sexp name source home-page synopsis description
- direct-dependencies test-dependencies-names licenses)
+ dependencies test-dependencies-names licenses)
"Return the `package' s-expression for a Julia package with the given NAME,
VERSION, URI, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES,
TEST-DEPENDENCIES-NAMES and LICENSES."
@@ -193,11 +177,13 @@ (define (make-julia-sexp name source home-page synopsis description
(version ,version)
(source ,source)
(build-system julia-build-system)
- ,@(if (null? direct-dependencies)
- '()
- `((propagated-inputs
- (list ,@(map (compose julia-name->guix-name juliahub-dependency-name)
- direct-dependencies)))))
+ ,@(let ((direct-dependencies
+ (filter julia-dependency-direct? dependencies)))
+ (if (null? direct-dependencies)
+ '()
+ `((propagated-inputs
+ (list ,@(map (compose julia-name->guix-name juliahub-dependency-name)
+ direct-dependencies))))))
,@(if (null? test-dependencies-names)
'()
`((native-inputs
--
2.38.1
Simon Tournier wrote 1 years ago
control message for bug #66076
(address . control@debbugs.gnu.org)
86led3mc80.fsf@gmail.com
close 66076
quit
Simon Tournier wrote 1 years ago
control message for bug #66075
(address . control@debbugs.gnu.org)
86il87mc7j.fsf@gmail.com
merge 66075 66076
quit
Simon Tournier wrote 1 years ago
(address . control@debbugs.gnu.org)
86h6nrmc72.fsf@gmail.com
merge 66075 66077
quit
Simon Tournier wrote 1 years ago
(address . control@debbugs.gnu.org)
86fs3bmc6t.fsf@gmail.com
merge 66075 66078
quit
Simon Tournier wrote 1 years ago
(address . control@debbugs.gnu.org)
86edivmc6m.fsf@gmail.com
merge 66075 66079
quit
Simon Tournier wrote 1 years ago
(address . control@debbugs.gnu.org)
86cyyfmc6f.fsf@gmail.com
merge 66075 66080
quit
Simon Tournier wrote 1 years ago
(address . control@debbugs.gnu.org)
86bkdzmc63.fsf@gmail.com
merge 66075 66081
quit
Simon Tournier wrote 1 years ago
(address . control@debbugs.gnu.org)
86a5tjmc4o.fsf@gmail.com
merge 66075 66089 66088 66087 66086 66085 66084 66083 66082
quit
Simon Tournier wrote 1 years ago
(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 66076@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 66076
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