dev-haskell/*: drop alpha keywords
[gentoo.git] / dev-haskell / alex / alex-3.2.4.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.6.9999
7 #hackport: flags: +small_base
8
9 CABAL_FEATURES="test-suite"
10 inherit autotools haskell-cabal
11
12 DESCRIPTION="Alex is a tool for generating lexical analysers in Haskell"
13 HOMEPAGE="http://www.haskell.org/alex/"
14 SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"
15
16 LICENSE="BSD"
17 SLOT="0"
18 KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
19 IUSE="doc"
20
21 RDEPEND=">=dev-lang/ghc-7.4.1:="
22 DEPEND="${RDEPEND}
23         >=dev-haskell/cabal-1.8
24         doc? ( ~app-text/docbook-xml-dtd-4.2
25                 app-text/docbook-xsl-stylesheets
26                 >=dev-libs/libxslt-1.1.2 )
27 "
28
29 src_prepare() {
30         default
31
32         if use doc; then
33                 cd "${S}/doc/"
34                 eautoreconf
35         fi
36 }
37 src_configure() {
38         # make sure we don't accidentally use those
39         # installed in system
40         haskell-cabal_src_configure \
41                 --with-alex=false \
42                 --with-happy=false \
43                 --flag=small_base
44
45         if use doc; then
46                 cd "${S}/doc/"
47                 econf
48         fi
49 }
50
51 src_compile() {
52         haskell-cabal_src_compile
53
54         if use doc; then
55                 emake -C "${S}/doc/" -j1
56         fi
57 }
58
59 src_test() {
60         # 1. workaround Setup.hs deadlock: https://github.com/haskell/cabal/issues/2398
61         # 2. use freshly built ALEX= binary and datadir path
62         alex_datadir="${S}"/data \
63         emake -k -C tests all ALEX="${S}"/dist/build/alex/alex
64 }
65
66 src_install() {
67         haskell-cabal_src_install
68
69         if use doc; then
70                 doman "${S}/doc/alex.1"
71                 dohtml -r "${S}/doc/alex/"
72         fi
73 }