help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: REPL example session for overriding a package?


From: Myles English
Subject: Re: REPL example session for overriding a package?
Date: Tue, 24 Jan 2017 15:05:08 +0000
User-agent: mu4e 0.9.18; emacs 25.1.1


on [2017-01-24] at 14:56 Ludovic Courtès writes:

> Myles English <address@hidden> skribis:
>
>> I am trying to make a package that inherits from an existing package and
>> overrides a *minimum* number of elements of the original package
>> definition.
>>
>> Probably the most efficient way to do this would be to try out some
>> things in the REPL using tools from (gnu packages).  Having read a bit
>> about it I am finding it difficult to get my head around working in the
>> REPL, does anyone have an example session?
>>
>>
>> - get an element of a package definition
>> - substitute a nested element
>>
>> Specifically, for the package eigen in (gnu packages algebra) I'd like
>> to remove, or maybe add to, the snippet.
>
> Maybe something like this:
>
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> ,use(gnu packages algebra)
> scheme@(guile-user)> ,use(guix)
> scheme@(guile-user)> (define my-eigen
>                      (package
>                        (inherit eigen)
>                        (source (origin
>                                  (inherit (package-source eigen))
>                                  (snippet
>                                   `(begin
>                                      ,(origin-snippet (package-source eigen))
>                                      (display "hey there!\n")))))))
> scheme@(guile-user)> (origin-snippet (package-source my-eigen))
> $3 = (begin (substitute* "CMakeLists.txt" …))
> --8<---------------cut here---------------end--------------->8---
>
> The snippet here is really pasting together two pieces of code
> (imperative code), which can be brittle (“unhygienic” in macro
> parlance.)

Thank you Ludo' that's just what I am looking for.

Myles



reply via email to

[Prev in Thread] Current Thread [Next in Thread]