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 rj28HlbUEF9zegAA0tVLHw (envelope-from ) for ; Thu, 16 Jul 2020 22:27:34 +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 GBcbGlbUEF9ROAAAbx9fmQ (envelope-from ) for ; Thu, 16 Jul 2020 22:27:34 +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 A6B239403C9 for ; Thu, 16 Jul 2020 22:27:33 +0000 (UTC) Received: from localhost ([::1]:42172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwCLj-0004pO-93 for larch@yhetil.org; Thu, 16 Jul 2020 18:27:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwCLc-0004pH-4y for help-guix@gnu.org; Thu, 16 Jul 2020 18:27:24 -0400 Received: from lepiller.eu ([89.234.186.109]:51256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwCLZ-0000V0-Sk for help-guix@gnu.org; Thu, 16 Jul 2020 18:27:23 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 1415733b; Thu, 16 Jul 2020 22:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=LCywmnlXhdTG 94Uy4LuRtUcx46lgqSELJg7BL5HMfcw=; b=anjt7FVWfSzAq9/QwQICRey8zqbQ Pjp4BEj7ZHIvl42VeFaFtEupNxX589YW7hW1wbzvsecvIl9dDEqgMXyzO15ABFqp 40rVDL1q0mXPcpAJbqOjk97/PYs37gGyF4c5hdCK+U0mIpQQ6yuiIsntw0nDCiAk Ge+7E7PA2ECQDNLXI2LRKdTZ2lTKXNljfz6nLQOGd8TL6y6ppUq/DAjNlkqNElHm 1HpWL9zVnXLP0IB+XtXJP+Ww9ErTUw4FAZBjp3je/VDuc/TRHqgK0KBy8uqOGlzl 1d7C5r7+Ad/B6zTKjo204zXaniDMgdNIA4pVXZEYl7WFGQzNjz6Nf8hg5w== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 534e501e (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Thu, 16 Jul 2020 22:27:14 +0000 (UTC) Date: Fri, 17 Jul 2020 00:27:06 +0200 From: Julien Lepiller To: Zelphir Kaltstahl Subject: Re: usage of guix import / adding a package Message-ID: <20200717002706.6be8fcd6@tachikoma.lepiller.eu> In-Reply-To: <85cf6cfd-5bc1-d04a-7fbb-28e012c40215@posteo.de> References: <85cf6cfd-5bc1-d04a-7fbb-28e012c40215@posteo.de> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: none client-ip=89.234.186.109; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/16 18:27:16 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=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: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lepiller.eu header.s=dkim header.b=anjt7FVW; dmarc=pass (policy=none) header.from=lepiller.eu; 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-Spam-Score: -1.71 X-TUID: fE39StJJpCnB Le Fri, 17 Jul 2020 00:10:36 +0200, Zelphir Kaltstahl a =C3=A9crit : > Hello Guix Users! >=20 > I read on > https://guix.gnu.org/manual/en/html_node/Invoking-guix-import.html: >=20 > "The guix import command is useful for people who would like to add a > package to the distribution with as little work as possible=E2=80=94a > legitimate demand. The command knows of a few repositories from which > it can =E2=80=9Cimport=E2=80=9D package metadata. The result is a package= definition, > or a template thereof, in the format we know (see Defining Packages)." >=20 > I've recently tried this, for example for MyPy: >=20 > ~~~~ > guix import pypi -r mypy > ~~~~ >=20 > This will result in Guile code printed to my terminal. However, I do > not understand how to make use of that code. I do not understand how > I can load it. For example I tried using the -l argument with guix > environment: >=20 > ~~~~ > guix import pypi -r mypy > additional_file.scm > guix environment --pure --load=3Dadditional_file.scm --ad-hoc > python@3.8.2 /home/user/dev/Python/additional_file.scm:2:2: error: > package: unbound variable hint: Did you forget `(use-modules (guix > packages))'? ~~~~ >=20 > So that seems to be the wrong way of trying to make use of it. >=20 > Do I need to provide a patch to the project of the Guix package > manager to add this to Guix packages in general and then be able to > use it in my local setup? >=20 > I do not find the info, how I can now use MyPy inside an environment > or add it to the available packages on any of the following pages: >=20 > - > https://guix.gnu.org/manual/en/html_node/Python-Modules.html#Python-Modul= es >=20 > - https://guix.gnu.org/manual/en/html_node/Invoking-guix-import.html >=20 > While https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html > makes me think, that perhaps I need to submit it as patch to be able > to use MyPy. >=20 > If so, how would I test, whether guix import did its thing correctly? > I could try running MyPy in an environment, but for that I would have > to somehow make use of what guix import gives me, before submitting a > patch. >=20 > Also, if I need to submit a patch adding the guix import output > somewhere, is there a guide on how to create such a patch for the Guix > project? >=20 > Regards, > Zelphir >=20 Hi zelphir, You don't need to send a patch, although it would be very welcome. You should read https://guix.gnu.org/manual/devel/en/html_node/Defining-Packages.html where you can learn about package modules and how to import missing modules that cause the issue you are having. Basically, you need a header such as (use-modules (gnu) (guix packages)) etc... Then, you'll have to make sure your file returns something: guix import -r will return you a code that defines one or more variables, but nothing is returned. If you don't do anything, after adding the required headers, you'll simply see an error about #. Put the name of the package you want to build in its own line at the very end of the file, like: python-mypy this will ensure the value associated with that variable is returned from the file, and you will be able to load the file with guix environment -l or guix build -f. HTH!