unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: Brett Gilio <brettg@posteo.net>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Package variation
Date: Tue, 23 Oct 2018 19:33:09 -0700	[thread overview]
Message-ID: <878t2oul96.fsf@gmail.com> (raw)
In-Reply-To: <87r2ggwne2.fsf@posteo.net> (Brett Gilio's message of "Tue, 23 Oct 2018 13:04:05 -0500")

[-- Attachment #1: Type: text/plain, Size: 2270 bytes --]

Hi Brett,

Brett Gilio <brettg@posteo.net> writes:

> (define-public gnome-custom
>   (package (inherit gnome)
>     (name "gnome-custom")
>     (inputs (alist-delete "nautilus" (package-inputs gnome)))))

The spirit of this is correct, but the implementation isn't quite
right.  The gnome package has no inputs:

  scheme@(guile-user)> ,use (gnu packages gnome)
  scheme@(guile-user)> ,use (guix packages)
  scheme@(guile-user)> (package-inputs gnome)
  $1 = ()

Instead, it has many propagated inputs.  So, you should probably write:

  (define-public gnome-custom
    (package (inherit gnome)
      (name "gnome-custom")
      (propagated-inputs (alist-delete
                           "nautilus"
                           (package-propagated-inputs gnome)))))

This will work as you expect.  It's not incorrect to use alist-delete
here, but FYI you can also use matching to do this as follows:

  (define-public gnome-custom
    (package (inherit gnome)
      (name "gnome-custom")
      (propagated-inputs (remove
                           (match-lambda
                             ;; Ignore the second value.
                             ((name _)
                              (string=? name "nautilus")))
                           (package-propagated-inputs gnome)))))

Whether or not you like that better probably depends on whether or not
you view the value returned by (package-propagated-inputs gnome) as an
alist or a list of 2-element lists.

> (services (cons* (service gnome-desktop-service-type
> 			    config =>
> 			    (gnome-desktop-configuration
> 			     (inherit config)
> 			     (gnome-package gnome-custom)))
> 		   %desktop-services))

It looks like you're using "config =>" from the modify-services syntax
without actually using modify-services.  Try this instead:

  (services (cons* (service gnome-desktop-service-type
                            (gnome-desktop-configuration
                              (inherit config)
                              (gnome-package gnome-custom)))
                   %desktop-services))

This should create and add a gnome-desktop-service-type service instance
with the configuration you've specified.

Hope that helps!

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2018-10-24  2:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23  6:51 Package variation Brett Gilio
2018-10-23  7:33 ` Efraim Flashner
2018-10-23 18:04   ` Brett Gilio
2018-10-23 18:13     ` Efraim Flashner
2018-10-23 19:50       ` Brett Gilio
2018-10-24  2:33     ` Chris Marusich [this message]
2018-10-24  6:01       ` Brett Gilio
2018-10-25  5:35         ` Chris Marusich
2018-10-24 13:06 ` Ludovic Courtès
2018-10-24 21:02   ` Brett Gilio

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=878t2oul96.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=brettg@posteo.net \
    --cc=guix-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).