mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
build-system/haskell: Generate Setup.hs if needed.
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 commit is contained in:
parent
5f9f2c82e6
commit
ed8d3f33a5
2 changed files with 12 additions and 42 deletions
|
@ -275,9 +275,21 @@ given Haskell package."
|
|||
(_ (error "Could not find a Cabal file to patch."))))
|
||||
#t)
|
||||
|
||||
(define* (generate-setuphs #:rest empty)
|
||||
"Generate a default Setup.hs if needed."
|
||||
(when (not (or (file-exists? "Setup.hs")
|
||||
(file-exists? "Setup.lhs")))
|
||||
(format #t "generating missing Setup.hs~%")
|
||||
(with-output-to-file "Setup.hs"
|
||||
(lambda ()
|
||||
(format #t "import Distribution.Simple~%")
|
||||
(format #t "main = defaultMain~%"))))
|
||||
#t)
|
||||
|
||||
(define %standard-phases
|
||||
(modify-phases gnu:%standard-phases
|
||||
(add-after 'unpack 'patch-cabal-file patch-cabal-file)
|
||||
(add-after 'unpack 'generate-setuphs generate-setuphs)
|
||||
(delete 'bootstrap)
|
||||
(add-before 'configure 'setup-compiler setup-compiler)
|
||||
(add-before 'install 'haddock haddock)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue