[gentoo-dev] [PATCH 4/4] java-utils-2.eclass: avoid reverse dependency for dev-java/testng
This change depends on the correlating change on the java-pkg-simple.eclass. For testing dev-java/testng before having it installed it is not possible to use java-pkg_getjars. This change adds a condition so that this case uses the freshly compiled testng.jar. Signed-off-by: Volkmar W. Pogatzki --- eclass/java-utils-2.eclass | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass index 3fe64e1c317d..133dde59cebd 100644 --- a/eclass/java-utils-2.eclass +++ b/eclass/java-utils-2.eclass @@ -1892,7 +1892,11 @@ etestng() { debug-print-function ${FUNCNAME} $* local runner=org.testng.TestNG - local cp=$(java-pkg_getjars --with-dependencies testng) + if [[ ${PN} != testng ]]; then + local cp=$(java-pkg_getjars --with-dependencies testng) + else + local cp=testng.jar + fi local tests if [[ ${1} = -cp || ${1} = -classpath ]]; then -- 2.41.0
[gentoo-dev] [PATCH 3/4] java-pkg-simple.eclass: avoid reverse dependency for dev-java/testng
Presently, when using testng in JAVA_TESTING_FRAMEWORKS, it gets added to test dependencies. Emerging dev-java/testng with USE=test would lead to a reverse dependency on itself. This change allows emerging / testing testng with the ebuild specifying JAVA_TESTING_FRAMEWORKS="testng" without such reverse dependency. Signed-off-by: Volkmar W. Pogatzki --- eclass/java-pkg-simple.eclass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass index abac18ca03f8..0ca0914aeee0 100644 --- a/eclass/java-pkg-simple.eclass +++ b/eclass/java-pkg-simple.eclass @@ -1,4 +1,4 @@ -# Copyright 2004-2022 Gentoo Authors +# Copyright 2004-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: java-pkg-simple.eclass @@ -47,7 +47,8 @@ if has test ${JAVA_PKG_IUSE}; then test_deps+=" amd64? ( dev-util/pkgdiff dev-util/japi-compliance-checker )";; testng) - test_deps+=" dev-java/testng:0";; + [[ ${PN} != testng ]] && \ + test_deps+=" dev-java/testng:0";; esac done [[ ${test_deps} ]] && DEPEND="test? ( ${test_deps} )" -- 2.41.0
[gentoo-dev] [PATCH 2/4] dev-java/testng: add 6.11
- switches slot of dependency assertj-core 2 -> 3 - removes test restriction - moves "test" from IUSE to JAVA_PKG_IUSE - sets the "-verbose 3" option to get the PASSED/FAILED information - uses older version of jcommander 0 -> 1.64 - uses the DOCS array instead of dodoc - uses JAVA_RESOURCE_DIRS instead of java-pkg_addres which allows removing src_compile() - chops long lines - adds MAVEN_ID so that java-ebuilder can find it Signed-off-by: Volkmar W. Pogatzki dev-java/testng: fixup Signed-off-by: Volkmar W. Pogatzki --- dev-java/testng/Manifest | 5 ++ dev-java/testng/metadata.xml | 2 +- dev-java/testng/testng-6.11.ebuild | 100 + 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 dev-java/testng/testng-6.11.ebuild diff --git a/dev-java/testng/Manifest b/dev-java/testng/Manifest index 310f28a1c68c..aaf68f18ad4d 100644 --- a/dev-java/testng/Manifest +++ b/dev-java/testng/Manifest @@ -1 +1,6 @@ +DIST apache-groovy-binary-2.4.21.zip 37467992 BLAKE2B e0f925bad53f0f8a7012f0bea420ec3e5986118cc23cd677a11f619284754eacc15c3012cf780063fef574053781bba924a86e5fa2ac284d86f349ad18173704 SHA512 e2f73405d7521b99e3ce5622cffcc505bbc039ccb1c35696fc895d648a9325937a136cf97a229f7ac1b90b63ad8603881350c4d41e514ad45233fb333d76d510 +DIST groovy-all-2.4.7.jar 7015434 BLAKE2B 23d22ddd78229c485ed9384169acee154258644249b856661e17d1d0efb5518e32473a26962b5d657a09b41d490813ed76254820ffdf39e83869209617b66c2d SHA512 4c26ff9f7137c0506c95f7ba1d4228ce57e16d87b77dd1d114390224207d71d3958460c7b5a239d5f41596ab87e7f4aa7aaea1dfce19a50badf8f9b818329c54 +DIST jquery-3.5.1.jar 313070 BLAKE2B 76abfbd21d83f72a3cfcb666f3a2fcfcf5975e723a462996bac9701caf6b59cb9998746af713ebb1f6bfe49cce91544216cc65dc6819e95e8a15930744685415 SHA512 9f560415b36875958ff1d3c6d37fa79d6d134c5f5fc7719dd21db36d1f24dec39787834b2a9ffb104ec6b56e725ccc524a8ff9b189ced3d68e24296b2daae720 +DIST spock-core-1.0-groovy-2.4.jar 588030 BLAKE2B 68d8fad8b6ffb45a18778797ea23d4f3b09256bf4e9f207ee666d07572399cd13522e6f1590219a80e23f6906a2e9eaf1f22c6a3c01717e8c1e99b5d37b89210 SHA512 078c0b16688eaa3134043e58ed4273981797ea92f08723b5508c7d7e4f635278dd5ca731fb294da2a1f35674623d969ee423d4344c2c822e1d4cb8d4f3383790 +DIST testng-6.11.tar.gz 677522 BLAKE2B 2e7bf30fcf805cce5a7ec42f22c39e9f4678642fcde9752c51d118e655189805661edeeff1a3db0e960c79e7542fe25ab8fa6995f142da12b3adc8753fd8a361 SHA512 996d7a18399e16626756b7a790182c7b6bf3453280209d0a09d4a509d698fcad1a80e58ec36702de95bd59c90c237463719ad44934c14390620fc9655d871252 DIST testng-6.9.10.tar.gz 6271781 BLAKE2B 5b77f4b1d9bfdca6749a1d33f465a30bcd9ab9dd9fc37abf8148301c24d6bf287224d9886c0f681deac54e12f9460139ce2a2058b3d160c05cf8fcb9f7808373 SHA512 ed9ad1ced20904ab261d2a233f3fa43ee1ea31778e992cdd27459811b256a6998d8385dd01ff72821133208a1fbd72aa3599a4b8bc0eb4d7b696d34593f9567e diff --git a/dev-java/testng/metadata.xml b/dev-java/testng/metadata.xml index 43f8b5d27805..f79c946be086 100644 --- a/dev-java/testng/metadata.xml +++ b/dev-java/testng/metadata.xml @@ -6,6 +6,6 @@ Java - cbeust/testng + testng-team/testng diff --git a/dev-java/testng/testng-6.11.ebuild b/dev-java/testng/testng-6.11.ebuild new file mode 100644 index ..fd5411152497 --- /dev/null +++ b/dev-java/testng/testng-6.11.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="org.testng:testng:6.11" +JAVA_TESTING_FRAMEWORKS="testng" + +inherit java-pkg-2 java-pkg-simple + +DESCRIPTION="Testing framework inspired by JUnit and NUnit with new features" +HOMEPAGE="https://testng.org/"; +# Presently we install the binary version of jquery since it is not packaged in ::gentoo. +JQV="3.5.1" +# Currently we bundle the binary versions of spock-core, groovy-all and apache-groovy-binary. +# These are used only for tests, we don't install them. +SCV="1.0-groovy-2.4" +GAV="2.4.7" +AGV="2.4.21" +SRC_URI="https://github.com/testng-team/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz + https://repo1.maven.org/maven2/org/webjars/jquery/${JQV}/jquery-${JQV}.jar + test? ( + https://repo1.maven.org/maven2/org/spockframework/spock-core/${SCV}/spock-core-${SCV}.jar + https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/${GAV}/groovy-all-${GAV}.jar + https://downloads.apache.org/groovy/${AGV}/distribution/apache-groovy-binary-${AGV}.zip + )" +S="${WORKDIR}/${P}" + +LICENSE="Apache-2.0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" +SLOT="0" + +CP_DEPEND=" + dev-java/ant-core:0 + dev-java/bsh:0 + dev-java/guice:4 + dev-java/jcommander:1.64 + dev-java/junit:4 + dev-java/snakeyaml:0 +" + +DEPEND="${CP_DEPEND} + >=virtual/jdk-1.8:* + test? ( dev-java/assertj-core:3 )" + +RDEPEND="${CP_DEPEND} + >=virtual/
[gentoo-dev] [PATCH 1/4] java-utils-2.eclass: allow etestng to run testng.xml
The etestng function is presently limited to running test classes and has no option for running testng.xml files. Using testng.xml in an ebuild requires manual coding in src_test(). This change adds a switch to the etestng function which allows running default src_test() with either testng.xml files or test classes. Signed-off-by: Volkmar W. Pogatzki --- eclass/java-utils-2.eclass | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass index c1f42408e462..3fe64e1c317d 100644 --- a/eclass/java-utils-2.eclass +++ b/eclass/java-utils-2.eclass @@ -1886,7 +1886,7 @@ ejunit4() { # @CODE # $1 - -cp or -classpath # $2 - the classpath passed to it -# $@ - test classes for testng to run. +# $@ - test classes or testng.xml for testng to run. # @CODE etestng() { debug-print-function ${FUNCNAME} $* @@ -1910,6 +1910,7 @@ etestng() { -cp ${cp} -Djava.io.tmpdir="${T}" -Djava.awt.headless=true + -Dtest.resources.dir="${JAVA_TEST_RESOURCE_DIRS}" ${JAVA_TEST_EXTRA_ARGS[@]} ${runner} ${JAVA_TEST_RUNNER_EXTRA_ARGS[@]} @@ -1922,7 +1923,11 @@ etestng() { ) fi - args+=( -testclass ${tests} ) + if [[ "${test%.xml}" == "${test}" ]]; then + args+=( -testclass ${tests} ) + else + args+=( ${tests%,} ) + fi debug-print "java ${args[@]}" java ${args[@]} || die "Running TestNG failed." -- 2.41.0
Re: [gentoo-dev] [PATCH] distutils-r1.eclass: Make use of gpep517's new build-wheel --prefix arg
James Le Cuirot writes: > This fixes cross-prefix installations. Do we need to crank the minimum version we depend on for gpep517 then? > > Signed-off-by: James Le Cuirot > --- > eclass/distutils-r1.eclass | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass > index 56afcdc5bcb8..838162c6b0f8 100644 > --- a/eclass/distutils-r1.eclass > +++ b/eclass/distutils-r1.eclass > @@ -1444,6 +1444,7 @@ distutils_pep517_install() { > einfo " Building the wheel for ${PWD#${WORKDIR}/} via ${build_backend}" > local cmd=( > gpep517 build-wheel > + --prefix="${EPREFIX}/usr" > --backend "${build_backend}" > --output-fd 3 > --wheel-dir "${WHEEL_BUILD_DIR}"
[gentoo-dev] [PATCH] distutils-r1.eclass: Make use of gpep517's new build-wheel --prefix arg
This fixes cross-prefix installations. Signed-off-by: James Le Cuirot --- eclass/distutils-r1.eclass | 1 + 1 file changed, 1 insertion(+) diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 56afcdc5bcb8..838162c6b0f8 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -1444,6 +1444,7 @@ distutils_pep517_install() { einfo " Building the wheel for ${PWD#${WORKDIR}/} via ${build_backend}" local cmd=( gpep517 build-wheel + --prefix="${EPREFIX}/usr" --backend "${build_backend}" --output-fd 3 --wheel-dir "${WHEEL_BUILD_DIR}" -- 2.41.0
[gentoo-dev] [PATCH 1/1] systemd.eclass: add systemd_install_dropin
Closes: https://bugs.gentoo.org/876658 Signed-off-by: Florian Schmaus --- eclass/systemd.eclass | 44 ++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass index fbed387e0ca0..03d6a82fd310 100644 --- a/eclass/systemd.eclass +++ b/eclass/systemd.eclass @@ -1,4 +1,4 @@ -# Copyright 2011-2022 Gentoo Authors +# Copyright 2011-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: systemd.eclass @@ -227,6 +227,48 @@ systemd_install_serviced() { ) } +# @FUNCTION: systemd_install_dropin +# @USAGE: [--user] +# @DESCRIPTION: +# Install as the dropin file .d/00gentoo.conf, +# overriding the settings of . +# Defaults to system unit dropins, unless --user is provided, +# which causes the dropin to be installed for user units. +# The required argument may be '-', in which case the +# file is read from stdin and must also be specified. +# @EXAMPLE: +# systemd_install_dropin foo.service "${FILESDIR}/foo.service.conf" +# systemd_install_dropin foo.service - <<-EOF +# [Service] +# RestartSec=120 +# EOF +systemd_install_dropin() { + debug-print-function ${FUNCNAME} "${@}" + + local basedir + if [[ $# -ge 1 ]] && [[ $1 == "--user" ]]; then + basedir=$(_systemd_unprefix systemd_get_userunitdir) + shift 1 + else + basedir=$(_systemd_unprefix systemd_get_systemunitdir) + fi + + local unit=${1} + local src=${2} + + [[ ${unit} ]] || die "No unit specified" + [[ ${src} ]] || die "No conf file specified" + + # avoid potentially common mistake + [[ ${unit} == *.d ]] && die "Unit ${unit} must not have .d suffix" + + ( + insopts -m 0644 + insinto "${basedir}/${unit}".d + newins "${src}" 00gentoo.conf + ) +} + # @FUNCTION: systemd_enable_service # @USAGE: # @DESCRIPTION: -- 2.41.0
[gentoo-dev] [PATCH 0/1] systemd.eclass: add systemd_install_dropin
PR at https://github.com/gentoo/gentoo/pull/33089 Florian Schmaus (1): systemd.eclass: add systemd_install_dropin eclass/systemd.eclass | 44 ++- 1 file changed, 43 insertions(+), 1 deletion(-) -- 2.41.0