gnu: ghc-haddock: Update to 2.22.0.

* gnu/packages/haskell-xyz.scm (ghc-haddock): Update to 2.22.0.
[arguments]: Replace the 'remove-haddock-test-test-suites' phase with a
'remove-hoogle-test' phase, which only disables the Hoogle test; add a
new phase that puts the newly built 'haddock' binary in the 'PATH'
variable for testing.
[native-inputs]: Add 'ghc-haddock-test'.
(ghc-haddock-test): New variable.
This commit is contained in:
Timothy Sample 2019-11-15 20:00:27 -05:00
parent 1b84d8ef34
commit b0d34d23a0
No known key found for this signature in database
GPG key ID: 2AC6A5EC1C357C59

View file

@ -4689,7 +4689,7 @@ Tor project}.")
(define-public ghc-haddock (define-public ghc-haddock
(package (package
(name "ghc-haddock") (name "ghc-haddock")
(version "2.19.0.1") (version "2.22.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
@ -4699,16 +4699,15 @@ Tor project}.")
".tar.gz")) ".tar.gz"))
(sha256 (sha256
(base32 (base32
"1g1j9j0hf2yhyyh0gwz6bzbvfvliqz9x8a8hnkmwghm7w3xa6sb7")))) "1k42z2zh550rl93c8pa9cg2xsanp6wvb031xvan6cmngnplmdib6"))))
(build-system haskell-build-system) (build-system haskell-build-system)
(arguments (arguments
`(#:phases `(#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
;; There are four test suites that require the ghc-haddock-test ;; The release tarball for 2.22.0 is missing the test data for
;; package, which no longer builds with GHC 8.4.3. This phase ;; the Hoogle test, causing it to fail. This is fixed in the
;; removes these four test suites from the Cabal file, so that we ;; next release, but for now we disable it.
;; do not need ghc-haddock-test as an input. (add-before 'configure 'remove-hoogle-test
(add-before 'configure 'remove-haddock-test-test-suites
(lambda _ (lambda _
(use-modules (ice-9 rdelim)) (use-modules (ice-9 rdelim))
(with-atomic-file-replacement "haddock.cabal" (with-atomic-file-replacement "haddock.cabal"
@ -4719,17 +4718,20 @@ Tor project}.")
((string-every char-set:whitespace line) ((string-every char-set:whitespace line)
(unless deleting? (display line out)) (unless deleting? (display line out))
(loop (read-line in 'concat) #f)) (loop (read-line in 'concat) #f))
((member line '("test-suite html-test\n" ((string=? line "test-suite hoogle-test\n")
"test-suite hypsrc-test\n"
"test-suite latex-test\n"
"test-suite hoogle-test\n"))
(loop (read-line in 'concat) #t)) (loop (read-line in 'concat) #t))
(else (else
(unless deleting? (display line out)) (unless deleting? (display line out))
(loop (read-line in 'concat) deleting?))))))))))) (loop (read-line in 'concat) deleting?))))))))
(add-before 'check 'add-haddock-to-path
(lambda _
(setenv "PATH" (string-append (getcwd) "/dist/build/haddock"
":" (getenv "PATH")))
#t)))))
(inputs `(("ghc-haddock-api" ,ghc-haddock-api))) (inputs `(("ghc-haddock-api" ,ghc-haddock-api)))
(native-inputs (native-inputs
`(("ghc-hspec" ,ghc-hspec))) `(("ghc-haddock-test" ,ghc-haddock-test)
("ghc-hspec" ,ghc-hspec)))
(home-page "https://www.haskell.org/haddock/") (home-page "https://www.haskell.org/haddock/")
(synopsis (synopsis
"Documentation-generation tool for Haskell libraries") "Documentation-generation tool for Haskell libraries")
@ -4819,6 +4821,39 @@ project if you can't release often. For interacting with Haddock itself, see
the haddock package.") the haddock package.")
(license license:bsd-3))) (license license:bsd-3)))
;; This package is needed for testing 'ghc-haddock'. It is no longer
;; published to Hackage, but it is maintained in the Haddock Git
;; repository.
(define ghc-haddock-test
(package
(name "ghc-haddock-test")
(version "2.22.0")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/haskell/haddock.git")
(commit (string-append "haddock-" version "-release"))))
(file-name (git-file-name name version))
(sha256
(base32
"1ywxmqqan10gs0ppybdmdgsmvkzkpw7yirj2rw4qylg3x49a9zca"))))
(build-system haskell-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'change-directory
(lambda _
(chdir "haddock-test"))))))
(inputs
`(("ghc-syb" ,ghc-syb)
("ghc-xml" ,ghc-xml)))
(home-page "http://www.haskell.org/haddock/")
(synopsis "Test utilities for Haddock")
(description "This package provides test utilities for Haddock.")
(license license:bsd-3)
(properties '((hidden? #t)))))
(define-public ghc-half (define-public ghc-half
(package (package
(name "ghc-half") (name "ghc-half")