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 ms5.migadu.com with LMTPS id oKvgAK0AjGIKBAEAbAwnHQ (envelope-from ) for ; Mon, 23 May 2022 23:46:21 +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 UBYIAK0AjGJNNwEAG6o9tA (envelope-from ) for ; Mon, 23 May 2022 23:46:21 +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 DAD7B4059F for ; Mon, 23 May 2022 23:46:19 +0200 (CEST) Received: from localhost ([::1]:35274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntFsY-0005EW-G9 for larch@yhetil.org; Mon, 23 May 2022 17:46:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntFrm-0005CG-5N for gwl-devel@gnu.org; Mon, 23 May 2022 17:45:31 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:34836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntFri-000607-JL for gwl-devel@gnu.org; Mon, 23 May 2022 17:45:29 -0400 Received: from laura.hitronhub.home (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 24NLj9PL027905 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 23 May 2022 17:45:17 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 24NLj9PL027905 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1653342318; bh=nb1VBIPqAdxpXjNawAwWsvemwyw9lzrOYaoXROa3BXQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=R/R0VhXvECfzfIMyNHR76dNjAuo1NmbatD/euf8aayIwJZu+6MlKfc4YJrSIFctTY N2Q4MCRzGZPgaaD184vNxDJ9+hoLCwmMRpwVH2bVS3Tn5P3ZEFaYi6pCt8NCi85mX8 PCtUFPk8Ac9lzvLDbZ6rsYzQvqV57sjSM4B5EY50= From: Olivier Dion To: Olivier Dion , Olivier Dion via Subject: [PATCH v5] packages: Support for full Guix specification Date: Mon, 23 May 2022 17:45:07 -0400 Message-Id: <20220523214507.6154-1-olivier.dion@polymtl.ca> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522123844.23527-1-olivier.dion@polymtl.ca> References: <20220522123844.23527-1-olivier.dion@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) at Mon, 23 May 2022 21:45:09 +0000 Received-SPF: pass client-ip=132.207.4.11; envelope-from=olivier.dion@polymtl.ca; helo=smtp.polymtl.ca X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: gwl-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gwl-devel-bounces+larch=yhetil.org@gnu.org Sender: "gwl-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653342380; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=nb1VBIPqAdxpXjNawAwWsvemwyw9lzrOYaoXROa3BXQ=; b=GgG0uRimFrNUHEjepOGKWX56yHRVZ5tl7M4ny+5/2b56t9v1qqMaNtzfGaXuWW95JszhZ5 Le6efdhi0We+gjkvi0wFVjcHokOj15A9DUgfPnInZzxD3llV7APlbrikgnijMWX8Rvjio9 Nsl9633ZLrFRYrwfLfhI5hJQ5B5kBx291ksnP+P7rnb9JZnJJYOEiXkIPdG19aynurSpup T1Mhc1ps5b8lSgyzE5aFYXMnbFCvLYefHorGxKrtz5aCNOT8A93C37HC/JTr0/LH/pau6x gibayglRPhWSgB9dSb4EvB4eH1KDkPehKqIp+u8Me3JdsoXwAGGMTmMVNcwNPQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653342380; a=rsa-sha256; cv=none; b=TQg9pNdxBg9MkLoDbxeTiOwo/PomDQCiqg+ZZjb+zphMsLxBXRF1F4d3rI1rZk0kbHEPS5 KHKZUS5Uas2YVA66OoAoEGTzKIeKLkGmjlJAc+BlJ9eVxmIPKj7+U7II9hQLEmnlotmTZB SjzVSsT8rH5D15nlTp6hc8bUWf2RQVEcSiP/bAr7b99H2V5SBISWFOYkSWb3f3uoWqzWBc pidhyfgwVuPUlMpYVDzjycsFc60H7uWi0MpbkIIAWIfpNT3Ys4tllp/El6sjJ09i3sJWvm 7daJmz7a0Mf/taso6BN3g9YKXTjM0oLBdBU1VsL8hRjDtkgbfAxgtQH8ZY6VzA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=polymtl.ca header.s=default header.b="R/R0VhXv"; dmarc=pass (policy=quarantine) header.from=polymtl.ca; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.25 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=polymtl.ca header.s=default header.b="R/R0VhXv"; dmarc=pass (policy=quarantine) header.from=polymtl.ca; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: DAD7B4059F X-Spam-Score: -6.25 X-Migadu-Scanner: scn0.migadu.com X-TUID: xZhWxw8TV72M Guix package specifications match: PACKAGE [@VERSION] [:OUTPUT] thus the following are all valid package specifications: - "guile" - "guile@3.0.8" - "guile:debug" - "guile@3.0.8:debug" This is not currently supported by gwl. To do so, simply mark the package with its output through Guile's object properties infrastructure. The `package-output' procedure can then be used to retrieve the package's output. --- gwl/packages.scm | 22 +++++++++++++++++----- gwl/processes.scm | 5 ++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/gwl/packages.scm b/gwl/packages.scm index 6fe82d4..6a598ba 100644 --- a/gwl/packages.scm +++ b/gwl/packages.scm @@ -31,18 +31,22 @@ inferior-package-version inferior-package-native-inputs inferior-package-derivation)) + #:use-module ((guix ui) + #:select (package-specification->name+version+output)) #:use-module (ice-9 format) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) + #:use-module (srfi srfi-71) #:export (current-guix inferior-store lookup-package valid-package? package-name + package-output bash-minimal build-time-guix @@ -73,11 +77,17 @@ (define (lookup-package specification) (log-event 'guix (G_ "Looking up package `~a'~%") specification) - (match (lookup-inferior-packages (current-guix) specification) - ((first . rest) first) - (_ (raise (condition - (&gwl-package-error - (package-spec specification))))))) + (let* ((name version output + (package-specification->name+version+output specification)) + (inferior-package + (lookup-inferior-packages (current-guix) name version)) + (package (match inferior-package + ((first . rest) first) + (_ (raise (condition + (&gwl-package-error + (package-spec specification)))))))) + (set! (package-output package) output) + package)) (define (valid-package? val) (or (package? val) @@ -100,6 +110,8 @@ the version. By default, DELIMITER is \"@\"." ((? inferior-package? pkg) (inferior-package-full-name pkg)))) +(define package-output (make-object-property)) + (define bash-minimal (mlambda () (lookup-package "bash-minimal"))) diff --git a/gwl/processes.scm b/gwl/processes.scm index ce40d12..4fc4d6d 100644 --- a/gwl/processes.scm +++ b/gwl/processes.scm @@ -643,7 +643,10 @@ PROCESS." (let* ((name (process-full-name process)) (packages (cons (bash-minimal) (process-packages process))) - (manifest (packages->manifest packages)) + (manifest (packages->manifest (map + (lambda (pkg) + (list pkg (package-output pkg))) + packages))) (profile (profile (content manifest))) (search-paths (delete-duplicates (map search-path-specification->sexp -- 2.36.0