**tl;dr** Applying this patch makes Cabal work in Guix environments
and ensures that Cabal picks up Haskell packages installed via Guix.
Guix makes heavy use of GHC_PACKAGE_PATH to make GHC pickup Haskell
packages installed via the Guix package manager. The environment
variable is set using native-search-paths from the GHC packages.
Unfortunately, upstream Cabal does presently not respect
GHC_PACKAGE_PATH. If this environment variable is set, `cabal build`
and other commands will terminate. For building packages, Guix does
not make much use of cabal-install hence this is not as big of an
issue. However, cabal-install does therefore presently not work
out-of-the-box in environments created by Guix. For example,
in `guix shell` environments. This makes it essentially impossible
to use Guix for setting up development environments for Haskell software.
Cabal upstream is aware of this issue and a patch exists to workaround
this problem. The patch is currently not merged upstream due to issues
related to reconfiguration (changing GHC_PACKAGE_PATH between `cabal
configure` and `cabal build`). However, I would argue that this edge
case is not that relevant for Guix and therefore propose including
this patch with the Cabal Guix package. As outlined above, cabal-install
is not usable by default presently, and I would therefore argue that
this is a major improvement over the current situation. I am willing to
work with Cabal upstream to have this issue fixed upstream eventually.
Note that this requires patching the GHC package instead of the
cabal-install package as Guix uses the version of the Cabal package
<https://hackage.haskell.org/package/Cabal> distributed with GHC.
See: https://github.com/haskell/cabal/issues/3728
* gnu/packages/haskell-apps.scm (cabal-install): Include patch
to support the GHC_PACKAGE_PATH environment variable.
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
Change-Id: Ib77ffa937b878690d0e2d8964b534842b99da039
As one profiling test fails very repeatedly on the bordeaux build farm, but
ghc did seem to build successfully on other machines.
* gnu/packages/haskell.scm (ghc-8.10)[arguments]: Don't run the T11627a
profiling test on i686-linux.
Starting with version 3.8, grep emits warning messages when pattern
contain spurious slashes:
grep '\+' /dev/null
grep: warning: stray \ before +
GHC’s testsuite does not expect that and fails.
* gnu/packages/patches/ghc-9.2-grep-warnings.patch: New file.
* gnu/local.mk: Add it.
* gnu/packages/haskell.scm (ghc-9.2)[native-inputs]: Add patch.
* gnu/packages/patches/ghc-9.2-glibc-2.33-link-order.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/haskell.scm (ghc-9.2)[origin]: Use it.
* gnu/packages/haskell.scm (ghc-9.4): New variable.
(ghc-bootstrap-for-9.4): New variable.
(ghc-alex-bootstrap-for-9.4): New variable.
(ghc-happy-bootstrap-for-9.4): New variable.
* gnu/packages/haskell.scm (ghc-6.0)[arguments]: Pass --enable-src-tree-happy
option; remove --with-hc option because we use the same GHC for everything;
add --with-gcc option to embed absolute file name of GCC.
[native-inputs]: Remove unused python-2.
This applies the substitution added in 48718135e7
also for GHC@8.4. Somehow this problem is not fatal there and went unnoticed.
* gnu/packages/haskell.scm (ghc-8.4)[native-inputs]: Patch the test driver for
Python 3.10 compatibility.
This fixes a test failure introduced in commit
c527b0ce23.
* gnu/packages/patches/ghc-testsuite-grep-compat.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/haskell.scm (ghc-8.6, ghc-8.8, ghc-8.10)[native-inputs]: Patch
the 'ghc-testsuite' input.
* gnu/packages/haskell.scm (ghc-8.4)[inputs]: Use inherited inputs.
[arguments]: Rewrite using g-exps. Adjust to use inherited package
arguments. Use inherited 'unpack-testsuite, 'fix environment phases.
Remove redundant 'fix-references phase.
(ghc-8.8)[arguments]: Adjust phases based on changed inherited phases.
* gnu/packages/haskell.scm (ghc-7)[arguments]: Adjust custom 'unpack-bin
and 'unpack-testsuite-and-fix-bins phases to unpack tarballs directly
from the store.
* gnu/packages/haskell.scm (ghc-7, ghc-8.0, ghc-8.4)[inputs]: Change from
LIBFFI to LIBFFI-SANS-STATIC-TRAMPOLINES.
* gnu/packages/libffi.scm (libffi-sans-static-trampolines): New variable.
* gnu/packages/haskell.scm (ghc-4)[arguments]: Remove #:implicit-inputs?.
In 'bootstrap' phase, pass '-optc-D_GNU_SOURCE=1'. Use
'search-input-file' to locate lib{bfd,iberty}.a, and 'which' for cpp.
Patch 'mk/config.mk.in'. In 'configure' phase, emit "config.cache".
In 'make-boot' phase, replace "CLK_TCK" in 'nHandle.c'.
[native-inputs]: Remove now-implicit inputs; remove GLIBC-2.2.5,
GCC-MESBOOT0, and BINUTILS-MESBOOT. Add GCC-2.95 and BINUTILS-2.33.
Remove input labels.
* gnu/packages/patches/nhc98-c-update.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/haskell.scm (nhc98)[source]: Use it.
[arguments]: Remove #:implicit-inputs?.
[native-inputs]: Remove.