all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Pierre Neidhardt <mail@ambrevar.xyz>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: Parameterized packages
Date: Tue, 21 Jan 2020 20:04:00 +0100	[thread overview]
Message-ID: <CAJ3okZ1p1m+kj=hf2iSzE0C5NKy-5=jbun6_t9QuDW=+O9sd6Q@mail.gmail.com> (raw)
In-Reply-To: <87lfq1q7ea.fsf@ambrevar.xyz>

On Tue, 21 Jan 2020 at 14:13, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
>
> zimoun <zimon.toutoune@gmail.com> writes:
>
> >> > --8<---------------cut here---------------start------------->8---
> >> > (define (make-me-a-package option1 option2)
> >> >     (package
> >> >       …))
> >> > --8<---------------cut here---------------end--------------->8---
> >>
> >> The ellipsis is a bit vague here.  What is this trying to do?
> >
> > What you wrote below. :-)
>
> ?

--8<---------------cut here---------------start------------->8---
(define (make-me-a-package VIDEO-PLAYER PYTHON-VERSION WITH-FFMPEG)
   (package
        [all your "messy" code using stuff]
      ))

(define-public you-get-vlc
    (make-me-a-package 'vlc 'python #t))
--8<---------------cut here---------------start------------->8---



> > And my opinion is that you described is already possible (more or
> > less) using 'inherit'. Except the modification of the compiling
> > options (build-system).
>
> The crucial difference is the current approach with inherit /does not
> compose/.  This is where USE flags stand strong because you can tell
> what happens when both flags X and Y are set, e.g.

I do not understand what you do mean by "does not compose".


To me, a package is:
"./configure && make && make check && make install"
so I understand why tweak the flags used by "./configure", for example
change "--with-vlc=" from the default 0 to the tuned 1. Or use another
compiling toolchain.
I understand also these flags could require different inputs.

And again from my understanding, this is more or less cover by
'inherit'. Or some macrology should be improved in 'package/inherit'
or in 'records.scm', i.e., something more fine grained when
inheriting.


--8<---------------cut here---------------start------------->8---
(define (make-you-get VIDEO-PLAYER PYTHON-VERSION WITH-FFMPEG)
  (package
     (inherit you-get
        #:add-inputs
         `(("PLAYER" ,VIDEO-PLAYER))
           ,@(IF WITH-FFMPEG)
             ;; FOR MULTI-PART AND >=1080P VIDEOS
             `("FFMPEG" ,FFMPEG)
        #:replace-arguments ...
       #:add-phase ...
             '())))

(define-public you-get-vlc (make-you-get 'vlc))
--8<---------------cut here---------------end--------------->8---


Something like that. And everything is more controlled, i.e., no mess
with global parameters.

What you want to do is: add/remove/replace inputs/arguments so
#:add-inputs, #:remove-native-inputs, etc.

And this composes in the same way function composes. And yes, it
composes explicitly which can be annoying, But implicit composition
will end up to the Gentoo USE flag mess, IMHO.



> >> - To let the user choose which video player to use.  This is a popular
> >>   USE flag on Gentoo (maybe with a different name).
> >
> > What I do not understand is: people who used Gentoo and especially USE
> > flag are saying that it ends with a big mess with broken packages.
> > Therefore, why does Guix want to reproduce the mess?
>
> Because it is extremely powerful: in a simple declaration like "no-X +
> pulseaudio + python3 + gtk2" you can build /your entire system/,
> according to the flags you've set, in just one command.

Hum? but months later your system is broken... so I am not convinced
it is powerful. :-)

It is broken because composing complex system is an hard task. Typing
helps a bit to detect error at compile time (in this case at building
package time) but run-time errors will still remain and it will be
hard time to find them.

Cheers,
simon

  reply	other threads:[~2020-01-21 19:04 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14 11:54 Parameterized packages Ludovic Courtès
2019-05-14 15:17 ` Tobias Geerinckx-Rice
2019-05-17 14:23   ` Pierre Neidhardt
2019-05-17 18:15   ` Mark H Weaver
2019-07-19  5:41     ` Chris Marusich
2019-07-19 20:29     ` ison
2020-01-02 19:23       ` Pierre Neidhardt
2020-01-09 11:10         ` Pierre Neidhardt
2020-01-09 23:13           ` Marius Bakke
2020-01-10 12:29             ` Pierre Neidhardt
2020-01-10 16:19         ` Ludovic Courtès
2020-01-11 11:31           ` Pierre Neidhardt
2020-01-14 15:05             ` zimoun
2020-01-15  9:40               ` Pierre Neidhardt
2020-01-15 11:30                 ` zimoun
2020-01-15 11:51                   ` Pierre Neidhardt
2020-01-15 13:54                     ` zimoun
2020-01-16 19:06                       ` ison
2020-01-16 20:55                         ` Ricardo Wurmus
2020-01-17 16:34                           ` Pierre Neidhardt
2020-01-17  9:15                         ` L p R n d n
2020-01-17 16:46                           ` Pierre Neidhardt
2020-01-17 15:53                         ` zimoun
2020-01-17 16:56                           ` Pierre Neidhardt
2020-01-20 14:34                             ` zimoun
2020-01-21 10:56                             ` Build systems and implicit inputs Ludovic Courtès
2020-01-21 12:24                               ` zimoun
2020-01-21 13:07                                 ` Pierre Neidhardt
2020-01-21 18:02                                   ` zimoun
2020-01-19 20:34                           ` Parameterized packages Ludovic Courtès
2020-01-20  9:08                             ` Pierre Neidhardt
2020-01-20 14:50                               ` zimoun
2020-01-20 18:57                                 ` Pierre Neidhardt
2020-01-20 19:07                                   ` Pierre Neidhardt
2020-01-20 22:57                                   ` ison
2020-01-21 10:09                                     ` Pierre Neidhardt
2020-01-21 10:49                                     ` Ludovic Courtès
2020-01-21 12:15                                   ` zimoun
2020-01-21 13:13                                     ` Pierre Neidhardt
2020-01-21 19:04                                       ` zimoun [this message]
2020-01-22  9:54                                         ` Pierre Neidhardt
2020-01-22 12:23                                           ` zimoun
2020-01-24 21:56                                             ` ison
2020-01-26 19:35                                               ` zimoun
2020-01-27 10:13                                                 ` Pierre Neidhardt
2020-01-27 11:23                                                   ` zimoun
2020-01-27 11:50                                                     ` Pierre Neidhardt
2020-01-27 12:34                                                       ` zimoun
2020-01-27 10:04                                               ` Pierre Neidhardt
2020-01-25 18:52                                             ` John Soo
2020-01-27 10:17                                               ` Pierre Neidhardt
2020-01-20 14:12                             ` zimoun
2020-01-17 16:31                         ` Pierre Neidhardt
     [not found]                         ` <875zhbvzfz.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me>
2020-01-17 16:41                           ` Pierre Neidhardt
2020-01-19 20:30                           ` Ludovic Courtès
2020-01-15 11:43                 ` Pierre Neidhardt
2020-01-15 11:44           ` Pierre Neidhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ3okZ1p1m+kj=hf2iSzE0C5NKy-5=jbun6_t9QuDW=+O9sd6Q@mail.gmail.com' \
    --to=zimon.toutoune@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=mail@ambrevar.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.