nim-0.14.2.ebuild 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. MY_PN=Nim
  5. MY_P=${MY_PN}-${PV}
  6. DESCRIPTION="compiled, garbage-collected systems programming language"
  7. HOMEPAGE="http://nim-lang.org/"
  8. SRC_URI="http://nim-lang.org/download/${P}.tar.xz"
  9. LICENSE="MIT"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. IUSE="doc +readline test"
  13. DEPEND="
  14. readline? ( sys-libs/readline:0= )
  15. "
  16. RDEPEND="${DEPEND}"
  17. nim_use_enable() {
  18. [[ -z $2 ]] && die "usage: nim_use_enable <USE flag> <compiler flag>"
  19. use $1 && echo "-d:$2"
  20. }
  21. src_compile() {
  22. ./build.sh || die "build.sh failed"
  23. ./bin/nim c koch || die "csources nim failed"
  24. ./koch boot -d:release $(nim_use_enable readline useGnuReadline) || die "koch boot failed"
  25. if use doc; then
  26. PATH="./bin:$PATH" ./koch web || die "koch web failed"
  27. fi
  28. }
  29. src_test() {
  30. PATH="./bin:$PATH" ./koch test || die "test suite failed"
  31. }
  32. src_install() {
  33. ./koch install "${D}/usr" || die "koch install failed"
  34. rm -r "${D}/usr/nim/doc" || die "failed to remove 'doc'"
  35. dodir /usr/bin
  36. dosym ../nim/bin/nim /usr/bin/nim
  37. if use doc; then
  38. insinto /usr/share/doc/${PF}
  39. dodoc doc/*.html
  40. fi
  41. }