/[gentoo-x86]/dev-java/ecj-gcj/ecj-gcj-3.6.ebuild
Gentoo

Contents of /dev-java/ecj-gcj/ecj-gcj-3.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun May 6 17:41:31 2012 UTC (2 years, 4 months ago) by sera
Branch: MAIN
Version bump. Import from java-overlay.

(Portage version: 2.1.10.57/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-java/ecj-gcj/ecj-gcj-3.5.2-r2.ebuild,v 1.1 2010/10/31 17:29:23 caster Exp $
4
5 EAPI=4
6
7 inherit java-pkg-2 toolchain-funcs
8
9 MY_PN="ecj"
10 DMF="R-${PV}-201006080911"
11 S="${WORKDIR}"
12
13 DESCRIPTION="A subset of Eclipse Compiler for Java compiled by gcj, serving as javac in gcj-jdk"
14 HOMEPAGE="http://www.eclipse.org/"
15 SRC_URI="http://download.eclipse.org/eclipse/downloads/drops/${DMF}/${MY_PN}src-${PV}.zip"
16
17 IUSE="+native userland_GNU"
18
19 LICENSE="EPL-1.0"
20 KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~x86"
21 SLOT="3.6"
22
23 MY_PS="${MY_PN}-${SLOT}"
24
25 # for compatibility with java eclass functions
26 JAVA_PKG_WANT_SOURCE=1.4
27 JAVA_PKG_WANT_TARGET=1.4
28
29 CDEPEND="sys-devel/gcc[gcj]
30 >=app-admin/eselect-ecj-0.6"
31 DEPEND="${CDEPEND}
32 app-arch/unzip
33 userland_GNU? ( sys-apps/findutils )
34 !dev-java/eclipse-ecj:3.5[gcj]"
35 RDEPEND="${CDEPEND}"
36
37 src_unpack() {
38 unpack ${A}
39 cd "${S}"
40
41 # We don't need the ant adapter here
42 rm -f org/eclipse/jdt/core/JDTCompilerAdapter.java || die
43 rm -fr org/eclipse/jdt/internal/antadapter || die
44
45 # upstream build.xml excludes this
46 rm -f META-INF/eclipse.inf || die
47
48 # these java6 specific classes cannot compile with ecj
49 rm -fr org/eclipse/jdt/internal/compiler/{apt,tool}/ || die
50 }
51
52 src_compile() {
53 local javac_opts javac java jar
54
55 local gccbin=$(gcc-config -B)
56 local gccver=$(gcc-fullversion)
57
58 local gcj="${gccbin}/gcj"
59 javac="${gcj} -C --encoding=ISO-8859-1"
60 jar="${gccbin}/gjar"
61 java="${gccbin}/gij"
62
63 mkdir -p bootstrap || die
64 cp -pPR org bootstrap || die
65 cd "${S}/bootstrap" || die
66
67 einfo "bootstrapping ${MY_PN} with ${javac} ..."
68 ${javac} ${javac_opts} $(find org/ -name '*.java') || die
69 find org/ -name '*.class' -o -name '*.properties' -o -name '*.rsc' |\
70 xargs ${jar} cf ${MY_PN}.jar
71
72 cd "${S}" || die
73
74 einfo "building ${MY_PN} with bootstrapped ${MY_PN} ..."
75 ${java} -classpath bootstrap/${MY_PN}.jar \
76 org.eclipse.jdt.internal.compiler.batch.Main \
77 ${javac_opts} -nowarn org || die
78 find org/ -name '*.class' -o -name '*.properties' -o -name '*.rsc' |\
79 xargs ${jar} cf ${MY_PN}.jar
80
81 if use native; then
82 einfo "Building native ${MY_PS} library, patience needed ..."
83 ${gcj} ${CFLAGS} -findirect-dispatch -shared -fPIC -Wl,-Bsymbolic \
84 -o ${MY_PS}.so ${MY_PN}.jar || die
85 fi
86 }
87
88 src_install() {
89 java-pkg_dojar ${MY_PN}.jar
90 dobin "${FILESDIR}/${PN}-${SLOT}"
91 use native && dolib.so ${MY_PS}.so
92 }
93
94 pkg_postinst() {
95 if use native; then
96 $(gcc-config -B)/gcj-dbtool -a $(gcj-dbtool -p) \
97 /usr/share/${PN}-${SLOT}/lib/ecj.jar \
98 /usr/$(get_libdir)/${MY_PN}-${SLOT}.so
99 fi
100
101 einfo "To select between slots of ECJ..."
102 einfo " # eselect ecj"
103
104 eselect ecj update ${PN}-${SLOT}
105 }
106
107 pkg_postrm() {
108 eselect ecj update
109 }

  ViewVC Help
Powered by ViewVC 1.1.20