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 kK8pBewuimJS4gAAbAwnHQ (envelope-from ) for ; Sun, 22 May 2022 14:39:08 +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 sKQpBOwuimKfmAAAG6o9tA (envelope-from ) for ; Sun, 22 May 2022 14:39:08 +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 CCC1032E4E for ; Sun, 22 May 2022 14:39:06 +0200 (CEST) Received: from localhost ([::1]:41324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nskrR-00061c-Nf for larch@yhetil.org; Sun, 22 May 2022 08:39:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nskrO-00061T-EI for gwl-devel@gnu.org; Sun, 22 May 2022 08:39:02 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:58511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nskrM-0004mX-2u for gwl-devel@gnu.org; Sun, 22 May 2022 08:39:02 -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 24MCcjWS020041 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Sun, 22 May 2022 08:38:53 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 24MCcjWS020041 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1653223134; bh=hDoSWoItCaF2H37/uhvujuj4vBzWoCFzz+TCn6W9w+U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=t6wsI53sS98mZUbpXmbLbH9hdNHMjjxbYrrJB09R+73cF+u9Al3lkRQFEMEoEApAg O4wLVA27XZld4IrAr8AVQTzYhy637bc1caMXJ9O5nRIzBv7O0qh4qkdwojsgnq0uDI AXxQjB2qkENIH6HMRQMvNdAxjAhrn5OV8FlZcW1E= From: Olivier Dion To: Olivier Dion , Olivier Dion via Subject: [PATCH v4] packages: Support for full Guix specification Date: Sun, 22 May 2022 08:38:44 -0400 Message-Id: <20220522123844.23527-1-olivier.dion@polymtl.ca> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220429180247.17830-1-olivier.dion@polymtl.ca> References: <20220429180247.17830-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 Sun, 22 May 2022 12:38:45 +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=1653223147; 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=hDoSWoItCaF2H37/uhvujuj4vBzWoCFzz+TCn6W9w+U=; b=u6O8tM96GTCQ2z5cOtSgZ0xixZPb3ZV4wUo0s0FO2h/NAPi4orjn2IA+aLSymVqN0SdnzJ ag7XP+RyYCNSXZmb0kPMOfPnikfidp35KSGvy0uzyp3wie8edXkfNMjK/7JyQvXyjZnNug ga9t7G+0cFrztfnuy5v4HdrRc4fzNu9GibGTY7yUgtIiizeQ8/CSbo+uOyFlYufquv6XAD iupStTqTEMTOgSmh2MqD7Bj9C3NdSwkkKidhLed/pB/DLm4FWNKCmvWbtiugg+AAhenTfx 92+zEg0SLCB5ggQCRi9JR39dLCiCFmZcQb/rjewFoCQdvUIFBN9HbI3lKyNv4w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653223147; a=rsa-sha256; cv=none; b=HHSlG/+oZoSvWT4p3nZxga13Q0MJglqdOxC9UM0sPMUJOEtwFeCtGrrjfzZ/mlJcAt/3Xg wEKQ9TXuWh2CQfTPx32eEyjNlcPeVI2vfrLk7LLukCx+AzC8hst0x62QWO5Z/sJJ3TlIHs 6L5FyhXSg6qK61Jwyns79HOIWoYzch8/q1qjxlbiTxM4jg5HBhMalLU8c88jC5p+5XS1T1 9Y3C3xU6pZX4RcUQU3AglswVTjN7dUM4XdQGfNwCKK6vof4tXEdltRXczqFgq0y92dXmh2 CET2VKQDJhTFMSNMuCITqEdkfBAzQI5+LuhEpy5KNHMxRWy2aIyRrbqJRdvw9Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=polymtl.ca header.s=default header.b=t6wsI53s; 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.85 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=polymtl.ca header.s=default header.b=t6wsI53s; 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: CCC1032E4E X-Spam-Score: -6.85 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6tWJSJ1PSL/t 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 | 24 +++++++++++++++++++----- gwl/processes.scm | 5 ++++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gwl/packages.scm b/gwl/packages.scm index 6fe82d4..23bc09d 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,18 @@ (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))) + (let* ((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-object-property! package #:gwl/package-output output) + package))) (define (valid-package? val) (or (package? val) @@ -100,6 +111,9 @@ the version. By default, DELIMITER is \"@\"." ((? inferior-package? pkg) (inferior-package-full-name pkg)))) +(define (package-output pkg) + (object-property pkg #:gwl/package-output)) + (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