rakudo-2016.12.ebuild 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit java-pkg-opt-2
  5. DESCRIPTION="A compiler for the Perl 6 programming language"
  6. HOMEPAGE="http://rakudo.org"
  7. if [[ ${PV} == "9999" ]]; then
  8. EGIT_REPO_URI="https://github.com/rakudo/${PN}.git"
  9. inherit git-r3
  10. KEYWORDS=""
  11. else
  12. SRC_URI="${HOMEPAGE}/downloads/${PN}/${P}.tar.gz"
  13. KEYWORDS="~amd64 ~x86"
  14. fi
  15. LICENSE="Artistic-2"
  16. SLOT="0"
  17. # TODO: add USE="javascript" once that's usable in nqp
  18. IUSE="clang java +moar test"
  19. REQUIRED_USE="|| ( java moar )"
  20. CDEPEND="~dev-lang/nqp-${PV}:${SLOT}=[java?,moar?,clang=]"
  21. RDEPEND="${CDEPEND}
  22. java? ( >=virtual/jre-1.7 )"
  23. DEPEND="${CDEPEND}
  24. clang? ( sys-devel/clang )
  25. java? ( >=virtual/jdk-1.7 )
  26. >=dev-lang/perl-5.10"
  27. pkg_pretend() {
  28. if has_version dev-lang/rakudo; then
  29. ewarn "Rakudo is known to fail compilation/installation with Rakudo"
  30. ewarn "already being installed. So if it fails, try unmerging dev-lang/rakudo,"
  31. ewarn "then do a new installation."
  32. ewarn "(see Bug #584394)"
  33. fi
  34. }
  35. src_configure() {
  36. local backends
  37. use moar && backends+="moar,"
  38. use java && backends+="jvm"
  39. local myargs=(
  40. "--prefix=/usr"
  41. "--sysroot=/"
  42. "--sdkroot=/"
  43. "--backends=${backends}"
  44. )
  45. perl Configure.pl "${myargs[@]}" || die
  46. if use java; then
  47. NQP=$(java-pkg_getjars --with-dependencies nqp)
  48. fi
  49. }
  50. src_compile() {
  51. emake DESTDIR="${D}" NQP_JARS="${NQP}" BLD_NQP_JARS="${NQP}"
  52. }
  53. src_install() {
  54. emake DESTDIR="${D}" NQP_JARS="${NQP}" BLD_NQP_JARS="${NQP}" install
  55. }
  56. src_test() {
  57. RAKUDO_PRECOMP_PREFIX=$(mktemp -d) default
  58. }