1 |
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
# Skeleton command:
|
5 |
|
# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri https://github.com/unicode-org/icu/archive/release-72-1.tar.gz --slot 70 --keywords "~amd64 ~arm ~arm64 ~ppc64 ~x86" --ebuild icu4j-72.1.ebuild
|
6 |
|
|
7 |
4 |
EAPI=8
|
8 |
5 |
|
9 |
6 |
JAVA_PKG_IUSE="doc source test"
|
10 |
|
MAVEN_ID="com.ibm.icu:icu4j:72.1"
|
|
7 |
MAVEN_ID="com.ibm.icu:icu4j:${PV}"
|
11 |
8 |
JAVA_TESTING_FRAMEWORKS="junit-4"
|
12 |
9 |
|
13 |
10 |
inherit java-pkg-2 java-pkg-simple
|
14 |
11 |
|
15 |
12 |
DESCRIPTION="A set of Java libraries providing Unicode and Globalization support"
|
16 |
13 |
HOMEPAGE="https://icu.unicode.org"
|
17 |
|
SRC_URI="https://github.com/unicode-org/icu/archive/refs/tags/release-${PV/./-}.tar.gz -> icu-${PV}.tar.gz"
|
|
14 |
SRC_URI="https://github.com/unicode-org/icu/archive/release-${PV/./-}.tar.gz -> icu-${PV}.tar.gz"
|
|
15 |
S="${WORKDIR}/icu-release-${PV/./-}/icu4j/main"
|
18 |
16 |
|
19 |
17 |
LICENSE="icu"
|
20 |
18 |
SLOT="70"
|
21 |
|
KEYWORDS="amd64 ~arm arm64 ppc64 x86"
|
|
19 |
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
|
22 |
20 |
|
23 |
21 |
DEPEND=">=virtual/jdk-1.8:*
|
24 |
22 |
test? ( dev-java/junitparams:0 )"
|
25 |
23 |
|
26 |
24 |
RDEPEND=">=virtual/jre-1.8:*"
|
27 |
25 |
|
28 |
|
S="${WORKDIR}/icu-release-${PV/./-}/icu4j/main"
|
|
26 |
HTML_DOCS=( ../{APIChangeReport,readme}.html )
|
29 |
27 |
|
30 |
|
HTML_DOCS=( ../{APIChangeReport,license,readme}.html )
|
|
28 |
PATCHES=(
|
|
29 |
"${FILESDIR}/icu4j-73.2-DateFormatTest.patch"
|
|
30 |
)
|
31 |
31 |
|
32 |
|
JAVA_GENTOO_CLASSPATH_EXTRA="icu4j.jar:icu4j-charset.jar:icu4j-localespi.jar:testdata.jar:framework.jar"
|
33 |
|
JAVA_TEST_GENTOO_CLASSPATH="junit-4,junitparams"
|
|
32 |
JAVA_TEST_EXCLUDES=(
|
|
33 |
# Invalid tests, not run by maven
|
|
34 |
"com.ibm.icu.dev.data.TestDataElements_testtypes"
|
|
35 |
"com.ibm.icu.dev.data.resources.TestDataElements_en_Latn_US"
|
|
36 |
"com.ibm.icu.dev.data.resources.TestDataElements_en_US"
|
|
37 |
"com.ibm.icu.dev.data.resources.TestDataElements_fr_Latn_FR"
|
|
38 |
"com.ibm.icu.dev.data.resources.TestDataElements_te"
|
|
39 |
"com.ibm.icu.dev.data.resources.TestMessages"
|
|
40 |
"com.ibm.icu.dev.test.ModuleTest"
|
|
41 |
"com.ibm.icu.dev.test.TestBoilerplate"
|
|
42 |
"com.ibm.icu.dev.test.TestDataModule"
|
|
43 |
"com.ibm.icu.dev.test.bidi.TestData"
|
|
44 |
"com.ibm.icu.dev.test.calendar.ChineseTestCase"
|
|
45 |
"com.ibm.icu.dev.test.calendar.TestCase"
|
|
46 |
"com.ibm.icu.dev.test.format.ExhaustivePersonNameFormatterTest"
|
|
47 |
"com.ibm.icu.dev.test.localespi.TestUtil"
|
|
48 |
"com.ibm.icu.dev.test.message2.TestCase"
|
|
49 |
"com.ibm.icu.dev.test.stringprep.TestData"
|
|
50 |
"com.ibm.icu.dev.test.translit.TestUtility"
|
|
51 |
# Maven: [INFO] Tests run: 364, Failures: 0, Errors: 0, Skipped: 0
|
|
52 |
"com.ibm.icu.dev.test.serializable.CompatibilityTest" # Tests run: 364, Failures: 4
|
|
53 |
# Maven: [INFO] Tests run: 90, Failures: 0, Errors: 0, Skipped: 0
|
|
54 |
"com.ibm.icu.dev.test.serializable.CoverageTest" # Tests run: 99, Failures: 9
|
|
55 |
# Following tests need to run separately:
|
|
56 |
com.ibm.icu.dev.test.calendar.CalendarRegressionTest
|
|
57 |
com.ibm.icu.dev.test.calendar.CompatibilityTest
|
|
58 |
com.ibm.icu.dev.test.calendar.DataDrivenCalendarTest
|
|
59 |
com.ibm.icu.dev.test.calendar.HolidayTest
|
|
60 |
com.ibm.icu.dev.test.calendar.IndianTest
|
|
61 |
com.ibm.icu.dev.test.calendar.IslamicTest
|
|
62 |
com.ibm.icu.dev.test.calendar.JapaneseTest
|
|
63 |
com.ibm.icu.dev.test.format.DataDrivenFormatTest
|
|
64 |
com.ibm.icu.dev.test.format.DateFormatRegressionTest
|
|
65 |
com.ibm.icu.dev.test.format.DateFormatRoundTripTest
|
|
66 |
com.ibm.icu.dev.test.format.DateIntervalFormatTest
|
|
67 |
com.ibm.icu.dev.test.format.DateTimeGeneratorTest
|
|
68 |
com.ibm.icu.dev.test.format.TestMessageFormat
|
|
69 |
com.ibm.icu.dev.test.message2.MessageFormat2Test
|
|
70 |
com.ibm.icu.dev.test.message2.Mf2FeaturesTest
|
|
71 |
com.ibm.icu.dev.test.message2.Mf2IcuTest
|
|
72 |
com.ibm.icu.dev.test.timezone.TimeZoneBoundaryTest
|
|
73 |
com.ibm.icu.dev.test.util.CurrencyTest
|
|
74 |
)
|
34 |
75 |
JAVA_TEST_EXTRA_ARGS="-Djava.locale.providers=CLDR,COMPAT,SPI"
|
35 |
|
|
|
76 |
JAVA_TEST_GENTOO_CLASSPATH="junit-4,junitparams"
|
|
77 |
JAVA_TEST_RESOURCE_DIRS=(
|
|
78 |
tests/res/collate/src
|
|
79 |
tests/res/core/src
|
|
80 |
tests/res/translit/src
|
|
81 |
)
|
36 |
82 |
JAVA_TEST_SRC_DIR=(
|
37 |
83 |
tests/charset/src
|
38 |
84 |
tests/collate/src
|
39 |
85 |
tests/core/src
|
40 |
|
# tests/framework/src # we compile it in src_compile
|
41 |
86 |
tests/localespi/src
|
42 |
87 |
tests/packaging/src
|
43 |
88 |
tests/translit/src
|
44 |
89 |
)
|
45 |
90 |
|
46 |
|
JAVA_TEST_RESOURCE_DIRS=(
|
47 |
|
tests/charset/resources
|
48 |
|
tests/collate/resources
|
49 |
|
tests/core/resources
|
50 |
|
# tests/framework/resources
|
51 |
|
tests/localespi/resources
|
52 |
|
tests/packaging/resources
|
53 |
|
tests/translit/resources
|
54 |
|
)
|
55 |
|
|
56 |
|
JAVA_TEST_EXCLUDES=(
|
57 |
|
"com.ibm.icu.dev.data.TestDataElements_testtypes" # Invalid test class 1. No runnable methods
|
58 |
|
"com.ibm.icu.dev.data.resources.TestDataElements_en_Latn_US" # Invalid test class 1. No runnable methods
|
59 |
|
"com.ibm.icu.dev.data.resources.TestDataElements_en_US" # Invalid test class 1. No runnable methods
|
60 |
|
"com.ibm.icu.dev.data.resources.TestDataElements_fr_Latn_FR" # Invalid test class 1. No runnable methods
|
61 |
|
"com.ibm.icu.dev.data.resources.TestDataElements_te" # Invalid test class 1. No runnable methods
|
62 |
|
"com.ibm.icu.dev.data.resources.TestMessages" # Invalid test class 1. No runnable methods
|
63 |
|
"com.ibm.icu.dev.test.translit.TestUtility" # Invalid test class 1. No runnable methods
|
64 |
|
"com.ibm.icu.dev.test.localespi.TestUtil" # Invalid test class 1. No runnable methods
|
65 |
|
"com.ibm.icu.dev.test.stringprep.TestData" # Invalid test class 1. No runnable methods
|
66 |
|
"com.ibm.icu.dev.test.calendar.ChineseTestCase" # Invalid test class 1. Test class should have exactly one public zero-argument constructor
|
67 |
|
"com.ibm.icu.dev.test.calendar.TestCase" # java.lang.IllegalArgumentException: Test class can only have one constructor
|
68 |
|
"com.ibm.icu.dev.test.message2.TestCase" # Invalid test class - No runnable methods
|
69 |
|
"com.ibm.icu.dev.test.bidi.TestData" # Invalid test class 1. Test class should have exactly one public constructor
|
70 |
|
# following kills 98 tests and and avoids 9 test failures
|
71 |
|
# coverage tests fail because test handlers for the parametrized tests are not defined so the tests are broken and cannot succeed
|
72 |
|
"com.ibm.icu.dev.test.serializable.CoverageTest"
|
73 |
|
)
|
74 |
|
|
75 |
91 |
src_prepare() {
|
76 |
|
default
|
|
92 |
default #780585
|
|
93 |
java-pkg_clean ! -path "./shared/data/*" # keep icudata.jar, icutzdata.jar, testdata.jar
|
|
94 |
java-pkg-2_src_prepare
|
|
95 |
|
|
96 |
# java-pkg-simple.eclass wants resources in JAVA_RESOURCE_DIRS
|
|
97 |
mkdir -p resources || die
|
|
98 |
|
|
99 |
pushd classes > /dev/null || die
|
|
100 |
find -type f \
|
|
101 |
! -name '*.java' \
|
|
102 |
! -name 'license.html' \
|
|
103 |
| xargs cp --parent -t ../resources || die
|
|
104 |
popd > /dev/null || die
|
77 |
105 |
|
78 |
|
# create the resources directories
|
79 |
|
mkdir resources || die
|
80 |
|
cp -r classes/* resources || die
|
81 |
|
|
82 |
|
# remove .java files from resources
|
83 |
|
find resources -type f -name '*.java' -exec rm -rf {} + || die "deleting classes failed"
|
84 |
|
|
85 |
|
# this should not go in the jar files
|
86 |
|
mv shared/licenses/license.html .. || die
|
87 |
|
|
88 |
|
# icudata and icutzdata for "icu4j.jar"
|
89 |
|
pushd resources/core/src || die
|
|
106 |
pushd resources/core/src > /dev/null || die
|
|
107 |
# icudata and icutzdata for "icu4j.jar"
|
90 |
108 |
jar -xf "${S}"/shared/data/icudata.jar || die
|
91 |
109 |
jar -xf "${S}"/shared/data/icutzdata.jar || die
|
92 |
110 |
# move these resources to "icu4j-charset.jar"
|
... | ... | |
99 |
117 |
ls -1 $dir/*.res | sed -e 's%.*\/%%' -e 's%\..*$%%' -e '/pool/d' -e '/res_index/d' -e '/tzdbNames/d'\
|
100 |
118 |
> $dir/'fullLocaleNames.lst';
|
101 |
119 |
done || die "fullLocaleNames.lst failed"
|
102 |
|
popd
|
|
120 |
popd > /dev/null || die
|
|
121 |
|
|
122 |
if use test; then
|
|
123 |
# initializationError(com.ibm.icu.dev.data.resources.TestDataElements)
|
|
124 |
# but test_excluding it would kill tousands of other tests.
|
|
125 |
mkdir -p tests/framework/src/com/ibm/icu/dev/data/resources || die
|
|
126 |
mv tests/{core,framework}/src/com/ibm/icu/dev/data/resources/TestDataElements.java || die
|
|
127 |
|
|
128 |
# Separate tests resources
|
|
129 |
mkdir tests/res || die
|
|
130 |
pushd tests > /dev/null || die
|
|
131 |
find -type f \
|
|
132 |
! -name '*.java' \
|
|
133 |
| xargs cp --parent -t res || die
|
|
134 |
popd > /dev/null || die
|
103 |
135 |
|
104 |
|
# this test class was failing with "No runnable methods"
|
105 |
|
# but test_excluding it would kill tousands of other tests.
|
106 |
|
mkdir -p tests/framework/src/com/ibm/icu/dev/data/resources || die
|
107 |
|
mv tests/{core,framework}/src/com/ibm/icu/dev/data/resources/TestDataElements.java || die
|
108 |
|
|
109 |
|
# testdata.jar needs to be on classpath
|
110 |
|
cp shared/data/testdata.jar . || die
|
111 |
|
|
112 |
|
# clone tests src
|
113 |
|
for i in charset collate core framework localespi packaging translit; do
|
114 |
|
cp -r tests/$i/{src,resources};
|
115 |
|
done || die "copying tests from src to resources failed"
|
116 |
|
cp -r ../tools/misc/{src,resources} || die
|
117 |
|
|
118 |
|
# separate tests resources from tests src
|
119 |
|
find tests/*/resources -type f -name '*.java' -exec rm -rf {} + || die
|
120 |
|
find ../tools/misc/resources -type f -name '*.java' -exec rm -rf {} + || die
|
|
136 |
cp -r ../tools/misc/{src,resources} || die
|
|
137 |
find ../tools/misc/resources -type f -name '*.java' -exec rm -rf {} + || die
|
|
138 |
fi
|
121 |
139 |
}
|
122 |
140 |
|
123 |
141 |
src_compile() {
|
124 |
142 |
einfo "Compiling icu4j.jar"
|
|
143 |
JAVA_AUTOMATIC_MODULE_NAME="com.ibm.icu"
|
|
144 |
JAVA_JAR_FILENAME="icu4j.jar"
|
|
145 |
JAVA_MAIN_CLASS="com.ibm.icu.util.VersionInfo"
|
|
146 |
JAVA_RESOURCE_DIRS="resources/core/src"
|
125 |
147 |
JAVA_SRC_DIR=(
|
126 |
148 |
classes/collate/src
|
127 |
149 |
classes/core/src
|
... | ... | |
130 |
152 |
classes/regiondata/src
|
131 |
153 |
classes/translit/src
|
132 |
154 |
)
|
133 |
|
JAVA_RESOURCE_DIRS=(
|
134 |
|
resources/collate/src
|
135 |
|
resources/core/src
|
136 |
|
resources/currdata/src
|
137 |
|
resources/langdata/src
|
138 |
|
resources/regiondata/src
|
139 |
|
resources/translit/src
|
140 |
|
shared/licenses
|
141 |
|
)
|
142 |
|
JAVA_AUTOMATIC_MODULE_NAME="com.ibm.icu"
|
143 |
|
JAVA_JAR_FILENAME="icu4j.jar"
|
144 |
|
JAVA_MAIN_CLASS="com.ibm.icu.util.VersionInfo"
|
145 |
155 |
java-pkg-simple_src_compile
|
|
156 |
JAVA_GENTOO_CLASSPATH_EXTRA+=":icu4j.jar"
|
146 |
157 |
rm -r target || die
|
147 |
158 |
|
148 |
159 |
einfo "Compiling icu4j-charset.jar"
|
149 |
160 |
JAVA_AUTOMATIC_MODULE_NAME="com.ibm.icu.charset"
|
150 |
161 |
JAVA_JAR_FILENAME="icu4j-charset.jar"
|
151 |
162 |
JAVA_MAIN_CLASS=""
|
152 |
|
JAVA_RESOURCE_DIRS=( resources/charset/src shared/licenses )
|
|
163 |
JAVA_RESOURCE_DIRS="resources/charset/src"
|
153 |
164 |
JAVA_SRC_DIR=( classes/charset/src )
|
154 |
165 |
java-pkg-simple_src_compile
|
|
166 |
JAVA_GENTOO_CLASSPATH_EXTRA+=":icu4j-charset.jar"
|
155 |
167 |
rm -r target || die
|
156 |
168 |
|
157 |
169 |
einfo "Compiling icu4j-localespi.jar"
|
158 |
170 |
JAVA_AUTOMATIC_MODULE_NAME="com.ibm.icu.localespi"
|
159 |
171 |
JAVA_JAR_FILENAME="icu4j-localespi.jar"
|
160 |
|
JAVA_RESOURCE_DIRS=( resources/localespi/src shared/licenses )
|
|
172 |
JAVA_RESOURCE_DIRS="resources/localespi/src"
|
161 |
173 |
JAVA_SRC_DIR=( classes/localespi/src )
|
162 |
174 |
java-pkg-simple_src_compile
|
|
175 |
JAVA_GENTOO_CLASSPATH_EXTRA+=":icu4j-localespi.jar"
|
163 |
176 |
rm -r target || die
|
164 |
177 |
|
165 |
178 |
# main/test/framework
|
... | ... | |
167 |
180 |
# but "No runnable methods" ("Invalid test class")
|
168 |
181 |
if use test; then
|
169 |
182 |
JAVA_JAR_FILENAME="framework.jar"
|
170 |
|
JAVA_RESOURCE_DIRS=( tests/framework/resources ../tools/misc/resources )
|
|
183 |
JAVA_RESOURCE_DIRS=( tests/res/framework/src ../tools/misc/resources )
|
171 |
184 |
JAVA_SRC_DIR=( tests/framework/src ../tools/misc/src )
|
172 |
185 |
java-pkg-simple_src_compile
|
173 |
186 |
rm -fr target || die
|
... | ... | |
182 |
195 |
}
|
183 |
196 |
|
184 |
197 |
src_test () {
|
185 |
|
# https://bugs.gentoo.org/827212
|
|
198 |
JAVA_GENTOO_CLASSPATH_EXTRA+=":framework.jar:shared/data/testdata.jar"
|
|
199 |
|
|
200 |
JAVA_TEST_RUN_ONLY=(
|
|
201 |
com.ibm.icu.dev.test.rbbi.AbstractBreakIteratorTests
|
|
202 |
com.ibm.icu.dev.test.calendar.CalendarRegressionTest
|
|
203 |
com.ibm.icu.dev.test.calendar.CompatibilityTest
|
|
204 |
com.ibm.icu.dev.test.calendar.DataDrivenCalendarTest
|
|
205 |
com.ibm.icu.dev.test.calendar.HolidayTest
|
|
206 |
com.ibm.icu.dev.test.calendar.IndianTest
|
|
207 |
com.ibm.icu.dev.test.calendar.IslamicTest
|
|
208 |
com.ibm.icu.dev.test.calendar.JapaneseTest
|
|
209 |
com.ibm.icu.dev.test.format.DataDrivenFormatTest
|
|
210 |
com.ibm.icu.dev.test.format.DateFormatRegressionTest
|
|
211 |
com.ibm.icu.dev.test.format.DateFormatRoundTripTest
|
|
212 |
com.ibm.icu.dev.test.format.DateIntervalFormatTest
|
|
213 |
com.ibm.icu.dev.test.format.DateTimeGeneratorTest
|
|
214 |
com.ibm.icu.dev.test.format.TestMessageFormat
|
|
215 |
com.ibm.icu.dev.test.message2.MessageFormat2Test
|
|
216 |
com.ibm.icu.dev.test.message2.Mf2FeaturesTest
|
|
217 |
com.ibm.icu.dev.test.message2.Mf2IcuTest
|
|
218 |
com.ibm.icu.dev.test.timezone.TimeZoneBoundaryTest
|
|
219 |
com.ibm.icu.dev.test.util.CurrencyTest
|
|
220 |
)
|
|
221 |
java-pkg-simple_src_test
|
|
222 |
|
|
223 |
JAVA_TEST_RUN_ONLY=()
|
|
224 |
# ../maven-build/maven-icu4j-localespi/pom.xml#L133-L143
|
186 |
225 |
local vm_version="$(java-config -g PROVIDES_VERSION)"
|
187 |
226 |
if [[ "${vm_version}" != "1.8" ]] ; then
|
188 |
227 |
java-pkg-simple_src_test
|