From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: Re: guix hash of source from git repository. Date: Tue, 21 Feb 2017 17:17:33 -0500 Message-ID: <20170221221733.GB18231@jasmine> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIkc-0004ve-AD for help-guix@gnu.org; Tue, 21 Feb 2017 17:17:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgIkZ-00053l-5e for help-guix@gnu.org; Tue, 21 Feb 2017 17:17:38 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:45672) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgIkZ-00053f-1w for help-guix@gnu.org; Tue, 21 Feb 2017 17:17:35 -0500 Content-Disposition: inline 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 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