From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id cAK9KoMf82biTQAAe85BDQ:P1 (envelope-from ) for ; Tue, 24 Sep 2024 20:22:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id cAK9KoMf82biTQAAe85BDQ (envelope-from ) for ; Tue, 24 Sep 2024 22:22:27 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=XlWQWRZ7; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=UZj6L+a+; 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=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727209347; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: 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=XgKaiBbrkegb86oywPNncySntyWL1aTaSE3fR+S3DnA=; b=llBJhT2JfFKUKa4jLK4+tI5IPQVmGLLhkporbrTriB0ZGJkiHVsh6uEeRlBMnHvOygyCNj FbBpVkhKLBSZySscPblD1/KOEmwRgHhayQBlNEz+bw7qndJo1j0APsWGQ3ByOZOnYrJkJO aCwo4PEL8JXnzIQ3g3CWcm7VIR6TP9zx2jC/6Lj4kGq3ai8oJ09ewnXgbiHcJ8uV9XAm7V b0bxOSmZaxN1TaKGdT/eDwLPSDfQWV894GbyZLi2KNK4u7Yv0vhF7ZiszldvcIuhp9EcCe Ofdn7x3l8/4KHnt4mKMlufQcvhhRG8QIQgN7Bfc2apA64fbdwhaHH9Fe7Q5rLw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727209347; a=rsa-sha256; cv=none; b=HoJdln9vMHxBZ+RgNAQ2ZGCH8ZvPG3ZurD60FFcft71aHRWkKYk2Rw8QTC6XR/jd9qG9CG ToDpymMXEpFX3sVf4rEJNFbii3/Zjag+Sykl2sIr4TcsLhuR0XhTH6f3aKIBpucCrkEqID /G/FPx8y6zkvCFWSSK+xUBPe8ElkTLKxlJwYu7C7SFG/QsmCdC9q84F88hq/+i29xeIMOa +MpTdRcErhMT8wvznp3NGSX75745LlW1kfcwc0RR2nXXoUS9rmgYW+Gay0zGLgNhE6xLpX 0S2HhVJPNnXibWWvLA0eXZFE4Wk95ux+x/j1ZylJf65hKO5jMtc4Y5ClRqG3YQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=XlWQWRZ7; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=UZj6L+a+; 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=pass (policy=none) header.from=gnu.org 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 46FBC7A9DA for ; Tue, 24 Sep 2024 22:22:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2u-0000bm-E9; Tue, 24 Sep 2024 16:22:04 -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 1stC2b-0000MZ-SD for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:46 -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 1stC2Z-0003PQ-5c for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=XgKaiBbrkegb86oywPNncySntyWL1aTaSE3fR+S3DnA=; b=XlWQWRZ7tUGeXg4ZMAnbX5FF1B3126/TpbY/JwW8Rq4qoJ6lxNa8m+WQ4qHzBXtKMPs9SRlup0YGOpnucMeoTBlJ69sevnys7ZrgBT7A7uk67jEF9rVVgsIUF1ozRWgBDto0wtnN83jnvh4m7aXoPOY20eOWUIymRETjh4JudEeDecZy3Jh1P02b/wXJrAXPPtH+49nAIVd5OpZyAsraGoqLvC65VwAN4uEMD1ICGnpPQRFTMuIjgTqKpm5VTN8sO/Cs824ZsxIpKHb7XF00Oj254ma+OJFdnys1/tQEkfATRLQFdQBqkr7etV3LDi6mdW9KPZILXyCoSuVD4CXrMg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2x-00055V-Tm for guix-patches@gnu.org; Tue, 24 Sep 2024 16:22:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 10/11] import: egg: Use maybe-*inputs procedures. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 24 Sep 2024 20:22:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.172720930219429 (code B ref 70923); Tue, 24 Sep 2024 20:22:07 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:42 +0000 Received: from localhost ([127.0.0.1]:38518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2X-00053D-Pb for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:42 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:46027 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2I-00050O-2s for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XgKaiBbrkegb86oywPNncySntyWL1aTaSE3fR+S3DnA=; b=UZj6L+a+/heVkrUQvqJ7rhrdMD9SWfykF3fqlaFgyJy1gDhuqUsW3970V5avQlsDx7W1UP f3jsoZWvsIq8rQSMgOJuOYbr5xS4iDabH77QCC12uiHUg3433xyKqUhINGALIsOdpA+UBZ HmaA09qqxjcjXFrWs0EsGpkYkk+Q93xb4uF5cozkjbzPovwkLtgR9H3oGq8hAmxTZxvoTI 6OmyfOAA/CVLAlS5No/bCZZXBWL7TU33nVYtjnNyFSzdtzgIGhhsY2S+4BQflJToQox6Im jo1jpEJE3p0j3IQUDDE/fEwJ9dojF/zyIysiiGxE90I4iZtOkPAcTf3UBcV/vg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id df04a8e7 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Tue, 24 Sep 2024 20:14:09 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:16 +0200 Message-ID: <4bb46928e59df2b38889d6f82c60bd08419d9605.1727207512.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via 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: mx12.migadu.com X-Migadu-Spam-Score: -7.02 X-Migadu-Queue-Id: 46FBC7A9DA X-Spam-Score: -7.02 X-TUID: FCuFcDc9GGTk * guix/import/egg.scm (maybe-inputs): Delete procedure. (egg-parse-dependency): Simplify procedure to return strings. (egg->guix-package): Use maybe-*inputs procedures. Change-Id: Ib0a3f5b6f02912c847defd02ba7675d80005279b --- guix/import/egg.scm | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/guix/import/egg.scm b/guix/import/egg.scm index e3bc158475..97d09a7c9d 100644 --- a/guix/import/egg.scm +++ b/guix/import/egg.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2022 Hartmut Goebel +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -229,23 +230,14 @@ (define* (egg->guix-package name version #:key (file #f) (source #f) (else char))) (maybe-symbol->string name))) - (define* (egg-parse-dependency name #:key (system? #f)) - (define extract-name - (match-lambda - ((name version) name) - (name name))) - - (define (prettify-name name) + (define* (egg-parse-dependency dependency #:key (system? #f)) + (let ((name (match dependency + ((name version) name) + (name name)))) (if system? (prettify-system-dependency name) - (maybe-symbol->string name))) - - (let ((name (prettify-name (extract-name name)))) - ;; Dependencies are sometimes specified as symbols and sometimes - ;; as strings - (string->symbol (string-append - (if system? "" package-name-prefix) - name)))) + (string-append package-name-prefix + (maybe-symbol->string name))))) (define egg-propagated-inputs (let ((dependencies (assoc-ref egg-content 'dependencies))) @@ -277,15 +269,6 @@ (define* (egg->guix-package name version #:key (file #f) (source #f) test+build-dependencies)) (() '())))) - ;; Copied from (guix import hackage). - (define (maybe-inputs input-type inputs) - (match inputs - (() - '()) - ((inputs ...) - (list (list input-type - `(list ,@inputs)))))) - (values `(package (name ,(egg-name->guix-name name)) @@ -303,16 +286,16 @@ (define* (egg->guix-package name version #:key (file #f) (source #f) "failed to download tar archive")))))) (build-system chicken-build-system) (arguments ,(list 'quasiquote (list #:egg-name name))) - ,@(maybe-inputs 'native-inputs egg-native-inputs) - ,@(maybe-inputs 'inputs egg-inputs) - ,@(maybe-inputs 'propagated-inputs egg-propagated-inputs) + ,@(maybe-native-inputs egg-native-inputs) + ,@(maybe-inputs egg-inputs) + ,@(maybe-propagated-inputs egg-propagated-inputs) (home-page ,egg-home-page) (synopsis ,egg-synopsis) (description #f) (license ,egg-licenses)) (filter (lambda (name) (not (member name '("srfi-4")))) - (map (compose guix-name->egg-name symbol->string) + (map guix-name->egg-name (append egg-propagated-inputs egg-native-inputs))))))) -- 2.45.2