[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#51655] [PATCH] build-system: haskell: Add ‘package-with-explicit-ha
From: |
zimoun |
Subject: |
[bug#51655] [PATCH] build-system: haskell: Add ‘package-with-explicit-haskell’ procedure. |
Date: |
Mon, 15 Nov 2021 16:03:50 +0100 |
Hi,
On Sun, 07 Nov 2021 at 11:55, Xinglu Chen <public@yoctocell.xyz> wrote:
> * guix/packages.scm (package-with-explicit-compiler): New procedure;
> factorized from ‘package-with-explicit-python’.
> * guix/build-system/python.scm (package-with-explicit-python): Use
> ‘package-with-explicit-compiler’.
> * guix/build-system/haskell.scm (package-with-explicit-haskell): New
> procedure.
> * doc/guix.texi (Defining Package Variants): Document it.
> ---
> doc/guix.texi | 37 ++++++++++++++++++
> guix/build-system/haskell.scm | 8 ++++
> guix/build-system/python.scm | 71 +++++++----------------------------
> guix/packages.scm | 55 +++++++++++++++++++++++++++
> 4 files changed, 113 insertions(+), 58 deletions(-)
Neat refactoring! :-) It is something discussing several times and I do
not know if ’package-with-explicit-ocaml’ could not be added too. The
issue is that it depends on more than only one element for “compiling”:
ocaml, findlib and dune.
On the other hand, guix/build-system/gnu.scm contains
’package-with-explicit-inputs*’ which is more or less the same idea.
And ’transform-package-toolchain’ is another instance. This
’package-with-explicit-{ocaml,python}’ pre-dates the transformations and
deep rewriting.
Therefore, maybe refactor could revisit the complete story.
Well, I had headaches last time I gave a look at transformations. And I
do not know if it is possible to have a generic transformation for
rewriting implicit inputs of all build systems. That’s something that
could be nice to nice: ’package-with-explicit-python’ based on a
“generic” ’package-with-explicit-compiler’ (compiler or toolchain
though) and provides ’package-with-explicit-*’ for all build systems
(ocaml, ghc, emacs, guile, etc.).
> +@lisp
> +(use-modules (guix build-system haskell))
> +
> +(define (default-haskell-8.8)
> + ;; Lazily resolve the binding to avoid a circular dependency.
> + (let ((haskell (resolve-interface '(gnu packages haskell))))
> + (module-ref haskell 'ghc-8.8)))
> +
> +(define package-with-haskell-8.8
> + (package-with-explicit-haskell (delay (default-haskell-8.8))
> + "ghc-" "ghc-8.8-"
> + #:variant-property 'ghc-8.8-variant))
> +@end lisp
As Lars said, an instance is missing, IMHO.
Cheers,
simon