agda-stdlib-2.4.2.5.ebuild 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. CABAL_FEATURES="bin"
  5. inherit haskell-cabal elisp-common
  6. DESCRIPTION="Agda standard library"
  7. HOMEPAGE="http://wiki.portal.chalmers.se/agda/"
  8. SRC_URI="https://github.com/agda/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  9. LICENSE="MIT"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. IUSE="profile +ffi"
  13. # filemanip is used in lib.cabal to make the GenerateEverything and
  14. # AllNonAsciiChars executables, so agda-stdlib does not require a subslot
  15. # dependency on filemanip.
  16. RDEPEND="~sci-mathematics/agda-${PV}:=[profile?]
  17. >=dev-haskell/filemanip-0.3.6.2[profile?] <dev-haskell/filemanip-0.4[profile?]
  18. >=dev-lang/ghc-6.12.1
  19. ffi? ( sci-mathematics/agda-lib-ffi )
  20. "
  21. DEPEND="${RDEPEND}
  22. >=dev-haskell/cabal-1.8.0.2
  23. "
  24. SITEFILE="50${PN}-gentoo.el"
  25. src_prepare() {
  26. cabal-mksetup
  27. eapply_user
  28. }
  29. src_compile() {
  30. haskell-cabal_src_compile
  31. "${S}"/dist/build/GenerateEverything/GenerateEverything \
  32. || die "GenerateEverything failed"
  33. local prof
  34. use profile && prof="--ghc-flag=-prof"
  35. agda +RTS -K1G -RTS ${prof} \
  36. -i "${S}" -i "${S}"/src "${S}"/Everything.agda || die
  37. # Although my agda-9999 build has
  38. # /var/tmp/portage/sci-mathematics/agda-9999/work/agda-9999/dist/build/autogen/Paths_Agda.hs
  39. # containing:
  40. # datadir = "/usr/share/agda-9999/ghc-7.6.1"
  41. # it fails without the --css option like:
  42. # /usr/share/agda-9999/ghc-7.4.1/Agda.css: copyFile: does not exist
  43. local cssdir=$(egrep 'datadir *=' "${S}/dist/build/autogen/Paths_lib.hs" | sed -e 's@datadir = \(.*\)@\1@')
  44. agda --html -i "${S}" -i "${S}"/src --css="${cssdir}/Agda.css" "${S}"/README.agda || die
  45. }
  46. src_test() {
  47. agda -i "${S}" -i "${S}"/src README.agda || die
  48. }
  49. src_install() {
  50. insinto usr/share/agda-stdlib
  51. insopts --preserve-timestamps
  52. doins -r src/*
  53. dodoc -r html/*
  54. elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
  55. }