From patchwork Wed Feb 23 13:47:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 37416 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E565227BBEA; Wed, 23 Feb 2022 13:48:37 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2FF3127BBE9 for ; Wed, 23 Feb 2022 13:48:37 +0000 (GMT) Received: from localhost ([::1]:47590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMs0S-0003h8-8J for patchwork@mira.cbaines.net; Wed, 23 Feb 2022 08:48:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMrzu-00035n-DU for guix-patches@gnu.org; Wed, 23 Feb 2022 08:48:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50433) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMrzu-0004uW-36 for guix-patches@gnu.org; Wed, 23 Feb 2022 08:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nMrzt-0004hv-Jg for guix-patches@gnu.org; Wed, 23 Feb 2022 08:48:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54088] [PATCH v2 02/19] build: julia: Add 'julia-package-dependencies' as keyword. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 23 Feb 2022 13:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54088 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54088@debbugs.gnu.org Cc: Efraim Flashner Received: via spool by 54088-submit@debbugs.gnu.org id=B54088.164562406517914 (code B ref 54088); Wed, 23 Feb 2022 13:48:01 +0000 Received: (at 54088) by debbugs.gnu.org; 23 Feb 2022 13:47:45 +0000 Received: from localhost ([127.0.0.1]:44308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMrzb-0004ee-Uu for submit@debbugs.gnu.org; Wed, 23 Feb 2022 08:47:44 -0500 Received: from mail-wm1-f48.google.com ([209.85.128.48]:34081) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMrzZ-0004b5-EF for 54088@debbugs.gnu.org; Wed, 23 Feb 2022 08:47:42 -0500 Received: by mail-wm1-f48.google.com with SMTP id l2-20020a7bc342000000b0037fa585de26so2383134wmj.1 for <54088@debbugs.gnu.org>; Wed, 23 Feb 2022 05:47:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eAot9JVuNvvFUDKJ/rouwkDv3KeCBky4//0eR66jrnY=; b=oOjbqia0Y1MK/qWad4HkeUjefQu4hf+hNEmn9hN2XkWjzwaxQMA2N/2Rw74mkfK8Vd CYzI5wBL6ZHy7VLOn5LmMZT9ctW/UpmxHEAHN9Fp5Mgj5Z5j6u7dck5d8kTjZPsC9IWM fSoUZFOpLjU1hkriSBFPPLkqjd4M9IjMLaKEFzxYUuLkTtP4hFWpiRMebWpfwAvXCCA2 +2SlQQdoTy8uNCOa0mBB6e2OfmyFaPYxDin6rg7vkyTis1UhcSJOxXkNM+Nl0zjXNUUK GCrSItkYzBKtb+WeMTjdH1P9xRQUnMwJkcJEygAbkGDz1ZkuoZfjVmyucGKp0xeBh+5Q V5kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eAot9JVuNvvFUDKJ/rouwkDv3KeCBky4//0eR66jrnY=; b=lMfKtwhgVCCuRYMJDE1gpkGjXZW5xg2v29yKdOoJAq7hiJ/gX5DKD4L44oKUTjLxjX UOl+RTH2losWosrMsnHMGNCbJshSHCUAwUPIgwhUEh+Fxrk8utjEr+J9Sy1AaWQKuhNV Mjrl42vtHQVL6SP8v1KxXrF60hx1+vkGHqx4KAZRSQcF7/fxTAcb/wVsTcASmkJ4l1UY yTrGPOJk5agiHXSrimbhBMIvXGA89DiTZyoID6ZeMBR3RMLqFJu4tZyD3mQzlsOP9bJz xDRSy7Do85OateU5YSHTkqN4Dyi9I+uOgA1eM1oWFxrL759plmarUuTx/9aLCTZKawz+ oiiA== X-Gm-Message-State: AOAM530ZxP55SIG8gzThr9rv09WARVKU/sAsdgljZV5fI+IDt4ATQQdY NSUcYoxQYYq1cUdZ+DgCHhMU1cnkmGI= X-Google-Smtp-Source: ABdhPJy50q4rS5Ix1j6N9K3OeNWjIUqvL5yJy1B3Q8we0oI40u7c8DxhiY+dWhDDS8JNXRErdhng8w== X-Received: by 2002:a05:600c:268a:b0:381:d9:f412 with SMTP id 10-20020a05600c268a00b0038100d9f412mr225374wmt.46.1645624055202; Wed, 23 Feb 2022 05:47:35 -0800 (PST) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id d6sm55823135wrs.85.2022.02.23.05.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 05:47:34 -0800 (PST) From: zimoun Date: Wed, 23 Feb 2022 14:47:05 +0100 Message-Id: <20220223134722.354636-2-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220223134722.354636-1-zimon.toutoune@gmail.com> References: <20220223134722.354636-1-zimon.toutoune@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From: Efraim Flashner * 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 ;;; Copyright © 2021 Ludovic Courtès ;;; Copyright © 2021 Jean-Baptiste Volatier -;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2021, 2022 Simon Tournier +;;; Copyright © 2022 Efraim Flashner ;;; ;;; 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 ;;; Copyright © 2021 Jean-Baptiste Volatier ;;; Copyright © 2021, 2022 Simon Tournier +;;; Copyright © 2022 Efraim Flashner ;;; ;;; 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))