*/*: Bump copyright on files touched this year
[gentoo.git] / app-emacs / ghc-mod / ghc-mod-5.7.0.0.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 # ebuild generated by hackport 0.5.1.9999
7
8 CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite"
9 inherit elisp-common haskell-cabal
10
11 DESCRIPTION="Happy Haskell Programming"
12 HOMEPAGE="http://www.mew.org/~kazu/proj/ghc-mod/"
13 SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"
14
15 LICENSE="AGPL-3"
16 SLOT="0/${PV}"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="emacs"
19
20 RESTRICT=test # doctests break on modules collisions: temporary / temporary-rc
21
22 RDEPEND=">=dev-haskell/cabal-helper-0.7.3.0:=[profile?] <dev-haskell/cabal-helper-0.8:=[profile?]
23         >=dev-haskell/djinn-ghc-0.0.2.2:=[profile?] <dev-haskell/djinn-ghc-0.1:=[profile?]
24         >=dev-haskell/extra-1.4.0:=[profile?] <dev-haskell/extra-1.6:=[profile?]
25         >=dev-haskell/fclabels-2.0:=[profile?] <dev-haskell/fclabels-2.1:=[profile?]
26         >=dev-haskell/ghc-paths-0.1.0.9:=[profile?] <dev-haskell/ghc-paths-0.2:=[profile?]
27         >=dev-haskell/ghc-syb-utils-0.2.3:=[profile?] <dev-haskell/ghc-syb-utils-0.3:=[profile?]
28         >=dev-haskell/haskell-src-exts-1.16.0.1:=[profile?] <dev-haskell/haskell-src-exts-1.19:=[profile?]
29         >=dev-haskell/hlint-1.9.27:=[profile?] <dev-haskell/hlint-1.10:=[profile?]
30         >=dev-haskell/monad-control-1:=[profile?] <dev-haskell/monad-control-1.1:=[profile?]
31         >=dev-haskell/monad-journal-0.4:=[profile?] <dev-haskell/monad-journal-0.8:=[profile?]
32         >=dev-haskell/mtl-2.0:=[profile?] <dev-haskell/mtl-2.3:=[profile?]
33         <dev-haskell/old-time-1.2:=[profile?]
34         >=dev-haskell/optparse-applicative-0.11.0:=[profile?] <dev-haskell/optparse-applicative-0.14.0:=[profile?]
35         >=dev-haskell/pipes-4.1.0:=[profile?] <dev-haskell/pipes-4.4:=[profile?]
36         >=dev-haskell/safe-0.3.9:=[profile?] <dev-haskell/safe-0.4:=[profile?]
37         >=dev-haskell/semigroups-0.10.0:=[profile?] <dev-haskell/semigroups-0.19:=[profile?]
38         >=dev-haskell/split-0.2.2:=[profile?] <dev-haskell/split-0.3:=[profile?]
39         >=dev-haskell/syb-0.5.1:=[profile?] <dev-haskell/syb-0.7:=[profile?]
40         >=dev-haskell/temporary-1.2.0.3:=[profile?] <dev-haskell/temporary-1.3:=[profile?]
41         >=dev-haskell/text-1.2.1.3:=[profile?] <dev-haskell/text-1.3:=[profile?]
42         >=dev-haskell/transformers-base-0.4.4:=[profile?] <dev-haskell/transformers-base-0.5:=[profile?]
43         >=dev-lang/ghc-7.8.2:=
44         emacs? ( >=app-editors/emacs-23.1:* )
45 "
46 DEPEND="${RDEPEND}
47         >=dev-haskell/cabal-1.18.1.3 <dev-haskell/cabal-1.25
48         test? ( >=dev-haskell/doctest-0.9.3 <dev-haskell/doctest-0.12
49                 >=dev-haskell/hspec-2.0.0 <dev-haskell/hspec-2.4 )
50 "
51 SITEFILE=50${PN}-gentoo.el
52
53 PATCHES=("${FILESDIR}"/${PN}-5.6.0.0-gentoo.patch)
54
55 src_compile() {
56         haskell-cabal_src_compile
57         if use emacs ; then
58                 pushd elisp
59                 elisp-compile *.el
60                 popd
61         fi
62 }
63
64 src_install() {
65         haskell-cabal_src_install
66         if use emacs ; then
67                 pushd "${S}"
68                 elisp-install ghc-mod elisp/*.{el,elc}
69                 elisp-site-file-install "${FILESDIR}"/${SITEFILE}
70                 popd
71         fi
72 }
73
74 pkg_postinst() {
75         haskell-cabal_pkg_postinst
76         if use emacs ; then
77                 elisp-site-regen
78                 elog "To configure ghc-mod either add this line to ~/.emacs:"
79                 elog "(autoload 'ghc-init \"ghc\" nil t)"
80                 elog "and either this line:"
81                 elog "(add-hook 'haskell-mode-hook (lambda () (ghc-init)))"
82                 elog "or if you wish to use flymake:"
83                 elog "(add-hook 'haskell-mode-hook (lambda () (ghc-init) (flymake-mode)))"
84         fi
85 }
86
87 pkg_postrm() {
88         haskell-cabal_pkg_postrm
89         if use emacs ; then
90                 elisp-site-regen
91         fi
92 }