From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CCAeLcWRCGV3bgEAauVa8A:P1 (envelope-from ) for ; Mon, 18 Sep 2023 20:07:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id CCAeLcWRCGV3bgEAauVa8A (envelope-from ) for ; Mon, 18 Sep 2023 20:07:01 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EDDE160678 for ; Mon, 18 Sep 2023 20:07:00 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=OyuIcadu; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695060421; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=11mUEohHcrH+QNTVAs5Uln5kD6Ej1y2o4Jf0is9mgJM=; b=GPU3o8J7yFEbS5W2Uxz+NEeGtA8f8Sf4GAWz+W4zyHwfdtUeeBzC6EP1WSSH2EUMWPHhWu qJih1f1Q8irD8qEB5Vov/dcALP4FIMb7VoDyYscus5ccEoSPvz1ZQa3J/bWjnf0bRHvA4a n6q+2rn475YZf6YDx5RHdGIen7ACA/6XMXYASN0H1i3FZs6TKpwcwjp903+kaGlXGCD75E +87GUnXg5d6t9mF2niirg5mR+OSgfDptXN8UTvbEoMSzT0SdMJy/RV6CtmE5i0qHZZNzLQ clLRdhpKqeOJRXx2FhyCEKZHFfi2klcEWUbos5KjAGXs9jRSEUbmVG6E7Powzw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=OyuIcadu; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695060421; a=rsa-sha256; cv=none; b=ZXm3NG1qT/qvDDX0LkQjDKan+ON8SjIQZ/Ns5PINadKAJEr/FqXjCsTY/TOZwur2JMw9W/ Z4UYwpNIukshLznCwit/jS0wDNIaZFtexDWtbtnsmfd2wuwajBc620CwtvJY6YMM241LLT UmSpMy6i3SrF7hBqiBqkCj23NsEaJHKYBKjo8i8531kTzbSHkWx485OvT5jn2TFo0wEXhH ldMM85cXbZdhlfpu/p8cL36WNekTFA5CwsELuwO9Fs44eKjCnRxSsDKtdYbHej+PTQjziN +ox46St4ysYa2wwFH/wcIWn5WxQGBG0ZQDC2P/CDjpThfDBrwOcZ9ZW+raQANQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiIdO-0005DE-IP; Mon, 18 Sep 2023 14:06:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qiId9-0004k8-88 for guix-patches@gnu.org; Mon, 18 Sep 2023 14:05:55 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiId8-00041p-VH for guix-patches@gnu.org; Mon, 18 Sep 2023 14:05:54 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qiIdH-0002Sy-6V for guix-patches@gnu.org; Mon, 18 Sep 2023 14:06:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66076] [PATCH v2 10/23] DRAFT import: juliahub: Simplify juliahub dependency management. Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 18 Sep 2023 18:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66076 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62202@debbugs.gnu.org Cc: 66076@debbugs.gnu.org, zimon.toutoune@gmail.com X-Debbugs-Original-Cc: Nicolas Graves via Guix-patches via , Simon Tournier Received: via spool by submit@debbugs.gnu.org id=B.16950603239328 (code B ref -1); Mon, 18 Sep 2023 18:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 Sep 2023 18:05:23 +0000 Received: from localhost ([127.0.0.1]:54455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiIcc-0002QI-QH for submit@debbugs.gnu.org; Mon, 18 Sep 2023 14:05:23 -0400 Received: from lists.gnu.org ([2001:470:142::17]:58302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiIbe-0002Je-Nt for submit@debbugs.gnu.org; Mon, 18 Sep 2023 14:04:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qiIbD-0002Pk-A2 for guix-patches@gnu.org; Mon, 18 Sep 2023 14:04:00 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiIb5-0003PV-73 for guix-patches@gnu.org; Mon, 18 Sep 2023 14:03:53 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-321617ef967so108827f8f.0 for ; Mon, 18 Sep 2023 11:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695060225; x=1695665025; darn=gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=11mUEohHcrH+QNTVAs5Uln5kD6Ej1y2o4Jf0is9mgJM=; b=OyuIcadu+5ocfxAq0kxvRE7Vo1zqGTMVHvRpTL8ueELQWwyiTFzMQasL28fuTeDEd8 +1n2OjMDCTCys+sxCfPSR95FcAW+S/hD9d6yiD0BYYIlXXwZplJKPE8Se6/rmA3StrTv ZhjqBKwAQk8D5cy5yBMTc3qDTcFFMxdMd4RSoIFIJFQ9foHfbQdHT6yG/WzqSN347DYM q3BED3Gw+/RuBP965JBS8iaJGdxxKS/CoAP0fttV5KCzvuS9nNF1HfC/olSfOLIsUQZl hTcE2FGSnNDBKw2ODWWBPOtvHB5SAmAdyNUzSC6EPkzjbjcrFP83JjwqRnnwzPflXwhQ KUnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695060225; x=1695665025; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=11mUEohHcrH+QNTVAs5Uln5kD6Ej1y2o4Jf0is9mgJM=; b=F6GldQ77sxtLBo/fhjU9bt531h45jr9tvW+klIGENl4oJIvzX4lfeDTKSp8eAXiJQe MVnxxvS7Hz0uPUHv+Hvj2CG7vA97wbYPcl158r0amaarCV+KB1JSayj3o6rvA5/CG0X/ DJFIq5zX2GZ6jUCwoUFf62kze6GoYSd5QpAzVm5KShaEWryn3AWYPwmWq+oGWP9VwbQz UC9kmY7JZArjiJnNY7f6v72S+c/SedvjmG9R8oQWDUfZi4X0GOuyORcRXFm3hNlkA2Uc Sws+3dqkC9FjYM0eYI4tKNpfUitceO8+1rQY3HuiBy34rBO1OaEQxrqGLh6rgMwa0DI3 hUHA== X-Gm-Message-State: AOJu0YztV7afpj+3L8zLZTdsF1USKq7fhEpEYacFNzwqawjnMwK0S+XN kofFoTyc6AGTxwsz1mfFSno= X-Google-Smtp-Source: AGHT+IHOMZp0/QSXZeD+sEgNq/N/ASaY17Wre5gIqIlTpo7kpcUxjCIYWu6l8mCXVGDTnDzqqjAljQ== X-Received: by 2002:a05:6000:1047:b0:31f:a096:6e18 with SMTP id c7-20020a056000104700b0031fa0966e18mr7723857wrx.6.1695060224406; Mon, 18 Sep 2023 11:03:44 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id z2-20020adfd0c2000000b0030ada01ca78sm2210465wrh.10.2023.09.18.11.03.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 11:03:44 -0700 (PDT) From: Simon Tournier Date: Mon, 18 Sep 2023 20:03:17 +0200 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=zimon.toutoune@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: 0.19 X-Spam-Score: 0.19 X-Migadu-Queue-Id: EDDE160678 X-TUID: jASPwsdEjFUq From: Nicolas Graves via Guix-patches via Signed-off-by: Simon Tournier --- guix/import/juliahub.scm | 42 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) 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 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 - (indirect-dependencies - juliahub-package-indirect-dependencies "deps" - json->juliahub-indirect-dependencies) ;list of + (dependencies + juliahub-package-dependencies "deps" + json->juliahub-dependencies) ;list of (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