From patchwork Thu Oct 17 14:43:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guillaume Le Vaillant X-Patchwork-Id: 15756 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 AE86A175C9; Thu, 17 Oct 2019 16:32:52 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 6DFBC175BD for ; Thu, 17 Oct 2019 16:32:52 +0100 (BST) Received: from localhost ([::1]:51110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL7lj-0007Bx-6P for patchwork@mira.cbaines.net; Thu, 17 Oct 2019 11:32:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50073) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL70c-0006DT-B7 for guix-patches@gnu.org; Thu, 17 Oct 2019 10:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL70a-0006nh-2k for guix-patches@gnu.org; Thu, 17 Oct 2019 10:44:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39847) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL70Z-0006n4-Hp for guix-patches@gnu.org; Thu, 17 Oct 2019 10:44:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iL70Z-0006pj-G0 for guix-patches@gnu.org; Thu, 17 Oct 2019 10:44:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#37791] [PATCH 1/4] build-system/asdf: Fix package transform. Resent-From: Guillaume Le Vaillant Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Oct 2019 14:44:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37791 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 37791@debbugs.gnu.org Cc: Guillaume Le Vaillant Received: via spool by 37791-submit@debbugs.gnu.org id=B37791.157132342926162 (code B ref 37791); Thu, 17 Oct 2019 14:44:07 +0000 Received: (at 37791) by debbugs.gnu.org; 17 Oct 2019 14:43:49 +0000 Received: from localhost ([127.0.0.1]:48651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iL70H-0006ns-1Z for submit@debbugs.gnu.org; Thu, 17 Oct 2019 10:43:49 -0400 Received: from mout02.posteo.de ([185.67.36.66]:33261) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iL70C-0006nc-DO for 37791@debbugs.gnu.org; Thu, 17 Oct 2019 10:43:45 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id CA9032400FD for <37791@debbugs.gnu.org>; Thu, 17 Oct 2019 16:43:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1571323417; bh=IphCLtUfdEeNy4QTtglWDEYZ5BsCNSDugcDk8Era8AE=; h=From:To:Cc:Subject:Date:From; b=bsV15/SEtxyFVKSaQCnpX1rgX8I+QZ5yb+p3LFTrgqFCHLoelLt114jucL4vlL9Dn +7mgazcKATL7FXeJw93YJs6vUxc0JO1UuUej3Dt7caH9vfr/4IolALi2w7uuztz1S9 IakGpYjZDRJv9wHI0mZA34rb9ViiRu8Ix4ITHYEI6s7z94AS7+pwI3aoH61Wl0yUcG LfLYZGQ+ECr3p8f43794YRTwEyIWl/+vKqiNi93/d1mpkrixo7EFVaC2kthV8JZ/px qTJe7/jpEmViqhbc+CsMAlyXBoV1WaZoB2Pis+dIPJ/wZ7aKZ2K9R3Ir4KSnVIZ4zi FE7XNIG4UZBQg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 46vBk10rrCz9rxL; Thu, 17 Oct 2019 16:43:36 +0200 (CEST) From: Guillaume Le Vaillant Date: Thu, 17 Oct 2019 16:43:09 +0200 Message-Id: <20191017144312.13121-1-glv@posteo.net> X-Mailer: git-send-email 2.23.0 In-Reply-To: <87pnivsajn.fsf@yamatai> References: <87pnivsajn.fsf@yamatai> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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 * guix/build-system/asdf.scm (package-with-build-system): [find-input-package]: New function. [rewrite]: Use it. --- guix/build-system/asdf.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm index af04084c86..f794bf006b 100644 --- a/guix/build-system/asdf.scm +++ b/guix/build-system/asdf.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016, 2017 Andy Patterson +;;; Copyright © 2019 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,6 +33,7 @@ #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (gnu packages) #:export (%asdf-build-system-modules %asdf-build-modules asdf-build @@ -160,13 +162,22 @@ set up using CL source package conventions." (define (has-from-build-system? pkg) (eq? from-build-system (package-build-system pkg))) + (define (find-input-package pkg) + (let* ((name (package-name pkg)) + (new-name (transform-package-name name)) + (pkgs (find-packages-by-name new-name))) + (if (null? pkgs) #f (list-ref pkgs 0)))) + (define transform (mlambda (pkg) (define rewrite (match-lambda ((name content . rest) (let* ((is-package? (package? content)) - (new-content (if is-package? (transform content) content))) + (new-content (if is-package? + (or (find-input-package content) + (transform content)) + content))) `(,name ,new-content ,@rest))))) ;; Special considerations for source packages: CL inputs become