*/*: Bump copyright on files touched this year
[gentoo.git] / app-emacs / ghc-mod / ghc-mod-5.4.0.0.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 # ebuild generated by hackport 0.4.6
7
8 CABAL_FEATURES="bin 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/async:=[profile?]
23         >=dev-haskell/cabal-helper-0.6.0.0:=[profile?] <dev-haskell/cabal-helper-0.7:=[profile?]
24         >=dev-haskell/cereal-0.4:=[profile?]
25         dev-haskell/convertible:=[profile?]
26         >=dev-haskell/djinn-ghc-0.0.2.2:=[profile?]
27         >=dev-haskell/extra-1.4:2=[profile?] <dev-haskell/extra-1.5:2=[profile?]
28         >=dev-haskell/fclabels-2.0:=[profile?] <dev-haskell/fclabels-2.1:=[profile?]
29         dev-haskell/ghc-paths:=[profile?]
30         dev-haskell/ghc-syb-utils:=[profile?]
31         dev-haskell/haskell-src-exts:=[profile?]
32         >=dev-haskell/hlint-1.8.61:=[profile?]
33         >=dev-haskell/monad-control-1:=[profile?]
34         >=dev-haskell/monad-journal-0.4:=[profile?]
35         >=dev-haskell/mtl-2.0:=[profile?]
36         dev-haskell/old-time:=[profile?]
37         >=dev-haskell/pipes-4.1:=[profile?] <dev-haskell/pipes-4.2:=[profile?]
38         dev-haskell/random:=[profile?]
39         dev-haskell/split:=[profile?]
40         dev-haskell/syb:=[profile?]
41         dev-haskell/temporary:=[profile?]
42         dev-haskell/text:=[profile?]
43         dev-haskell/transformers:=[profile?]
44         dev-haskell/transformers-base:=[profile?]
45         >=dev-lang/ghc-7.4.1:=
46         emacs? ( >=app-editors/emacs-23.1:* )
47 "
48 DEPEND="${RDEPEND}
49         >=dev-haskell/cabal-1.14
50         test? ( >=dev-haskell/doctest-0.9.3
51                 dev-haskell/executable-path
52                 >=dev-haskell/hspec-2.0.0 )
53 "
54 SITEFILE=50${PN}-gentoo.el
55
56 src_prepare() {
57         epatch "${FILESDIR}"/${PN}-5.6.0.0-gentoo.patch
58 }
59
60 src_compile() {
61         haskell-cabal_src_compile
62         if use emacs ; then
63                 pushd elisp
64                 elisp-compile *.el
65                 popd
66         fi
67 }
68
69 src_install() {
70         haskell-cabal_src_install
71         if use emacs ; then
72                 pushd "${S}"
73                 elisp-install ghc-mod elisp/*.{el,elc}
74                 elisp-site-file-install "${FILESDIR}"/${SITEFILE}
75                 popd
76         fi
77 }
78
79 pkg_postinst() {
80         if use emacs ; then
81                 elisp-site-regen
82                 elog "To configure ghc-mod either add this line to ~/.emacs:"
83                 elog "(autoload 'ghc-init \"ghc\" nil t)"
84                 elog "and either this line:"
85                 elog "(add-hook 'haskell-mode-hook (lambda () (ghc-init)))"
86                 elog "or if you wish to use flymake:"
87                 elog "(add-hook 'haskell-mode-hook (lambda () (ghc-init) (flymake-mode)))"
88         fi
89 }
90
91 pkg_postrm() {
92         if use emacs ; then
93                 elisp-site-regen
94         fi
95 }