From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id aAsFGdgCrGWuTAEAqHPOHw:P1 (envelope-from ) for ; Sat, 20 Jan 2024 18:28:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id aAsFGdgCrGWuTAEAqHPOHw (envelope-from ) for ; Sat, 20 Jan 2024 18:28:56 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="RRBtJ/fL"; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705771736; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=HvbDGs7gPKZO7QcPJ9Y+WLh9mIIWuymEGK6F7pZLYOk=; b=PQEa02WdpCpvPCOCR0EjbEQAKTCkTJOO61fzcyKPJMtRs5HxxNmkpfKxLv8llAwV5fzYKp BikFGv+TNYhAUTbbOYUKJdAjCUMC3INgzHWrjABUyg9XbooCkcK0SlpkQLkNKP7QVvFgoH Vfl1kBYFG2FR3WGwFkpyWgkJbaPiAJDrG4RGB7j/rE4bq4/wei+svNdhhO/Nq83mXdrDzN zYreWR4MiLv5OukgJGe0DgPsO0ubAs+J54nph34OhzcaxfwRc92JlOiSuXG16KXNxkJKTH BUhhKQqhSdJwMNCr24+xxJijQTg3YaWE+ZwjYFgQz544JHr49Fon+l13LC1xeQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="RRBtJ/fL"; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705771736; a=rsa-sha256; cv=none; b=LJoz8kPAF02HbSBjdQGe6gogpfKdpsIku3jeBb9SV0qEMR2jOixj057I0I9b8zmUSUl8UX td3VJSu5C07AVtRBsZjJY3ruY3xCYO1ArS5qDLDcjR+ziV8DRKD8THtVE9pPjpvx3iHtxz p/OjErV+3fyW1H5yXajwlOuOqsIWmX/j319Yq6NG5fdRUh8Huxeoh5ZkRZpManBF0uZJFI SfZI/IT1hJp3W39iq+3NPYjH0RRS7tZbQTCJY76e4364G2pldm5HhmFGW6Ccc8J2U1OgDs feS9BGleR20HXXP8wAymGrvEmEQhDeO4SseZP6EgeHyKsbvBrPKOHrMFQf4LaQ== 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 543A557BDF for ; Sat, 20 Jan 2024 18:28:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRF95-0005NT-Lf; Sat, 20 Jan 2024 12:28:39 -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 1rRF8z-0005Mr-MR for help-guix@gnu.org; Sat, 20 Jan 2024 12:28:34 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRF8x-0001L3-Fm for help-guix@gnu.org; Sat, 20 Jan 2024 12:28:33 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 72005240027 for ; Sat, 20 Jan 2024 18:28:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705771709; bh=/DFQr7bWy+6EiDyV2bI8BP+RxZhpZO03PJOkkqmrziI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=RRBtJ/fL7kgGStowTWoN2UUfAn7VfcLb80ogEOJdQ57eFO2BoGKFGus7nNvMURfmV IE/KJ2SP5Gagpd4X0wi2yGiJGG6L5fnCMmorLzJZIx4O+NuFCtz9oMPQQMsCfNua8X J/7QDYwR24Rpif80NqHtYzMwnQIo/MJRJbR/NuDLRu+zl3LtXpwLBNTnxVbmFDCVcX rQY/mevTj5N4c1m4XWMd646zur5Rjf8qJiaXMsKYvUYNc4A0d+L48jhUxWwygT8PbW TZ8O/ZlK7IdZyhemQORoQbyiTyGdvM8DL6ktYV6geNnKbPf1UOWzM/T0AWAXaOCkbI f//VxQEtPpYGQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4THNk44k74z9rxG; Sat, 20 Jan 2024 18:28:28 +0100 (CET) References: <87jzrdtao6.fsf@posteo.net> <87h6j90zrf.fsf@posteo.net> <87a5p1yp24.fsf@lease-up.com> From: =?utf-8?Q?Th=C3=A9o?= Tyburn To: Felix Lechner Cc: Tomas Volf , help-guix@gnu.org Subject: Re: Make a simple guile script to a package - source local file Date: Sat, 20 Jan 2024 17:19:05 +0000 In-reply-to: <87a5p1yp24.fsf@lease-up.com> Message-ID: <875xznj4n7.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=theo.tyburn@posteo.net; helo=mout01.posteo.de 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: help-guix@gnu.org X-Mailman-Version: 2.1.29 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -10.39 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -10.39 X-Migadu-Queue-Id: 543A557BDF X-TUID: asqx/77FvNJw Hi Felix, Felix Lechner writes: > Hi Th=C3=A9o, > > On Fri, Jan 19 2024, Th=C3=A9o Tyburn wrote: > >> How do I go about packaging it to make the script available from the com= mand line >> without polluting the environment with the dependencies ? > > The best way is wrap-program, or my forthcoming wrap-executable. > > Kind regards > Felix This is what I was looking for, thanks ! If someone is interested, here is my function to wrap a python script in a = package: #+BEGIN_SRC scheme (define*-public (python-script-package name source-dir source-file #:key (i= nputs '())) (package (name name) (version "") (source (local-file (string-append source-dir "/" source-file) #:recursi= ve? #t)) (build-system copy-build-system) (inputs (cons python inputs)) (arguments (list #:install-plan #~'((#$source-file #$(string-append "bin= /" name))) #:phases `(modify-phases %standard-phases (add-after 'strip 'wrap-python-scripts (lambda* (#:key outputs #:allow-other-keys) ;; Make sure program runs with the correct PYTHONPATH. (wrap-program (search-input-file outputs (string-append "bin/" ,na= me)) `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))))))) =20=20=20 (home-page "") (synopsis "") (description "") (license license:lgpl3+))) #+END_SRC It works like a charm with my guix home declaration :) Happy hacking !