dev-python/elementpath: arm64 stable (bug #723996)
[gentoo.git] / sci-mathematics / agda-stdlib / agda-stdlib-2.5.2.0.13.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 CABAL_FEATURES="bin"
7 inherit haskell-cabal elisp-common
8
9 ## shared with sci-mathematics/agda
10 # upstream does not maintain version ordering:
11 #  https://github.com/agda/agda-stdlib/releases
12 # 0.11 -> 2.5.0.20160213 -> 2.5.0.20160412 -> 0.12 -> 0.13
13 # As Agda-stdlib is tied to Agda version we encode
14 # both versions in gentoo version.
15 ##
16 MY_UPSTREAM_AGDA_STDLIB_V="0.13"
17 MY_GENTOO_AGDA_STDLIB_V="${PV}.${MY_UPSTREAM_AGDA_STDLIB_V}"
18 MY_UPSTREAM_AGDA_V="${PV%.${MY_UPSTREAM_AGDA_STDLIB_V}}"
19
20 DESCRIPTION="Agda standard library"
21 HOMEPAGE="https://wiki.portal.chalmers.se/agda/"
22 SRC_URI="https://github.com/agda/${PN}/archive/v${MY_UPSTREAM_AGDA_STDLIB_V}.tar.gz -> ${P}.tar.gz"
23
24 LICENSE="MIT"
25 SLOT="0"
26 KEYWORDS="~amd64 ~x86"
27 IUSE="profile +ffi"
28
29 RDEPEND=">=sci-mathematics/agda-${MY_UPSTREAM_AGDA_V}:=[profile?]
30         ffi? ( sci-mathematics/agda-lib-ffi )
31 "
32 DEPEND="${RDEPEND}
33         >=dev-haskell/cabal-1.16.0
34         >=dev-haskell/filemanip-0.3.6.2[profile?] <dev-haskell/filemanip-0.4[profile?]
35         >=dev-lang/ghc-7.6.3
36 "
37
38 S=${WORKDIR}/${PN}-${MY_UPSTREAM_AGDA_STDLIB_V}
39
40 src_compile() {
41         haskell-cabal_src_compile
42         "${S}"/dist/build/GenerateEverything/GenerateEverything \
43                 || die "GenerateEverything failed"
44         local prof
45         use profile && prof="--ghc-flag=-prof"
46         agda +RTS -K1G -RTS ${prof} \
47                 -i "${S}" -i "${S}"/src "${S}"/Everything.agda || die
48         # Although my agda-9999 build has
49         # /var/tmp/portage/sci-mathematics/agda-9999/work/agda-9999/dist/build/autogen/Paths_Agda.hs
50         # containing:
51         # datadir    = "/usr/share/agda-9999/ghc-7.6.1"
52         # it fails without the --css option like:
53         # /usr/share/agda-9999/ghc-7.4.1/Agda.css: copyFile: does not exist
54         local cssdir=$(egrep 'datadir *=' "${S}/dist/build/autogen/Paths_lib.hs" | sed -e 's@datadir    = \(.*\)@\1@')
55         agda --html -i "${S}" -i "${S}"/src --css="${cssdir}/Agda.css" "${S}"/README.agda || die
56 }
57
58 src_test() {
59         agda -i "${S}" -i "${S}"/src README.agda || die
60 }
61
62 src_install() {
63         insinto usr/share/agda-stdlib
64         insopts --preserve-timestamps
65         doins -r src/*
66         dodoc -r html/*
67         doins "${FILESDIR}/standard-library.agda-lib"
68 }