1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils java-pkg-2 multilib
10 DESCRIPTION="Free core class libraries for use with virtual machines and compilers for the Java language"
11 SRC_URI="mirror://gnu/classpath/${MY_P}.tar.gz"
12 HOMEPAGE="https://www.gnu.org/software/classpath"
14 LICENSE="GPL-2-with-linking-exception"
16 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos"
18 IUSE="alsa debug doc dssi examples gconf +gjdoc gmp gtk gstreamer qt4 xml"
19 REQUIRED_USE="doc? ( gjdoc )"
21 RDEPEND="alsa? ( media-libs/alsa-lib )
22 dssi? ( >=media-libs/dssi-0.9 )
23 gconf? ( gnome-base/gconf:2= )
24 gjdoc? ( >=dev-java/antlr-2.7.7-r7:0 )
25 gmp? ( >=dev-libs/gmp-4.2.4:0= )
27 >=media-libs/gstreamer-0.10.10:0.10=
28 >=media-libs/gst-plugins-base-0.10.10:0.10=
32 >=x11-libs/gtk+-2.8:2=
34 media-libs/freetype:2=
35 >=x11-libs/cairo-1.1.9:=
44 qt4? ( dev-qt/qtgui:4= )
45 xml? ( >=dev-libs/libxml2-2.6.8:2= >=dev-libs/libxslt-1.1.11 )"
51 >=x11-libs/libXtst-1.1.0
57 RDEPEND=">=virtual/jre-1.5
63 epatch "${FILESDIR}"/${P}-freetype-2.5.3-support.patch
67 # We require ecj anyway, so force it to avoid problems with bad versions of javac
68 export JAVAC="${EPREFIX}/usr/bin/ecj"
69 export JAVA="${EPREFIX}/usr/bin/java"
70 # build takes care of them itself, duplicate -source -target kills ecj
71 export JAVACFLAGS="-nowarn"
72 # build system is passing -J-Xmx768M which ecj however ignores
73 # this will make the ecj launcher do it (seen case where default was not enough heap)
74 export gjl_java_args="-Xmx768M"
76 # don't use econf, because it ends up putting things under /usr, which may
77 # collide with other slots of classpath
80 local antlr=$(java-pkg_getjar antlr antlr.jar)
81 myconf="--with-antlr-jar=${antlr}"
85 # Avoid a cyclic dependency on gjdoc by building gjdoc before
86 # the docs. First we need to trick configure. Hack alert!
87 echo -e "#!/bin/sh\necho gjdoc 0.8" > tools/gjdoc.build || die
88 chmod 755 tools/gjdoc.build || die
93 $(use_enable debug ) \
94 $(use_enable examples) \
95 $(use_enable gconf gconf-peer) \
98 $(use_enable gtk gtk-peer) \
99 $(use_enable gstreamer gstreamer-peer) \
100 $(use_enable qt4 qt-peer) \
101 $(use_enable xml xmlj) \
102 $(use_enable dssi ) \
103 $(use_with doc gjdoc "${S}/tools/gjdoc.build") \
105 --disable-dependency-tracking \
108 --prefix="${EPREFIX}"/usr/${PN}-${SLOT} \
109 --with-ecj-jar=$(java-pkg_getjar --build-only eclipse-ecj-* ecj.jar) \
111 ${myconf} || die "configure failed"
116 # Build gjdoc before the docs. We need to hack the real gjdoc
117 # script to run from the build directory instead.
118 sed -r "s:^(tools_dir=).*:\1${S}/tools:" tools/gjdoc > tools/gjdoc.build || die
127 emake DESTDIR="${D}" install
128 dodoc AUTHORS BUGS ChangeLog* HACKING NEWS README THANKYOU TODO
129 java-pkg_regjar /usr/${P}/share/classpath/glibj.zip
132 # Strangely the Makefile doesn't install these.
133 insinto "/usr/${PN}-${SLOT}/share/classpath/api"
134 doins -r doc/api/html/*