unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 44321@debbugs.gnu.org
Subject: [bug#44321] [PATCH 6/6] doc: Add "Defining Package Variants" section.
Date: Fri, 30 Oct 2020 12:20:18 +0100	[thread overview]
Message-ID: <875z6s6jv1.fsf@gmail.com> (raw)
In-Reply-To: <20201029231000.14568-6-ludo@gnu.org> ("Ludovic Courtès"'s message of "Fri, 30 Oct 2020 00:10:00 +0100")

Hi,

On Fri, 30 Oct 2020 at 00:10, Ludovic Courtès <ludo@gnu.org> wrote:

> -* Invoking guix repl::          Programming Guix in Guile.
> +* Invoking guix repl::          Programming Guix in Guile

This change is already in commit 729d4ba025bc8556d00041f9af5b6609eeec9d80.


> +You can just as well define variants with a different set of
> +dependencies than the original package.  For example, the default
> +@code{gdb} package depends on @code{guile}, but since that is an
> +optional dependency, you can define a variant that removes that
> +dependency like so:
> +
> +@lisp
> +(use-modules (gnu packages gdb)    ;for 'gdb'
> +             (srfi srfi-1))        ;for 'alist-delete'
> +
> +(define gdb-sans-guile
> +  (package
> +    (inherit gdb)
> +    (inputs (alist-delete "guile"
> +                          (package-inputs gdb)))))
> +@end lisp

Does it make sense to add a sentence explaining that the “guile” is the
name provided by the string in the ’inputs’ list of the package ’gdb’,
namely:

--8<---------------cut here---------------start------------->8---
    (inputs
     `(("expat" ,expat)
       ("mpfr" ,mpfr)
       ("gmp" ,gmp)
       ("readline" ,readline)
       ("ncurses" ,ncurses)
       ("guile" ,guile-2.0)
       ("python-wrapper" ,python-wrapper)
       ("source-highlight" ,source-highlight)

       ;; Allow use of XML-formatted syscall information.  This enables 'catch
       ;; syscall' and similar commands.
       ("libxml2" ,libxml2)

       ;; The Hurd needs -lshouldbeinlibc.
       ,@(if (hurd-target?) `(("hurd" ,hurd)) '())))
--8<---------------cut here---------------end--------------->8---

?  Because it can be confusing.  Especially when the ’rewriting’ works
on symbols instead.


> +@deffn {Scheme Procedure} options->transformation @var{opts}
> +Return a procedure that, when passed an object to build (package,
> +derivation, etc.), applies the transformations specified by @var{opts} and returns
> +the resulting objects.  @var{opts} must be a list of symbol/string pairs such as:
> +
> +@example
> +((with-branch . "guile-gcrypt=master")
> + (without-tests . "libgcrypt"))
> +@end example

Is it on purpose that here you use ’without-tests’ and then…

> +Each symbol names a transformation and the corresponding string is an argument
> +to that transformation.
> +@end deffn
> +
> +For instance, a manifest equivalent to this command:
> +
> +@example
> +guix build guix \
> +  --with-branch=guile-gcrypt=master \
> +  --with-debug-info=zlib
> +@end example
> +
> +@noindent
> +... would look like this:
> +
> +@lisp
> +(use-modules (guix transformations))
> +
> +(define transform
> +  ;; The package transformation procedure.
> +  (options->transformation
> +   '((with-branch . "guile-gcrypt=master")
> +     (with-debug-info . "zlib"))))
> +
> +(packages->manifest
> + (list (transform (specification->package "guix"))))
> +@end lisp

…you use ’with-debug-info’ as example?


> +@lisp
> +(define libressl-instead-of-openssl
> +  ;; Replace all the packages called "openssl" with LibreSSL.
> +  (package-input-rewriting/spec `(("openssl" . ,(const libressl)))))
> +@end lisp

It is already in the manual but why this ’const’?


BTW, cool!  Nice features! :-)

All the best,
simon




  reply	other threads:[~2020-10-30 11:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 23:08 [bug#44321] [PATCH 0/6] Adding a (guix transformations) module Ludovic Courtès
2020-10-29 23:09 ` [bug#44321] [PATCH 1/6] guix build: 'package-with-source' no longer takes a 'store' parameter Ludovic Courtès
2020-10-29 23:09   ` [bug#44321] [PATCH 2/6] guix build: Remove unnecessary (replacement #f) Ludovic Courtès
2020-10-29 23:09   ` [bug#44321] [PATCH 3/6] guix build: 'options->transformation' no longer takes a 'store' parameter Ludovic Courtès
2020-10-30 22:27     ` Miguel Ángel Arruga Vivas
2020-10-31 10:03       ` Ludovic Courtès
2020-10-29 23:09   ` [bug#44321] [PATCH 4/6] guix build: Move transformation options to (guix transformations) Ludovic Courtès
2020-10-30 23:03     ` Miguel Ángel Arruga Vivas
2020-10-31 10:04       ` Ludovic Courtès
2020-10-29 23:09   ` [bug#44321] [PATCH 5/6] transformations: Raise '&formatted-message' exceptions instead of 'leave' Ludovic Courtès
2020-10-30 10:59     ` zimoun
2020-10-30 22:39       ` Miguel Ángel Arruga Vivas
2020-10-31 10:06         ` Ludovic Courtès
2020-10-31 22:18           ` bug#44321: " Ludovic Courtès
2020-11-02 12:25           ` [bug#44321] " zimoun
2020-11-02 15:48             ` Ludovic Courtès
2020-10-29 23:10   ` [bug#44321] [PATCH 6/6] doc: Add "Defining Package Variants" section Ludovic Courtès
2020-10-30 11:20     ` zimoun [this message]
2020-10-31 10:14       ` Ludovic Courtès
2020-10-30 23:27   ` [bug#44321] [PATCH 1/6] guix build: 'package-with-source' no longer takes a 'store' parameter Miguel Ángel Arruga Vivas
2020-10-31 10:17     ` Ludovic Courtès

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=875z6s6jv1.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=44321@debbugs.gnu.org \
    --cc=ludo@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).