The default Setup.hs is boilerplate that is frequently left out of
source packages. Several packages already add a phase to generate it,
so moving this phase to the build system is just factoring out an
existing pattern.
See <https://github.com/phadej/time-compat/issues/4>.
* guix/build/haskell-build-system.scm (generate-setuphs): New procedure.
(%standard-phases): Add it after 'unpack'.
* gnu/packages/haskell.scm (ghc-foundation, ghc-inline-c,
ghc-inline-c-cpp, ghc-rio): Remove 'arguments'.
Signed-off-by: Timothy Sample <samplet@ngyro.com>
This is a follow-up to commit a7e231a2a3.
Reported by Marius Bakke <mbakke@fastmail.com>.
* guix/build/haskell-build-system.scm (register): Use "when" instead of
"unless".
Add a #:cabal-revision argument for specifying which Cabal file revision
from Hackage should be used.
* guix/build-system/haskell.scm (source-url->revision-url): New function.
(lower): Accept a cabal-revision keyword argument, convert it to an
origin record, and add it to the resulting bag's host-inputs.
(haskell-build): Pass the cabal-revision input to the builder as an
argument.
* guix/build/haskell-build-system.scm (patch-cabal-file): New phase.
(%standard-phases): Add it.
Benefits include: 'guix environment' more useful for ghc libraries, more
useful 'guix package --search-paths' for installed ghc libraries, cleaner
package recipes: no longer need to propagate runtime package dependencies.
* guix/build/haskell-build-system.scm (configure): Unset GHC_PACKAGE_PATH
around cabal configure.
(make-ghc-package-database): Use pattern directory search.
(register): Install complete package database for the current package.
* gnu/packages/haskell.scm (ghc): Add native-search-paths field.
For Cabal packages with "build-type: Configure", a configure shell
script is run to set up build parameters. These scripts need the
CONFIG_SHELL environment variable to be set to function properly.
* guix/build/haskell-build-system.scm (configure): Set CONFIG_SHELL if
necessary.
A Cabal package is allowed to declare an "empty" library, in an
otherwise executable-only package, for the purpose of allowing Cabal
to use it as a dependency for other packages. See e.g. hspec-discover.
* guix/build/haskell-build-system.scm (register): Unconditionally call
setup script with "register", and install any config file generated.
* guix/build/haskell-build-system.scm (%standard-phases): move 'haddock phase
before 'install phase.
* guix/build/haskell-build-system.scm (haddock): Simplify it as the 'install
phase takes care of copying files.
* guix/build/haskell-build-system.scm (configure): Add '--libsubdir' flag.
Fix use of '--extra-include-dirs' and '--extra-lib-dirs' flags. Use 'doc',
'bin' and 'lib' outputs if they are defined.
* guix/build/haskell-build-system.scm (make-ghc-package-database, register):
Aligh location of 'package.conf.d' directory with '--libsubdir' flag.