[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#22970: guix edit mutt -- not working
From: |
Jean Louis |
Subject: |
Re: bug#22970: guix edit mutt -- not working |
Date: |
Sat, 12 Mar 2016 10:35:25 +0100 |
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