From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Lepiller Subject: Re: Checksum error on manual package install Date: Tue, 02 Jul 2019 21:31:22 +0200 Message-ID: <9025A816-E0F3-4CB6-ACFC-6A560D0A0310@lepiller.eu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:36642) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiOX5-0001Bg-9g for help-guix@gnu.org; Tue, 02 Jul 2019 15:33:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiOX2-0002kK-29 for help-guix@gnu.org; Tue, 02 Jul 2019 15:33:39 -0400 Received: from lepiller.eu ([89.234.186.109]:42244) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hiOWv-0001Pj-BT for help-guix@gnu.org; Tue, 02 Jul 2019 15:33:32 -0400 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: help-guix@gnu.org, Lorem Ipsum Le 2 juillet 2019 13:08:01 GMT+02:00, Lorem Ipsum a =C3=A9crit : >Hi, > >I am trying to install a non-packaged piece of software, [[ >https://nomacs=2Eorg/][nomacs]]=2E It >seems that through the paradigm of Guix, this is to be done with ~guix >package~ rather than with ~make~ etc=2E Or, put differently, to install >an application which is not in the package repos, I need to package it >myself=2E Am I correct in my understanding? > >I have read through "[[ >https://www=2Egnu=2Eorg/software/guix/manual/en/html_node/Defining-Packag= es=2Ehtml][Section >6=2E2 Defining Packages]]", as well as the >blog post "[[ >https://www=2Egnu=2Eorg/software/guix/blog/2018/a-packaging-tutorial-for-= guix/][A >packaging tutorial for Guix]]", and followed along at home=2E >I was successful in packaging and installing "my-hello=2Escm"=2E It seem= s >to me that packaging ~nomacs~ should be as simple as replacing the >relevant pieces within the "my-hello=2Escm" template=2E > >#+begin_src scheme :file my-nomacs=2Escm >(use-modules (guix packages) > (guix download) > (guix build-system gnu) > (guix licenses)) > >(package > (name "nomacs") > (version "3=2E12") > (source (origin > (method url-fetch) > (uri (string-append "https://github=2Ecom/nomacs/nomacs/archive/" >version > "=2Etar=2Egz")) > (sha256 > (base32 > >"f4a32169e6c0cb939971da2732e4d67c6e2e649506da1b55bfc94963a26280ff")))) > (build-system gnu-build-system) > (synopsis "Open source image viewer") > (description > "nomacs is a free, open source image viewer, which supports >multiple platforms=2E You can use it for viewing all common image >formats including RAW and psd images=2E") > (home-page "https://nomacs=2Eorg") > (license gpl3+)) >#+end_src > >However, when I try to install, I get an error about invalid base32: >#+begin_src sh >$ guix package --install-from-file=3Dmy-nomacs=2Escm > >guix package: error: exception thrown: #&invalid-base32-character [character: #\e string: >"f4a32169e6c0cb939971da2732e4d67c6e2e649506da1b55bfc94963a26280ff"] >23ee2a0> >#+end_src > >Here is how I obtained that hash: >#+begin_src sh >$ wget https://github=2Ecom/nomacs/nomacs/archive/3=2E12=2Etar=2Egz >--2019-07-02 06:36:39-- >https://github=2Ecom/nomacs/nomacs/archive/3=2E12=2Etar=2Egz >Resolving github=2Ecom (github=2Ecom)=2E=2E=2E 192=2E30=2E253=2E112 >Connecting to github=2Ecom (github=2Ecom)|192=2E30=2E253=2E112|:443=2E=2E= =2E connected=2E >HTTP request sent, awaiting response=2E=2E=2E 302 Found >Location: https://codeload=2Egithub=2Ecom/nomacs/nomacs/tar=2Egz/3=2E12 >[following] >--2019-07-02 06:36:40-- >https://codeload=2Egithub=2Ecom/nomacs/nomacs/tar=2Egz/3=2E12 >Resolving codeload=2Egithub=2Ecom (codeload=2Egithub=2Ecom)=2E=2E=2E 140= =2E82=2E113=2E9 >Connecting to codeload=2Egithub=2Ecom >(codeload=2Egithub=2Ecom)|140=2E82=2E113=2E9|:443=2E=2E=2E >connected=2E >HTTP request sent, awaiting response=2E=2E=2E 200 OK >Length: unspecified [application/x-gzip] >Saving to: =E2=80=983=2E12=2Etar=2Egz=2E1=E2=80=99 > >3=2E12=2Etar=2Egz=2E1 [ <=3D> ] 1=2E66M 2=2E5= 4MB/s in >0=2E7s > >2019-07-02 06:36:41 (2=2E54 MB/s) - =E2=80=983=2E12=2Etar=2Egz=2E1=E2=80= =99 saved [1736648] > >$ sha256sum 3=2E12=2Etar=2Egz >f4a32169e6c0cb939971da2732e4d67c6e2e649506da1b55bfc94963a26280ff >3=2E12=2Etar=2Egz >#+end_src > >This is where I'm stuck=2E I know that the hash needs to be base32 and >that the hash returned by ~sha256sum~ is not that=2E I would think this >wouldn't matter since the Guile script calls ~base32~=2E > >I'm unsure how to proceed=2E Any advice would be appreciated! > >Thank you, >Matt Hi, Nice work! You should use guix download to get the right hash, like so: "g= uix download 3=2E12=2Etar=2Egz"=2E You can also put the hash of another pac= kage, see it fail and it will give you the hash it got instead=2E There are other good practices you didn't follow, but they are not require= d to get your package to work: github tarballs are auto-generated and can c= hange from time to time, so it's best to use git-fetch instead, since it wi= ll always give you the same content=2E You should also use (file-name =E2= =80=A6) so the store item for the source gets a meaningful name=2E There ar= e already a lot of examples of that in guix sources=2E Good luck for your packaging effort!