* [gentoo-dev] ant-tasks.eclass patch proposal
@ 2019-01-18 16:11 Miroslav Šulc
2019-01-18 16:23 ` Brian Evans
0 siblings, 1 reply; 4+ messages in thread
From: Miroslav Šulc @ 2019-01-18 16:11 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 919 bytes --]
hi,
i'm preparing bump of apache ant and i found out it would be good to
clean up ant-tasks.eclass and improve it little bit. there are several
changes in the patch that i summarize below:
1) increased lowest jdk/jre version to 1.6 as that is the lowest
source/bytecode supported by jdk 11, which we are getting ready for in
the main tree (the default values are not used in any ant task ebuild
afaik, ant-1.9.2 uses 1.5, ant-1.9.13 will use 1.8)
2) at this moment we have only ant version 1.9.2 in the main tree so i
removed all the obsolete code from the eclass
3) ant-tasks_src_unpack is updated to support patching of build.xml
along with the original code that replaces build.xml with new one
that's all. i tested the updated eclass with ant-1.9.2 and ant-1.9.13
(not in tree yet, ant-1.10.5 will follow) and both compile and install
without issues. any comments or suggestions appreciated.
miroslav
[-- Attachment #2: ant-tasks.patch --]
[-- Type: text/x-patch, Size: 3619 bytes --]
diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass
index 31683e682437..567567d15a0b 100644
--- a/eclass/ant-tasks.eclass
+++ b/eclass/ant-tasks.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License, v2 or later
# @ECLASS: ant-tasks.eclass
@@ -23,15 +23,15 @@ EXPORT_FUNCTIONS src_unpack src_compile src_install
# @ECLASS-VARIABLE: ANT_TASK_JDKVER
# @DESCRIPTION:
-# Affects the >=virtual/jdk version set in DEPEND string. Defaults to 1.5, can
+# Affects the >=virtual/jdk version set in DEPEND string. Defaults to 1.6, can
# be overridden from ebuild BEFORE inheriting this eclass.
-ANT_TASK_JDKVER=${ANT_TASK_JDKVER-1.5}
+ANT_TASK_JDKVER=${ANT_TASK_JDKVER-1.6}
# @ECLASS-VARIABLE: ANT_TASK_JREVER
# @DESCRIPTION:
-# Affects the >=virtual/jre version set in DEPEND string. Defaults to 1.5, can
+# Affects the >=virtual/jre version set in DEPEND string. Defaults to 1.6, can
# be overridden from ebuild BEFORE inheriting this eclass.
-ANT_TASK_JREVER=${ANT_TASK_JREVER-1.5}
+ANT_TASK_JREVER=${ANT_TASK_JREVER-1.6}
# @ECLASS-VARIABLE: ANT_TASK_NAME
# @DESCRIPTION:
@@ -56,31 +56,18 @@ ANT_TASK_DEPNAME=${ANT_TASK_DEPNAME-${ANT_TASK_NAME}}
# Version of ant-core this task is intended to register and thus load with.
ANT_TASK_PV="${PV}"
-# special care for beta/RC releases
-if [[ ${PV} == *beta2* ]]; then
- MY_PV=${PV/_beta2/beta}
- UPSTREAM_PREFIX="http://people.apache.org/dist/ant/v1.7.1beta2/src"
- GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles"
- ANT_TASK_PV=$(ver_cut 1-3)
-elif [[ ${PV} == *_rc* ]]; then
- MY_PV=${PV/_rc/RC}
- UPSTREAM_PREFIX="https://dev.gentoo.org/~caster/distfiles"
- GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles"
- ANT_TASK_PV=$(ver_cut 1-3)
-else
- # default for final releases
- MY_PV=${PV}
- case ${PV} in
- 1.9.*)
- UPSTREAM_PREFIX="https://archive.apache.org/dist/ant/source"
- GENTOO_PREFIX="https://dev.gentoo.org/~tomwij/files/dist"
- ;;
- *)
- UPSTREAM_PREFIX="mirror://apache/ant/source"
- GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles"
- ;;
- esac
-fi
+# default for final releases
+MY_PV=${PV}
+case ${PV} in
+1.9.2)
+ UPSTREAM_PREFIX="https://archive.apache.org/dist/ant/source"
+ GENTOO_PREFIX="https://dev.gentoo.org/~tomwij/files/dist"
+ ;;
+*)
+ UPSTREAM_PREFIX="mirror://apache/ant/source"
+ GENTOO_PREFIX="https://dev.gentoo.org/~fordfrog/distfiles"
+ ;;
+esac
# source/workdir name
MY_P="apache-ant-${MY_PV}"
@@ -101,11 +88,6 @@ if [[ -z "${ANT_TASK_DISABLE_VM_DEPS}" ]]; then
DEPEND+=" >=virtual/jdk-${ANT_TASK_JDKVER}"
fi
-# we need direct blockers with old ant-tasks for file collisions - bug #252324
-if ver_test -ge 1.7.1; then
- DEPEND+=" !dev-java/ant-tasks"
-fi
-
# Would run the full ant test suite for every ant task
RESTRICT="test"
@@ -130,7 +112,11 @@ ant-tasks_src_unpack() {
cd "${S}"
# replace build.xml with our modified for split building
- mv -f "${WORKDIR}"/build.xml .
+ if [ -e "${WORKDIR}"/${PV}-build.patch ] ; then
+ epatch "${WORKDIR}"/${PV}-build.patch
+ else
+ mv -f "${WORKDIR}"/build.xml .
+ fi
cd lib
# remove bundled xerces
@@ -168,8 +154,6 @@ ant-tasks_src_install() {
java-pkg_register-ant-task --version "${ANT_TASK_PV}"
# create the compatibility symlink
- if ver_test -ge 1.7.1_beta2; then
- dodir /usr/share/ant/lib
- dosym /usr/share/${PN}/lib/${PN}.jar /usr/share/ant/lib/${PN}.jar
- fi
+ dodir /usr/share/ant/lib
+ dosym /usr/share/${PN}/lib/${PN}.jar /usr/share/ant/lib/${PN}.jar
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] ant-tasks.eclass patch proposal
2019-01-18 16:11 [gentoo-dev] ant-tasks.eclass patch proposal Miroslav Šulc
@ 2019-01-18 16:23 ` Brian Evans
2019-01-18 17:25 ` Miroslav Šulc
0 siblings, 1 reply; 4+ messages in thread
From: Brian Evans @ 2019-01-18 16:23 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 552 bytes --]
On 1/18/2019 11:11 AM, Miroslav Šulc wrote:
> @@ -130,7 +112,11 @@ ant-tasks_src_unpack() {
> cd "${S}"
>
> # replace build.xml with our modified for split building
> - mv -f "${WORKDIR}"/build.xml .
> + if [ -e "${WORKDIR}"/${PV}-build.patch ] ; then
> + epatch "${WORKDIR}"/${PV}-build.patch
Adding epatch without 'inherit epatch'? Sounds like gambling on faith.
Also limits to EAPI=6.
Brian
> + else
> + mv -f "${WORKDIR}"/build.xml .
> + fi
>
> cd lib
> # remove bundled xerces
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 834 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] ant-tasks.eclass patch proposal
2019-01-18 16:23 ` Brian Evans
@ 2019-01-18 17:25 ` Miroslav Šulc
2019-01-21 8:50 ` Miroslav Šulc
0 siblings, 1 reply; 4+ messages in thread
From: Miroslav Šulc @ 2019-01-18 17:25 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]
thank you for the comments. i added eapi check at the beginning
supporting eapi 5|6|7 (5 is needed for current ebuilds). i also changed
epatch to eapply and disabled patching build.xml for eapi5 just to make
the code more robust, build.xml patching is not used in current ebuilds
and those will be soon gone. once they are gone, this check and support
for eapi5 can both be removed. attached is the updated patch.
miroslav
Dne 18. 01. 19 v 17:23 Brian Evans napsal(a):
> On 1/18/2019 11:11 AM, Miroslav Šulc wrote:
>> @@ -130,7 +112,11 @@ ant-tasks_src_unpack() {
>> cd "${S}"
>>
>> # replace build.xml with our modified for split building
>> - mv -f "${WORKDIR}"/build.xml .
>> + if [ -e "${WORKDIR}"/${PV}-build.patch ] ; then
>> + epatch "${WORKDIR}"/${PV}-build.patch
> Adding epatch without 'inherit epatch'? Sounds like gambling on faith.
> Also limits to EAPI=6.
>
> Brian
>
>> + else
>> + mv -f "${WORKDIR}"/build.xml .
>> + fi
>>
>> cd lib
>> # remove bundled xerces
[-- Attachment #2: ant-tasks.patch --]
[-- Type: text/x-patch, Size: 4355 bytes --]
diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass
index 31683e682437..50e03aa9cfa7 100644
--- a/eclass/ant-tasks.eclass
+++ b/eclass/ant-tasks.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License, v2 or later
# @ECLASS: ant-tasks.eclass
@@ -11,27 +11,37 @@
# This eclass provides functionality and default ebuild variables for building
# dev-java/ant-* packages easily.
+case "${EAPI:-0}" in
+ 0|1|2|3|4)
+ die "ant-tasks.eclass: EAPI ${EAPI} is too old."
+ ;;
+ 5|6|7)
+ ;;
+ *)
+ die "ant-tasks.eclass: EAPI ${EAPI} is not supported yet."
+ ;;
+esac
# we set ant-core dep ourselves, restricted
JAVA_ANT_DISABLE_ANT_CORE_DEP=true
# rewriting build.xml for are the testcases has no reason atm
JAVA_PKG_BSFIX_ALL=no
inherit java-pkg-2 java-ant-2
-[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver
+[[ ${EAPI:-0} == [56] ]] && inherit eapi7-ver
EXPORT_FUNCTIONS src_unpack src_compile src_install
# @ECLASS-VARIABLE: ANT_TASK_JDKVER
# @DESCRIPTION:
-# Affects the >=virtual/jdk version set in DEPEND string. Defaults to 1.5, can
+# Affects the >=virtual/jdk version set in DEPEND string. Defaults to 1.6, can
# be overridden from ebuild BEFORE inheriting this eclass.
-ANT_TASK_JDKVER=${ANT_TASK_JDKVER-1.5}
+ANT_TASK_JDKVER=${ANT_TASK_JDKVER-1.6}
# @ECLASS-VARIABLE: ANT_TASK_JREVER
# @DESCRIPTION:
-# Affects the >=virtual/jre version set in DEPEND string. Defaults to 1.5, can
+# Affects the >=virtual/jre version set in DEPEND string. Defaults to 1.6, can
# be overridden from ebuild BEFORE inheriting this eclass.
-ANT_TASK_JREVER=${ANT_TASK_JREVER-1.5}
+ANT_TASK_JREVER=${ANT_TASK_JREVER-1.6}
# @ECLASS-VARIABLE: ANT_TASK_NAME
# @DESCRIPTION:
@@ -56,31 +66,18 @@ ANT_TASK_DEPNAME=${ANT_TASK_DEPNAME-${ANT_TASK_NAME}}
# Version of ant-core this task is intended to register and thus load with.
ANT_TASK_PV="${PV}"
-# special care for beta/RC releases
-if [[ ${PV} == *beta2* ]]; then
- MY_PV=${PV/_beta2/beta}
- UPSTREAM_PREFIX="http://people.apache.org/dist/ant/v1.7.1beta2/src"
- GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles"
- ANT_TASK_PV=$(ver_cut 1-3)
-elif [[ ${PV} == *_rc* ]]; then
- MY_PV=${PV/_rc/RC}
- UPSTREAM_PREFIX="https://dev.gentoo.org/~caster/distfiles"
- GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles"
- ANT_TASK_PV=$(ver_cut 1-3)
-else
- # default for final releases
- MY_PV=${PV}
- case ${PV} in
- 1.9.*)
- UPSTREAM_PREFIX="https://archive.apache.org/dist/ant/source"
- GENTOO_PREFIX="https://dev.gentoo.org/~tomwij/files/dist"
- ;;
- *)
- UPSTREAM_PREFIX="mirror://apache/ant/source"
- GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles"
- ;;
- esac
-fi
+# default for final releases
+MY_PV=${PV}
+case ${PV} in
+1.9.2)
+ UPSTREAM_PREFIX="https://archive.apache.org/dist/ant/source"
+ GENTOO_PREFIX="https://dev.gentoo.org/~tomwij/files/dist"
+ ;;
+*)
+ UPSTREAM_PREFIX="mirror://apache/ant/source"
+ GENTOO_PREFIX="https://dev.gentoo.org/~fordfrog/distfiles"
+ ;;
+esac
# source/workdir name
MY_P="apache-ant-${MY_PV}"
@@ -101,11 +98,6 @@ if [[ -z "${ANT_TASK_DISABLE_VM_DEPS}" ]]; then
DEPEND+=" >=virtual/jdk-${ANT_TASK_JDKVER}"
fi
-# we need direct blockers with old ant-tasks for file collisions - bug #252324
-if ver_test -ge 1.7.1; then
- DEPEND+=" !dev-java/ant-tasks"
-fi
-
# Would run the full ant test suite for every ant task
RESTRICT="test"
@@ -130,7 +122,15 @@ ant-tasks_src_unpack() {
cd "${S}"
# replace build.xml with our modified for split building
- mv -f "${WORKDIR}"/build.xml .
+ if [ -e "${WORKDIR}"/${PV}-build.patch ] ; then
+ if [ ${EAPI:-0} -eq 5 ]; then
+ die "ant-tasks.eclass: build.xml patching not supported for EAPI 5 ebuilds"
+ fi
+
+ eapply "${WORKDIR}"/${PV}-build.patch
+ else
+ mv -f "${WORKDIR}"/build.xml .
+ fi
cd lib
# remove bundled xerces
@@ -168,8 +168,6 @@ ant-tasks_src_install() {
java-pkg_register-ant-task --version "${ANT_TASK_PV}"
# create the compatibility symlink
- if ver_test -ge 1.7.1_beta2; then
- dodir /usr/share/ant/lib
- dosym /usr/share/${PN}/lib/${PN}.jar /usr/share/ant/lib/${PN}.jar
- fi
+ dodir /usr/share/ant/lib
+ dosym /usr/share/${PN}/lib/${PN}.jar /usr/share/ant/lib/${PN}.jar
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] ant-tasks.eclass patch proposal
2019-01-18 17:25 ` Miroslav Šulc
@ 2019-01-21 8:50 ` Miroslav Šulc
0 siblings, 0 replies; 4+ messages in thread
From: Miroslav Šulc @ 2019-01-21 8:50 UTC (permalink / raw
To: gentoo-dev
hi,
i just committed the changes to the eclass:
commit f14e39de0e2eaa3d3011918e9febd89bfe98f7ee (HEAD -> master,
origin/master, origin/HEAD)
Author: Miroslav Šulc <fordfrog@gentoo.org>
Date: Mon Jan 21 09:45:29 2019 +0100
ant-tasks.eclass: cleanup and improvement
1) removed obsolete code
2) increased default jdk/jre version to the lowest available
version 1.8
3) added support for patching build.xml along with the original
build.xml replacement
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
i did one minor change that was not in the patch. after chat with chewi
i increased default jdk/jre to 1.8 instead of 1.6. this change does not
affect any ebuild as all ebuilds have these values defined.
regards
miroslav
Dne 18. 01. 19 v 18:25 Miroslav Šulc napsal(a):
> thank you for the comments. i added eapi check at the beginning
> supporting eapi 5|6|7 (5 is needed for current ebuilds). i also
> changed epatch to eapply and disabled patching build.xml for eapi5
> just to make the code more robust, build.xml patching is not used in
> current ebuilds and those will be soon gone. once they are gone, this
> check and support for eapi5 can both be removed. attached is the
> updated patch.
>
> miroslav
>
> Dne 18. 01. 19 v 17:23 Brian Evans napsal(a):
>> On 1/18/2019 11:11 AM, Miroslav Šulc wrote:
>>> @@ -130,7 +112,11 @@ ant-tasks_src_unpack() {
>>> cd "${S}"
>>> # replace build.xml with our modified for split
>>> building
>>> - mv -f "${WORKDIR}"/build.xml .
>>> + if [ -e "${WORKDIR}"/${PV}-build.patch ] ; then
>>> + epatch "${WORKDIR}"/${PV}-build.patch
>> Adding epatch without 'inherit epatch'? Sounds like gambling on faith.
>> Also limits to EAPI=6.
>>
>> Brian
>>
>>> + else
>>> + mv -f "${WORKDIR}"/build.xml .
>>> + fi
>>> cd lib
>>> # remove bundled xerces
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-21 8:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-18 16:11 [gentoo-dev] ant-tasks.eclass patch proposal Miroslav Šulc
2019-01-18 16:23 ` Brian Evans
2019-01-18 17:25 ` Miroslav Šulc
2019-01-21 8:50 ` Miroslav Šulc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox