guix-devel
[Top][All Lists]
Advanced

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

Re: Package's inputs for developer?


From: Liliana Marie Prikler
Subject: Re: Package's inputs for developer?
Date: Tue, 08 Mar 2022 21:24:02 +0100
User-agent: Evolution 3.42.1

Hi Olivier,

Am Sonntag, dem 06.03.2022 um 11:19 -0500 schrieb Olivier Dion via
Development of GNU Guix and the GNU System distribution.:
> Hi Guix,
> 
> I often find my self using inheritance of package to add native-inputs
> that are not stricly necessary for building the project, but are used
> for developement purpose like so:
> -------------------------------------------------
> (define base-native-inputs (list ...))
> 
> (define my-package
>   (package
>     ...
>     (native-inputs base-native-inputs)
>     ...))
> 
> ;; Developers version
> (package
>   (inherit my-package)
>   (native-inputs
>     (append base-native-inputs
>             (list gdb lcov))))
> -------------------------------------------------
> 
> I guess this is the correct way of doing it or perhaps I should put gdb
> and lcov in the base-native-inputs?.  But I was thinking that perhaps
> something like `(developer-inputs (list gdb lcov))` would be better,
> since these inputs are not stricly necessary for building the
> package.
Note, that manifests exist and you should use them.  An example (from
[1]):

--8<---------------cut here---------------start------------->8---
(use-modules [...])

(define %here (dirname (current-filename)))

(packages->manifest
 (cons*
  emacs emacs-geiser
  guile-hall
  (filter-map
   (match-lambda
     ((_ (? package? package) output) (list package output))
     ((_ (? package? package)) package)
     (else #f))
   (package-development-inputs
    (load (string-append %here "/guix.scm"))))))
--8<---------------cut here---------------end--------------->8---

This adds emacs, emacs-geiser and guile-hall to the package-
development-inputs of the package described in "./guix.scm" and
constructs an environment with all of them.

Cheers

[1] https://gitlab.com/spritely/guile-goblins/



reply via email to

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