From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Louis Subject: Re: bug#22970: guix edit mutt -- not working Date: Sat, 12 Mar 2016 10:35:25 +0100 Message-ID: <20160312093525.GA3042@protected.rcdrun.com> References: <20160309232220.GA13286@protected.rcdrun.com> <20160309234433.GA28823@solar> <20160310193442.GA5630__27937.5219288797$1457638581$gmane$org@protected.rcdrun.com> <87mvq5nvco.fsf@gmail.com> <20160311112109.GA4815@protected.rcdrun.com> <20160311184837.GA28287@protected.rcdrun.com> <87pov015d9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aefyb-0007aK-P1 for help-guix@gnu.org; Sat, 12 Mar 2016 04:36:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aefyY-0001Uj-Iw for help-guix@gnu.org; Sat, 12 Mar 2016 04:36:49 -0500 Received: from stw1.rcdrun.com ([217.170.207.13]:37964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aefyY-0001LL-BS for help-guix@gnu.org; Sat, 12 Mar 2016 04:36:46 -0500 Content-Disposition: inline In-Reply-To: <87pov015d9.fsf@gmail.com> 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-bounces+gcggh-help-guix=m.gmane.org@gnu.org To: Alex Kost Cc: help-guix@gnu.org Hello Alex, Thank you much, it is working like this very good: guix package -i my-mutt by using this file: my-guix-packages.scm in ~/gnu/guix/packages: (define-module (my-guix-packages) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix utils) #:use-module (gnu packages mail) #:use-module (gnu packages databases)) (define-public my-mutt (package (inherit mutt) (name "my-mutt") (inputs (cons `("gdbm" ,gdbm) (package-inputs mutt))) (arguments (substitute-keyword-arguments (package-arguments mutt) ((#:configure-flags cf) `(cons "--enable-hcache" ,cf)))) (synopsis (string-append (package-synopsis mutt) " (configured with --enable-hcache)")))) On Sat, Mar 12, 2016 at 11:13:06AM +0300, Alex Kost wrote: > Jean Louis (2016-03-11 21:48 +0300) wrote: > > > Hello Alex, > > > > I got your mutt file, for my-guix-packages, but now I see I > > need to learn Guile commands, I will do this somewhat later > > when I have working system. Please help me until then, as > > your style to make a modified package is excellent for me. > > It is not my style :-) Package inheriting is a great feature of Guix, > it's just not documented (though "inherit" word can be met in the > manual several times). > > > I guess you forgot the dependency gdbm, where to put it? > > Sorry about that, but actually I didn't forget about it because I didn't > know it is needed (I've never used mutt, and I know nothing about it or > gdbm). Do you mean this dependency is needed because of --enable-hcache > option? > > If so, then it can be added by adding gdbm to the inputs of my-mutt > package (see below). Also (my-guix-packages) module need to use (gnu > packages databases), because gdbm package comes from this module. > > I hope the following comments clarify how my-mutt package is made: > > > (define-module (my-guix-packages) > > #:use-module (guix packages) > > #:use-module (guix download) > > #:use-module (guix utils) > > Don't forget to add this line here: > > #:use-module (gnu packages databases) > > > #:use-module (gnu packages mail)) > > > > (define-public my-mutt > > (package > > (inherit mutt) > > Inheriting means: those package fields that are not specified, will be > taken from mutt package. For example, the package name is changed (to > "my-mutt"), but the version is not, so it will be inherited. This means > when the version of mutt package will be updated, the version of my-mutt > package will automatically be updated too. > > > (name "my-mutt") > > (arguments > > (substitute-keyword-arguments (package-arguments mutt) > > ((#:configure-flags cf) > > `(cons "--enable-hcache" ,cf)))) > > This means: take mutt's arguments and do some substitutions there. In > particular, we modify configure-flags by adding "--enable-hcache" to > them. > > To add gdbm dependency, add the following line to the package > definition: > > (inputs (cons `("gdbm" ,gdbm) (package-inputs mutt))) > > > (synopsis (string-append (package-synopsis mutt) > > " (configured with --enable-hcache)")))) > > Modifying synopsis is not needed, it is just what you see in the output > of "guix package --show=my-mutt" command. > > -- > Alex