From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +BXuDX6PJV+/DAAA0tVLHw (envelope-from ) for ; Sat, 01 Aug 2020 15:51:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YGfFCX6PJV/CcAAAB5/wlQ (envelope-from ) for ; Sat, 01 Aug 2020 15:51:26 +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 AA6FD9403AE for ; Sat, 1 Aug 2020 15:51:25 +0000 (UTC) Received: from localhost ([::1]:35564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k1tnA-0005H0-BC for larch@yhetil.org; Sat, 01 Aug 2020 11:51:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1tn1-0005G6-0Z for help-guix@gnu.org; Sat, 01 Aug 2020 11:51:15 -0400 Received: from lepiller.eu ([89.234.186.109]:37478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1tmy-00075h-Ls for help-guix@gnu.org; Sat, 01 Aug 2020 11:51:14 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id f34d9120; Sat, 1 Aug 2020 15:51:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date :in-reply-to:references:mime-version:content-type :content-transfer-encoding:subject:to:from:message-id; s=dkim; bh=VvXzRIXyg/JovPswDyJbrWZFQgz1+j8ICKW6agwPtig=; b=HDFBplJXAYVx LvLGjWdfID5WkUVmT6N+xGhWaL4teC9jSuCuFpEQsBk2nz1sn3SqF1yPEP57jCSx DkGx+ghM4wXFj8vlE4Z/61sMaErQP2uXShkg/l5ilAA1wPdmNsNeiceYkjppb4jR Y0S+KWwDQ8QNuPNHefkQ1aNR3o0+NDUM/g+ydObdki5DAh9G3GEe5ewQWJwIFGkx /kalKRha2PWXMXuIieHhyvD1uHa4DxSOLaChbATEEByccd9w473Kn2HJcpYkj5ui nckhV/Y8YElMGnDqO0xkcYldaHupNdBLecmngZ/PSpv3RhJxTo2R8fszSwqbbLx5 g6JdthO7bw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 9b879a0b (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Sat, 1 Aug 2020 15:51:02 +0000 (UTC) Date: Sat, 01 Aug 2020 11:50:50 -0400 User-Agent: K-9 Mail for Android In-Reply-To: <9c55ce7f472fe3c84c84a31073f10dce6f7fae92.camel@divoplade.fr> References: <9c55ce7f472fe3c84c84a31073f10dce6f7fae92.camel@divoplade.fr> MIME-Version: 1.0 Subject: Re: Newbie tries to add a snippet to an origin To: help-guix@gnu.org,divoplade From: Julien Lepiller Message-ID: <3ED58746-B570-4AE0-B387-606A10300EA3@lepiller.eu> 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/08/01 11:51:08 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, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=lepiller.eu header.s=dkim header.b=HDFBplJX; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=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-Spam-Score: 0.09 X-TUID: FJA8kVZvzMFa I don't think this is how you are supposed to use snippet :)=2E It's code e= xecuted from the root of the sources that changes it=2E Then guix repacks t= he modified sources and the result is the source for tge package=2E Look at= the code in guix for more examples=2E Here's what I suggest: (source (origin =E2=80=A6 (modules '((guix build utils))) (snipet `(begin (with-output-to-file "=2Etarball-version" (lambda _ (format #t "~a~%" ,version))) #t)))) Of course version needs to be defined in this context (usually as a field = in the package definition, but I'm not sure what dist-package is)=2E You ca= n use any other name or the result of any scheme function, like (package-ve= rsion pomdappi) if you prefer=2E HTH! Le 1 ao=C3=BBt 2020 11:17:36 GMT-04:00, divoplade a =C3= =A9crit : >Hello, > >I am trying to add a file named "=2Etarball-version" containing a fixed >string at the root of my source=2E > >I tried several things, the most promising (I think) being this: > >(define-public pomdappi-dist > (dist-package > pomdappi > (origin > (method git-fetch) > (uri (git-reference > (url "@REPO@") > (commit "@COMMIT@"))) > (sha256 > (base32 > "@COMMIT_BASE32@")) > (snippet > #~(symlink #$(plain-file "=2Etarball-version" "@VERSION@") > "=2Etarball-version"))))) > >However, I get "guix build: error: invalid name: `=2Etarball-version'" >when running guix build=2E > >My idea was to create a file in the store containing the fixed string >@VERSION@, and then symlink it withing the source as "=2Etarball- >version"=2E > >Could someone help me? > >divoplade