From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catonano Subject: Re: guix hash of source from git repository. Date: Tue, 21 Feb 2017 22:25:35 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1146b1664e8337054911050b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgHwI-0003AD-6M for help-guix@gnu.org; Tue, 21 Feb 2017 16:25:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgHwH-0006YG-9y for help-guix@gnu.org; Tue, 21 Feb 2017 16:25:38 -0500 Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]:33844) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cgHwG-0006Y1-Vr for help-guix@gnu.org; Tue, 21 Feb 2017 16:25:37 -0500 Received: by mail-wr0-x230.google.com with SMTP id z61so89882681wrc.1 for ; Tue, 21 Feb 2017 13:25:36 -0800 (PST) In-Reply-To: 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: Dmitry Nikolaev Cc: help-guix --001a1146b1664e8337054911050b Content-Type: text/plain; charset=UTF-8 Hi Dmitry, 2017-02-21 22:19 GMT+01:00 Dmitry Nikolaev : > 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...? > > Dmitry Nikolaev > You clone the git repository locally, then you use 'guix hash' as explained in this page of the manual (the option you want to use is "--recursive") https://www.gnu.org/software/guix/manual/html_node/Invoking-guix-hash.html Another option is to try to build the package with the wrong hash, wait for the error message and copy the right hash from within the error message itself. Lame, but hey Hope this helps ! Ciao --001a1146b1664e8337054911050b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dmitry,

2017-02-21 22:19 GMT+01:00 Dmitry Nikolaev = <cameltheman@= gmail.com>:
When writing package definition, what i= f I download sources from git repository? For example:

(define-publi= c libwebsockets
=C2=A0 (package
=C2=A0=C2=A0=C2=A0 (name "libweb= sockets")
=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=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; The project does not publish tarballs,= so we have to take
=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 ;; things from Git.
=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 (method git-fetch)=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 (uri (git-reference
=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 (url = "git://git.libwebsockets.org/libwebsockets")
=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 (commit (string-append "v" vers= ion
=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=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=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=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=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "12f= qh2d2098mgf0ls19p9lzibpsqhv7mc5rn1yvrbfnazmcr40g4"))
=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 (file= -name (string-append name "-" version))))
...

How= do I calculate this 12fqh2d...?

Dmitry Nikolaev

You clone the git repository locally, then y= ou use 'guix hash' as explained in this page of the manual (the opt= ion you want to use is "--recursive")

https://= www.gnu.org/software/guix/manual/html_node/Invoking-guix-hash.html
<= br>
Another option is to try to build the package with the wrong = hash, wait for the error message and copy the right hash from within the er= ror message itself. Lame, but hey

Hope this helps !
Ciao

=C2=A0

--001a1146b1664e8337054911050b--