unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: 54088@debbugs.gnu.org
Cc: Efraim Flashner <efraim@flashner.co.il>
Subject: [bug#54088] [PATCH v2 02/19] build: julia: Add 'julia-package-dependencies' as keyword.
Date: Wed, 23 Feb 2022 14:47:05 +0100	[thread overview]
Message-ID: <20220223134722.354636-2-zimon.toutoune@gmail.com> (raw)
In-Reply-To: <20220223134722.354636-1-zimon.toutoune@gmail.com>

From: Efraim Flashner <efraim@flashner.co.il>

* guix/build-system/julia.scm (link-depot): Accept julia-package-dependencies
keyword and use it for 'julia-create-package-toml' function.
(julia-create-package-toml): Use pattern matching.
(julia-build): Add 'julia-pacakge-dependencies'.
* guix/build/julia-build-system.scm (julia-build): Add
'#:julia-package-dependencies' keyword.
---
 guix/build-system/julia.scm       |  7 +++++--
 guix/build/julia-build-system.scm | 14 ++++++++++----
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/guix/build-system/julia.scm b/guix/build-system/julia.scm
index 6261f8a55a..66e7711bcd 100644
--- a/guix/build-system/julia.scm
+++ b/guix/build-system/julia.scm
@@ -2,7 +2,8 @@
 ;;; Copyright © 2019 Nicolò Balzarotti <nicolo@nixo.xyz>
 ;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
-;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2021, 2022 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2022 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -88,6 +89,7 @@ (define* (julia-build name inputs
                       (guile #f)
                       (julia-package-name #f)
                       (julia-package-uuid #f)
+                      (julia-package-dependencies ''())
                       (imported-modules %julia-build-system-modules)
                       (modules '((guix build julia-build-system)
                                  (guix build utils))))
@@ -108,7 +110,8 @@ (define builder
                                                search-paths))
                        #:inputs #$(input-tuples->gexp inputs)
                        #:julia-package-name #$julia-package-name
-                       #:julia-package-uuid #$julia-package-uuid))))
+                       #:julia-package-uuid #$julia-package-uuid
+                       #:julia-package-dependencies #$julia-package-dependencies))))
 
   (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
                                                   system #:graft? #f)))
diff --git a/guix/build/julia-build-system.scm b/guix/build/julia-build-system.scm
index 03d669be64..c5ad65d029 100644
--- a/guix/build/julia-build-system.scm
+++ b/guix/build/julia-build-system.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2019, 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
 ;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
 ;;; Copyright © 2021, 2022 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2022 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -136,7 +137,8 @@ (define* (check #:key tests? source inputs outputs julia-package-name
                                package "/test/runtests.jl"))))))
 
 (define* (link-depot #:key source inputs outputs
-                     julia-package-name julia-package-uuid  #:allow-other-keys)
+                     julia-package-name julia-package-uuid
+                     julia-package-dependencies #:allow-other-keys)
   (let* ((out (assoc-ref outputs "out"))
          (name+version (strip-store-file-name out))
          (version (last (string-split name+version #\-)))
@@ -156,6 +158,7 @@ (define* (link-depot #:key source inputs outputs
         (julia-create-package-toml (getcwd)
                                    julia-package-name julia-package-uuid
                                    version
+                                   julia-package-dependencies
                                    #:file "Project.toml"))
 
     ;; When installing a package, julia looks first at in the JULIA_DEPOT_PATH
@@ -186,9 +189,10 @@ (define* (julia-create-package-toml location
 ") f)
     (when (not (null? deps))
       (display "[deps]\n" f)
-      (for-each (lambda dep
-                  (display (string-append (car (car dep)) " = \"" (cdr (car dep)) "\"\n")
-                           f))
+      (for-each (match-lambda
+                  ((name . uuid)
+                   (display (string-append name " = \"" uuid "\"\n")
+                            f)))
                 deps))
     (close-port f)))
 
@@ -207,6 +211,7 @@ (define %standard-phases
     (delete 'build)))
 
 (define* (julia-build #:key inputs julia-package-name julia-package-uuid
+                      julia-package-dependencies
                       (phases %standard-phases)
                       #:allow-other-keys #:rest args)
   "Build the given Julia package, applying all of PHASES in order."
@@ -214,4 +219,5 @@ (define* (julia-build #:key inputs julia-package-name julia-package-uuid
          #:inputs inputs #:phases phases
          #:julia-package-name julia-package-name
          #:julia-package-uuid julia-package-uuid
+         #:julia-package-dependencies julia-package-dependencies
          args))
-- 
2.34.0





  reply	other threads:[~2022-02-23 13:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 12:47 [bug#54088] [PATCH 0/2] julia-build-system: Add missing julia-pkg-deps Efraim Flashner
2022-02-21 12:51 ` [bug#54088] [PATCH 1/2] build: julia: Add julia-package-dependencies as keyword Efraim Flashner
2022-02-21 12:51 ` [bug#54088] [PATCH 2/2] gnu: julia-media: Use julia-package-dependencies Efraim Flashner
2022-02-23 13:44 ` [bug#54088] [PATCH 0/2] julia-build-system: Add missing julia-pkg-deps zimoun
2022-02-24 10:24   ` bug#54088: " Efraim Flashner
2022-02-24 10:39     ` [bug#54088] " zimoun
2022-02-23 13:47 ` [bug#54088] [PATCH v2 01/19] gnu: julia-xyz: Adjust style using G-expressions zimoun
2022-02-23 13:47   ` zimoun [this message]
2022-02-23 13:47   ` [bug#54088] [PATCH v2 03/19] gnu: julia-media: Use 'julia-package-dependencies' zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 04/19] build: julia-build-system: Fix corner-case for parallel tests zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 05/19] gnu: julia-codeczlib: Delete trailing #t zimoun
2022-02-24 10:23     ` Efraim Flashner
2022-02-24 10:39       ` zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 06/19] gnu: julia-dataframes: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 07/19] gnu: julia-datavalues: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 08/19] gnu: julia-finitediff: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 09/19] gnu: julia-fixedpointnumbers: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 10/19] gnu: julia-http: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 11/19] gnu: julia-imagemagick: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 12/19] gnu: julia-infinity: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 13/19] gnu: julia-matrixfactorizations: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 14/19] gnu: julia-mbedtls: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 15/19] gnu: julia-prettytables: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 16/19] gnu: julia-pycall: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 17/19] gnu: julia-quadmath: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 18/19] gnu: julia-stackviews: " zimoun
2022-02-23 13:47   ` [bug#54088] [PATCH v2 19/19] gnu: julia-uris: " zimoun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220223134722.354636-2-zimon.toutoune@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=54088@debbugs.gnu.org \
    --cc=efraim@flashner.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).