* gnu/packages/haskell.scm (ghc-8.6)[arguments]: Add phase
"remove-unnecessary-references" to remove references to build tools and
inter-output references.
All these packages have non-standard outputs. As a result the build system
cannot automatically add the "static" output, so we do this manually.
* gnu/packages/haskell-check.scm (ghc-quickcheck, ghc-hunit)[outputs]: Add
"static" output.
* gnu/packages/haskell-web.scm (ghc-http)[outputs]: Same.
* gnu/packages/haskell-xyz.scm (ghc-case-insensitive, ghc-fgl, ghc-hashable,
ghc-network, ghc-network-uri, ghc-parallel, ghc-paths, ghc-primitive,
ghc-random, ghc-split, ghc-syb, ghc-tf-random, ghc-unordered-containers,
ghc-vector, ghc-zlib)[outputs]: Same.
The "--bindir" option is not as useful as it seems as the configured location
is embedded in the outputs. Instead of using "--bindir" it seems better to
build a statically linked binary and move the binary to its own output to
avoid references between the "out" and "bin" outputs.
* guix/build/haskell-build-system.scm (configure): Do not pass "--bindir".
See <https://bugs.gnu.org/39309>.
* guix/build-system/haskell.scm (lower): Include the transitive
propagated inputs of 'extra-directories' inputs.
(haskell-build): Add the 'extra-directories' keyword and pass it through
to the builder.
* guix/build/haskell-build-system.scm (configure): Use it to select
which inputs get passed via 'extra-include-dirs' and 'extra-lib-dirs' to
Cabal.
* gnu/packages/haskell-xyz.scm (ghc-alsa-core, ghc-hmatrix,
ghc-hmatrix-gsl, ghc-hslua, ghc-iwlib, ghc-libyaml, ghc-ncurses,
ghc-openglraw, ghc-x11, ghc-x11-xft, ghc-zlib): Set 'extra-directories'.
* gnu/packages/haskell-crypto.scm (ghc-digest, ghc-hsopenssl): Likewise.
* guix/build/haskell-build-system.scm (register): Strip references to the doc
output from the generated package config files; move the haddock files from
the "doc" output to the "lib" output.
* guix/build-system/haskell.scm (lower): Add OUTPUTS keyword and add the
"static" output in the common case.
(haskell-build): Set the default value for the OUTPUTS keyword to include the
"static" output.
* guix/build/haskell-build-system.scm (install): Move static libraries to the
"static" output if it exists.
* guix/build/haskell-build-system.scm (configure): Add configure flags to
build shared libraries by default, to generate position independent code, and
to set the RUNPATH.
* guix/build-system/haskell.scm (haskell-build): Add keyword PARALLEL-BUILD?
and pass it on to the builder.
* guix/build/haskell-build-system.scm (build): Accept keyword PARALLEL-BUILD?
and pass the number of parallel jobs to GHC.