From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id yAPCHKylRmQWAAAASxT56A (envelope-from ) for ; Mon, 24 Apr 2023 17:52:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MPjUG6ylRmS+ewEAG6o9tA (envelope-from ) for ; Mon, 24 Apr 2023 17:52:12 +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 F34A537646 for ; Mon, 24 Apr 2023 17:52:11 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqyU4-0000BR-QM; Mon, 24 Apr 2023 11:52:08 -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 1pqyU2-00009r-9W for guix-patches@gnu.org; Mon, 24 Apr 2023 11:52:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqyU1-0005CF-V8; Mon, 24 Apr 2023 11:52:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pqyTy-0006sr-Cs; Mon, 24 Apr 2023 11:52:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63053] [PATCH 1/3] guix: import: crate: Fix incorrect returned values. References: <20230424154801.1539772-1-zimon.toutoune@gmail.com> In-Reply-To: <20230424154801.1539772-1-zimon.toutoune@gmail.com> Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: mail@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 24 Apr 2023 15:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63053 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63053@debbugs.gnu.org Cc: Simon Tournier , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 63053-submit@debbugs.gnu.org id=B63053.168235149626397 (code B ref 63053); Mon, 24 Apr 2023 15:52:02 +0000 Received: (at 63053) by debbugs.gnu.org; 24 Apr 2023 15:51:36 +0000 Received: from localhost ([127.0.0.1]:50162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqyTY-0006rf-9o for submit@debbugs.gnu.org; Mon, 24 Apr 2023 11:51:36 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:41103) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqyTW-0006qj-50 for 63053@debbugs.gnu.org; Mon, 24 Apr 2023 11:51:34 -0400 Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-2f4130b898cso439412f8f.0 for <63053@debbugs.gnu.org>; Mon, 24 Apr 2023 08:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682351488; x=1684943488; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=isyfrgl2G+tfMguAH5MUdzP+GC14wldhDrF7esYQ+n8=; b=eo+e9c7aI+bADX5vND76zREVHTudPoxlLTIG16JC4I/V8HVVxjeT/fHdr5WWTLw29Z IR8BM1NHtBAXgML8McF69wO0RJWujyRIV1YoYhisibGWxGkjEbv8mbHv1VWEa98z7wYm tnIEGu4kp6Y6azkGcANYg66UUn2zdrlLESxYlOGRrvy+3N3QwXnNUeXrsLgJ/7Fa2qR9 u7GsyGa9M8nmQTjU7lSUDPNmBHwS3cckNXKVxXE3iK3a1vhzv/TEsPFzsqU+X102AXND sm6Dll7yqTJ5gWITP6oeOhjyxByW10SdenenpjpI8Zl1li40pOpjq3a2booWvUDA8Xea s5fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682351488; x=1684943488; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=isyfrgl2G+tfMguAH5MUdzP+GC14wldhDrF7esYQ+n8=; b=DRYqgJqjzjaBLkktoWs+vlZPHiHCRbcuVklZcABZIk+pQM3g1AEm2WoYG+e5Zlfv3L iRaeKUVihcr5QAITlvk31/WZNitbPpWvsDdiq9Cysim6LoT8pmDXP7eodWFixOvigMlx EOdyYGNaCOS4gIaP5BPUuGyPLlx8kC4nAWlSyeMB4aayze3PojrOkTIkbYZ6Pld0g2uF BF0ZaJA2K5TCN1+M0V5ImUGILPnajQ97DVaxanwgmw/Gi9iAS9IYFAXfgQ1aU2pGnf7K psSPXQn4QCMd6AJYkCqDWeUCV7vbyl7JKuCH2ZtdcSG7TR659Cuc5csihUiyA62qIpiY HQlg== X-Gm-Message-State: AAQBX9fXZfcAXniccHy4L8OQH73rTOO6Ae4tBBqEucNZNH4k9Man1ghY kR/w7QNpjEuGqQTUq65NrxugL3EsxBs= X-Google-Smtp-Source: AKy350Z3mBcZu72MX12S24V6VC1slVC6uvinLcNm4ZAnqnBAJVcTXPQaN0wiL9EKetgh87/SEUhONA== X-Received: by 2002:adf:cd86:0:b0:2f9:12ae:4a29 with SMTP id q6-20020adfcd86000000b002f912ae4a29mr8689833wrj.5.1682351487668; Mon, 24 Apr 2023 08:51:27 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id e5-20020a5d5305000000b002cf1c435afcsm11109853wrv.11.2023.04.24.08.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 08:51:27 -0700 (PDT) From: Simon Tournier Date: Mon, 24 Apr 2023 17:51:17 +0200 Message-Id: <20230424155119.1540974-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.38.1 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682351532; a=rsa-sha256; cv=none; b=Z6qcHJGm+2yTHmJ3muRTRfEJZGAmpd8PZ9SFUWXsXyY68WwEWdAfzrikBiCZ2FeqXZvfhy rXspofiEQ76hL39xwTaVL5K/sLrpxGD5bgStm1sfHjjlA9PStXZ/xWAlnkvoz/GqYmanJm ukanD+zTbAkTlYOdWrBX4kVcgjuWUpM41VyvkqcocJxiXxpTFHeiqS32spXlFZzs/ta5NV 8w6/+L4LoYeY1aB5jyFERTRW6DE0EjKse5env+JlrIOEUKvdZ1M0bXtUTpWt3hdDyBFBVN rT5NJlUeHTbiesXHs2fVTHoGNAe9s4a0BKjZhRVSlmioDVP5IE9scJJQarr9eQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=eo+e9c7a; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682351532; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=isyfrgl2G+tfMguAH5MUdzP+GC14wldhDrF7esYQ+n8=; b=OWatf3TRuqcTY/TFR8bV3HGG35X6vvPsvQIJdzfTHxiwqS4chUd3QkS8uIqI7K7strMQbu 28DwtsXv09fUo60/LB60GI26NheW10Zsmdv6Lt8hMNmjfCCEqVKIBDlu34Ec5+4OLCyX6m 4tbpHKwPIgoQcTOJyZkyjix7neWab2ypOBguLDg7zW3n/m798pLRYs47Xg4oqIZwydoqZO QEI+B6KMk+3JGTtK0LezSSoYDN5q1wyf36hRLK23BqTTrvQBa6nGpKFJz74bupPIqPfaG+ VsGIdj16MDu+gWUjq1QustaRCxX+TpuUy8SBTTHWcRocNfYdh0kQ3RpnRDlyng== X-Migadu-Spam-Score: 0.09 X-Spam-Score: 0.09 X-Migadu-Queue-Id: F34A537646 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=eo+e9c7a; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-TUID: z/E6+KGaIGo2 * guix/import/crate.scm (crate->guix-package): Return compatible values with 'recursive-import'. --- guix/import/crate.scm | 54 ++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 514eca2229..6e10ebb5d4 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2019, 2020 Martin Becze ;;; Copyright © 2021 Nicolas Goaziou ;;; Copyright © 2022 Hartmut Goebel +;;; Copyright © 2023 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -293,32 +294,33 @@ (define (sort-map-dependencies deps) (match-lambda* (((name _) ...) (apply string-ci (crate-version-license version*) - string->license)) - (append cargo-inputs cargo-development-inputs))))) + (if (and crate version*) + (let* ((dependencies (crate-version-dependencies version*)) + (dep-crates dev-dep-crates (partition normal-dependency? dependencies)) + (cargo-inputs (sort-map-dependencies dep-crates)) + (cargo-development-inputs (if include-dev-deps? + (sort-map-dependencies dev-dep-crates) + '()))) + (values + (make-crate-sexp #:build? include-dev-deps? + #:name crate-name + #:version (crate-version-number version*) + #:cargo-inputs cargo-inputs + #:cargo-development-inputs cargo-development-inputs + #:home-page + (let ((home-page (crate-home-page crate))) + (if (string? home-page) + home-page + (let ((repository (crate-repository crate))) + (if (string? repository) + repository + "")))) + #:synopsis (crate-description crate) + #:description (crate-description crate) + #:license (and=> (crate-version-license version*) + string->license)) + (append cargo-inputs cargo-development-inputs))) + (values #f '()))) (define* (crate-recursive-import crate-name #:key version) (recursive-import crate-name -- 2.38.1