From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id yS6QLIhMV2elWAAAe85BDQ:P1 (envelope-from ) for ; Mon, 09 Dec 2024 20:01:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id yS6QLIhMV2elWAAAe85BDQ (envelope-from ) for ; Mon, 09 Dec 2024 21:01:12 +0100 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=IxpC6zYx; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=P7aTjJpK; 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=1733774472; h=from:from:sender:sender:reply-to: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=pnj1p+jLMJn0WKwS//Xpf8WBiWHD7UqsxX1NXy1pQk8=; b=g8q37+lXzOPtoown6H6+YIZYtVZeqE6MrrrkkWEXSiSO5x54+u31CR+wVRNKWRC9BA+/sn eO9rBykomMDBlozhBBhy4GBfliRBiez8a2dcYQ8a3bQQsk2s6kCZdUBoFuB5GHugU8vo8l mKLy2YzezVLqEzxPC3xMSHwjRDH3R0pa+TIwRLBmnYmvNkp2Ja87jKE+UGdT4gOQGYGPh+ mUoxgPL8Dd+BRH+mdcRFGyGL9EC71+ZMOcr8vPlu57jG67HnCUZqL8UcDbxBJ7LwxUH5lh sE5+p/YY1MSInMofU9h53EQIRydQv1Py3Gvh4pxMVFILIoE7w1MetscuSnVlnQ== 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=IxpC6zYx; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=P7aTjJpK; 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-Seal: i=1; s=key1; d=yhetil.org; t=1733774472; a=rsa-sha256; cv=none; b=JvCc/DbiT6OUoZ2i5SOoV+5+86KgJ1jC2yzZ3uTqrGsrBFmF7LiNIyL48LYSi0GIRta/WT pWulNDaE91lliwQ3q6qUef3PgpryjDAfM6PwlR3qUv36LnlZwaNmqELc7kYuqMouadkwT8 aED9ibuKLPtGf0bs3NLCLRPtmqttgXOTL0dK9yfOxDn2chPbbvue+ORG9PviAO7aDsjxXm 2fp+lp+9eYts6RhTNipmKzv8NZFF2X+NBSqdxAMMcJnw1ikd19EC/sjh48O/beUcaBumwI YSiJZx0+8QJbfbf26ieaPDmNXIAaKrEbnu3oZkHVvoT81Ril/TghIyU2KeZVJQ== 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 51CF079679 for ; Mon, 09 Dec 2024 21:01:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvO-0005Bl-Jh; Mon, 09 Dec 2024 15:00:10 -0500 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 1tKjvN-0005BD-3T for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:09 -0500 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 1tKjvM-0007YV-Q5 for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:08 -0500 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=pnj1p+jLMJn0WKwS//Xpf8WBiWHD7UqsxX1NXy1pQk8=; b=IxpC6zYxilPcrTGAuyE3SQ6kwUQryF7y1mE13DqihffflWwLTIXZIxPXLQpAwsG+0KGG0Kso+5cY507FG26jJU+QobMzGQrp95BqQhvjjtUN/BDVajJafRrrwGKNjOkad38gsTKZbeIpV/WOvoqZBKS0FQj5EEQfr+C7JZ11m2YLnBfQX8CO3PoJlz4D3dlKeQWZWs/FTp4KVCcg7BY0OtqwWDUqe714k1wKEAg5PZVomSg7p5Fz3zkElI34Kkgj0Ouip5tmVJzLXhHsswkYL36SWXw6zV0E2gFHhSJwgAOl1pl7w/O+x6Emljoy9pc1LS9VJgsW5KH6gMo7wtx7ew==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvM-0002FH-43; Mon, 09 Dec 2024 15:00:08 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 07/11] import: hackage: Use 'maybe-list-field' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:08 +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 Cc: Lars-Dominik Braun X-Debbugs-Original-Xcc: Lars-Dominik Braun Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743748303 (code B ref 70923); Mon, 09 Dec 2024 20:00:08 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:34 +0000 Received: from localhost ([127.0.0.1]:55745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjun-00029e-Be for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:34 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:60445 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjui-00027f-AV for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774353; 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=pnj1p+jLMJn0WKwS//Xpf8WBiWHD7UqsxX1NXy1pQk8=; b=P7aTjJpKM3MmctxBkBvUvbqvpbt+kr7KMOGTeNJFedN1Qrv1bYChT07b490/qfLkX/HBBf SzJxVwSKbslE6euuRM91ahSk9+cVZ7BdLcNL8TCpQYLHwDfUUaLyVGggJ/EifizsXpfDko 9aVnPflEK1/cc/s8b4uKcZ4J0twgno0oH6UnZxIuqlwt7/kNwkXLgn+/Io4HeAYzYtQ65d 6f+Ljty2y7ti0+oY0gzZa87zpqsgHiJguC5Hc2AGcsgdrOVPMwRLBg8qBDwPqPDn1mOZ98 0rtCxREcO8gl2jFZImm/SdmlheP5VsW42pNoKnH/JfJ37v4x5ZcUSdjGV+deOA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 5fd9c6b6 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 9 Dec 2024 19:59:13 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:11 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -2.66 X-Spam-Score: -2.66 X-Migadu-Queue-Id: 51CF079679 X-TUID: AG+TWGdZ0eoV * guix/import/hackage.scm (maybe-inputs, maybe-arguments): Delete procedures. (hackage-module->sexp): Use 'maybe-list-field' and 'maybe-upstream-inputs' procedures. * tests/hackage.scm: Fix whitespace and replace 'quasiquote' with 'list'. Change-Id: I4fe39ff84c9f6a677f810d9e4fe751d762973757 --- guix/import/hackage.scm | 39 ++++++++++++--------------------------- tests/hackage.scm | 13 +++++++------ 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 422887d435..99dfb84b7d 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2022 Hartmut Goebel ;;; Copyright © 2023-2024 Ludovic Courtès ;;; Copyright © 2024 Nicolas Graves +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -290,26 +291,6 @@ (define* (hackage-module->sexp cabal cabal-hash #:include-test-dependencies? include-test-dependencies?)) - (define (maybe-inputs input-type inputs) - (match inputs - (() - '()) - ((inputs ...) - (list (list input-type - `(list ,@(map (compose string->symbol - upstream-input-downstream-name) - inputs))))))) - - (define (maybe-arguments) - (match (append (if (not include-test-dependencies?) - '(#:tests? #f) - '()) - (if (not (string-null? revision)) - `(#:cabal-revision (,revision ,cabal-hash)) - '())) - (() '()) - (args `((arguments (,'quasiquote ,args)))))) - (let ((tarball (with-store store (download-to-store store source-url)))) (values @@ -326,13 +307,17 @@ (define* (hackage-module->sexp cabal cabal-hash "failed to download tar archive"))))) (build-system haskell-build-system) (properties '((upstream-name . ,name))) - ,@(maybe-inputs 'inputs - (filter (upstream-input-type-predicate 'regular) - inputs)) - ,@(maybe-inputs 'native-inputs - (filter (upstream-input-type-predicate 'native) - inputs)) - ,@(maybe-arguments) + ,@(maybe-upstream-inputs 'inputs + (filter (upstream-input-type-predicate 'regular) inputs)) + ,@(maybe-upstream-inputs 'native-inputs + (filter (upstream-input-type-predicate 'native) inputs)) + ,@(maybe-list-field 'arguments + (append (if (not include-test-dependencies?) + '(#:tests? #f) + '()) + (if (not (string-null? revision)) + `(#:cabal-revision '(,revision ,cabal-hash)) + '()))) (home-page ,(cabal-package-home-page cabal)) (synopsis ,(cabal-package-synopsis cabal)) (description ,(beautify-description (cabal-package-description cabal))) diff --git a/tests/hackage.scm b/tests/hackage.scm index 403f587c41..f6d91515e2 100644 --- a/tests/hackage.scm +++ b/tests/hackage.scm @@ -67,7 +67,7 @@ (define test-cabal-3 if impl(ghc>=7.2&&<7.6) Build-depends: ghc-b if impl(ghc == 7.8) - Build-depends: + Build-depends: HTTP >= 4000.2.5 && < 4000.3, mtl >= 2.0 && < 3 ") @@ -86,7 +86,7 @@ (define test-cabal-4 if impl(ghc>=7.2&&<7.6) Build-depends: ghc-b if impl(ghc == 7.8) - Build-depends: + Build-depends: HTTP >= 4000.2.5 && < 4000.3, mtl >= 2.0 && < 3 ") @@ -101,7 +101,7 @@ (define test-cabal-5 license: BSD3 library if impl(ghc == 7.8) - Build-depends: + Build-depends: HTTP >= 4000.2.5 && < 4000.3, if impl(ghc -any) Build-depends: mtl >= 2.0 && < 3 @@ -126,7 +126,7 @@ (define test-cabal-6 if impl(ghc>=7.2&&<7.6) Build-depends: ghc-b if impl(ghc == 7.8) - Build-depends: + Build-depends: HTTP >= 4000.2.5 && < 4000.3, mtl >= 2.0 && < 3 ") @@ -524,8 +524,9 @@ (define-package-matcher match-ghc-foo-revision ('properties '(quote ((upstream-name . "foo")))) ('inputs ('list 'ghc-http)) ('arguments - ('quasiquote - ('#:cabal-revision + ('list + '#:cabal-revision + ('quote ("2" "0xxd88fb659f0krljidbvvmkh9ppjnx83j0nqzx8whcg4n5qbyng")))) ('home-page "http://test.org") ('synopsis (? string?)) -- 2.45.2