From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catonano Subject: Re: guix hash of source from git repository. Date: Wed, 22 Feb 2017 09:23:03 +0100 Message-ID: References: <20170221221733.GB18231@jasmine> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114444969f5ec205491a34ab Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgSCZ-0002zX-0q for help-guix@gnu.org; Wed, 22 Feb 2017 03:23:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgSCX-0003wb-P8 for help-guix@gnu.org; Wed, 22 Feb 2017 03:23:07 -0500 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:36150) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cgSCX-0003vd-FA for help-guix@gnu.org; Wed, 22 Feb 2017 03:23:05 -0500 Received: by mail-wm0-x229.google.com with SMTP id i186so3639803wmf.1 for ; Wed, 22 Feb 2017 00:23:05 -0800 (PST) In-Reply-To: <20170221221733.GB18231@jasmine> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Leo Famulari Cc: Dmitry Nikolaev , help-guix --001a114444969f5ec205491a34ab Content-Type: text/plain; charset=UTF-8 2017-02-21 23:17 GMT+01:00 Leo Famulari : > On Wed, Feb 22, 2017 at 12:19:35AM +0300, Dmitry Nikolaev wrote: > > When writing package definition, what if I download sources from git > > repository? For example: > > > > (define-public libwebsockets > > (package > > (name "libwebsockets") > > (version "1.3") > > (source (origin > > ;; The project does not publish tarballs, so we have to > take > > ;; things from Git. > > (method git-fetch) > > (uri (git-reference > > (url "git://git.libwebsockets.org/libwebsockets") > > (commit (string-append "v" version > > "-chrome37-firefox30")))) > > (sha256 > > (base32 > > "12fqh2d2098mgf0ls19p9lzibpsqhv7mc5rn1yvrbfnazmcr40g4")) > > (file-name (string-append name "-" version)))) > > ... > > > > How do I calculate this 12fqh2d...? > > Clone the Git repository in the normal way, check out the Git commit you > want to base the Guix package on, and then do this: > > $ guix hash --recursive --exclude-vcs path/to/git-repo > > This is explained in the manual, section Invoking guix hash: > > https://www.gnu.org/software/guix/manual/html_node/Invoking-guix-hash.html > > I apologize for the off the mark suggestion I thought it was just lame, I didn't consider it had even more shortcomings --001a114444969f5ec205491a34ab Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


2017-02-21 23:17 GMT+01:00 Leo Famulari <leo@famulari.name>:
On Wed, Feb 22, 2017 at 12:19:35AM +0300, Dmitry Nikolaev wrote: > When writing package definition, what if I download sources from git > repository? For example:
>
> (define-public libwebsockets
>=C2=A0 =C2=A0(package
>=C2=A0 =C2=A0 =C2=A0(name "libwebsockets")
>=C2=A0 =C2=A0 =C2=A0(version "1.3")
>=C2=A0 =C2=A0 =C2=A0(source (origin
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; The project d= oes not publish tarballs, so we have to take
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; things from G= it.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(method git-fetc= h)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(uri (git-refere= nce
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(url "git://git.libwebsockets.org/libwebso= ckets")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(commit (string-append "v" version
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 "-chrome37-firefox30"))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(sha256
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (base32
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"12fqh2d2098mgf0ls19p9lzibpsqhv7mc5rn1yvrbfnazmcr40g4"))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(file-name (stri= ng-append name "-" version))))
> ...
>
> How do I calculate this 12fqh2d...?

Clone the Git repository in the normal way, check out the Git commit= you
want to base the Guix package on, and then do this:

$ guix hash --recursive --exclude-vcs path/to/git-repo

This is explained in the manual, section Invoking guix hash:

https://www.gnu.org/softwa= re/guix/manual/html_node/Invoking-guix-hash.html



I apologize for= the off the mark suggestion

I thou= ght it was just lame, I didn't consider it had even more shortcomings
--001a114444969f5ec205491a34ab--