1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 inherit haskell-cabal elisp-common
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.
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}}"
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"
26 KEYWORDS="~amd64 ~x86"
29 RDEPEND=">=sci-mathematics/agda-${MY_UPSTREAM_AGDA_V}:=[profile?]
30 ffi? ( sci-mathematics/agda-lib-ffi )
33 >=dev-haskell/cabal-1.16.0
34 >=dev-haskell/filemanip-0.3.6.2[profile?] <dev-haskell/filemanip-0.4[profile?]
38 S=${WORKDIR}/${PN}-${MY_UPSTREAM_AGDA_STDLIB_V}
41 haskell-cabal_src_compile
42 "${S}"/dist/build/GenerateEverything/GenerateEverything \
43 || die "GenerateEverything failed"
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
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
59 agda -i "${S}" -i "${S}"/src README.agda || die
63 insinto usr/share/agda-stdlib
64 insopts --preserve-timestamps
67 doins "${FILESDIR}/standard-library.agda-lib"