GNU bug report logs - #51655
[PATCH] build-system: haskell: Add ‘package-with-explicit-haskell’ procedure.

Previous Next

Package: guix-patches;

Reported by: Xinglu Chen <public <at> yoctocell.xyz>

Date: Sun, 7 Nov 2021 10:56:01 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Lars-Dominik Braun <lars <at> 6xq.net>
To: Xinglu Chen <public <at> yoctocell.xyz>
Cc: 51655 <at> debbugs.gnu.org
Subject: [bug#51655] [PATCH] build-system: haskell: Add ‘package-with-explicit-haskell’ procedure.
Date: Fri, 12 Nov 2021 11:34:11 +0100
Hi,

I’ve tested the patch with the snippet below and it builds most
packages fine, until it hits a type error and aborts. This is probably
expected, since not all packages are compatible with multiple GHC
versions.

The code looks fine, since it’s just moving the Python-specific code to
(guix packages).  I don’t feel qualified enough to say whether the new
API in (guix packages) is welcome or not though. Anyone? Maybe it’d
be worth having a common parameter for all build systems?

---
(use-modules (guix build-system haskell)
             (gnu packages finance))

(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))

(package-with-haskell-8.8 hledger)
---

Cheers,
Lars





This bug report was last modified 3 years and 177 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.