1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 # Don't depend on itself.
7 JAVA_ANT_DISABLE_ANT_CORE_DEP="true"
9 # Rewriting build.xml files for the testcases has no use at the moment.
10 JAVA_PKG_BSFIX_ALL="no"
11 JAVA_PKG_IUSE="doc source"
13 inherit eutils java-pkg-2 java-ant-2 prefix eapi7-ver
15 MY_P="apache-ant-${PV}"
17 DESCRIPTION="Java-based build tool similar to 'make' that uses XML configuration files"
18 HOMEPAGE="https://ant.apache.org/"
19 SRC_URI="https://archive.apache.org/dist/ant/source/${MY_P}-src.tar.bz2
20 https://dev.gentoo.org/~fordfrog/distfiles/ant-${PV}-r1-gentoo.tar.bz2"
24 KEYWORDS="amd64 ~arm ~arm64 ppc64 x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
26 DEPEND=">=virtual/jdk-1.8:*
28 !dev-java/ant-optional"
31 S="${WORKDIR}/${MY_P}"
36 epatch "${WORKDIR}/${PV}-build.patch"
37 epatch "${WORKDIR}/${PV}-launch.patch"
39 eprefixify "${S}/src/script/ant"
42 java-ant_xml-rewrite -f build.xml \
47 # See bug #196080 for more details.
48 java-ant_bsfix_one build.xml
49 java-pkg-2_src_prepare
54 # Avoid error message that package ant-core was not found
55 export ANT_TASKS="none"
59 # This ensures that when building ant with bootstrapped ant,
60 # only the source is used for resolving references, and not
61 # the classes in bootstrapped ant but jikes in kaffe has issues with this...
62 if ! java-pkg_current-vm-matches kaffe; then
63 bsyscp="-Dbuild.sysclasspath=ignore"
66 CLASSPATH="$(java-config -t)" ./build.sh ${bsyscp} jars dist-internal \
67 $(use_doc javadocs) || die "build failed"
71 dodir /usr/share/ant/lib
73 for jar in ant.jar ant-bootstrap.jar ant-launcher.jar ; do
74 java-pkg_dojar build/lib/${jar}
75 dosym ../../${PN}/lib/${jar} /usr/share/ant/lib/${jar}
80 dodir /usr/share/${PN}/bin
81 for each in antRun antRun.pl runant.pl runant.py ; do
82 dobin "${S}/src/script/${each}"
83 dosym ../../../bin/${each} /usr/share/${PN}/bin/${each}
85 dosym ../${PN}/bin /usr/share/ant/bin
87 insinto /usr/share/${PN}
89 dosym ../${PN}/etc /usr/share/ant/etc
91 echo "ANT_HOME=\"${EPREFIX}/usr/share/ant\"" > "${T}/20ant"
94 dodoc NOTICE README WHATSNEW KEYS
98 java-pkg_dojavadoc --symlink manual/api build/javadocs
101 use source && java-pkg_dosrc src/main/*