From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 04pPEvBuHWA6SQAA0tVLHw (envelope-from ) for ; Fri, 05 Feb 2021 16:14:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KDd/DfBuHWBlVAAAbx9fmQ (envelope-from ) for ; Fri, 05 Feb 2021 16:14:40 +0000 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 B928F9404C8 for ; Fri, 5 Feb 2021 16:14:39 +0000 (UTC) Received: from localhost ([::1]:60728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l83kj-0007Ft-AJ for larch@yhetil.org; Fri, 05 Feb 2021 11:14:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l83kZ-0007Eh-6s for help-guix@gnu.org; Fri, 05 Feb 2021 11:14:27 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:35379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l83kX-0000gQ-33 for help-guix@gnu.org; Fri, 05 Feb 2021 11:14:26 -0500 X-Originating-IP: 86.239.3.142 Received: from pruneau-1.home (lfbn-poi-1-564-142.w86-239.abo.wanadoo.fr [86.239.3.142]) (Authenticated sender: d@divoplade.fr) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 707ECFF82A for ; Fri, 5 Feb 2021 16:14:18 +0000 (UTC) Message-ID: <57572613456b4704f097480b687fef4e8944cf68.camel@divoplade.fr> Subject: Wrapping an R script: how do I compose the R_LIBS_SITE environment variable? From: divoplade To: help-guix@gnu.org Date: Fri, 05 Feb 2021 17:14:17 +0100 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=217.70.183.199; envelope-from=d@divoplade.fr; helo=relay9-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.35 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: B928F9404C8 X-Spam-Score: -1.35 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0lmT1MGZp9vT Dear guix, I am using guix to write R packages. For convenience, I created a small R script that does the job. To make this script work as-is, I wrapped it using wrap-program. wrap- program creates a shell script that sets up environment variables and then call the real script, because R needs to be able to find all the packages and dependencies. More specifically, I need to extend the R_LIBS_SITE environment variable to point to all the R dependencies of my package, as well as their recursive dependencies. How do I compute that? I only care about R dependencies, so using the whole recursive dependency tree of my package seems too much. My current solution is to save the R_LIBS_SITE environment from the build procedure and just use that. The obvious problem is that it also contains build dependencies, and I don't think it will work correctly for cross-compiled packages. Do you have a better idea? Best regards, divoplade