commit:     ef35e6b774f97bbade56468bbdd6e20f476c79f8
Author:     Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Mon Aug  5 12:00:24 2024 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Tue Aug  6 08:58:22 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef35e6b7

dev-java/c3p0: build without BSFIX, drop java-ant-2

Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/37969
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 dev-java/c3p0/c3p0-0.9.5.5-r2.ebuild               | 63 ++++++++++++++++++++++
 .../c3p0/files/c3p0-0.9.5.5-source-target.patch    | 49 +++++++++++++++++
 2 files changed, 112 insertions(+)

diff --git a/dev-java/c3p0/c3p0-0.9.5.5-r2.ebuild 
b/dev-java/c3p0/c3p0-0.9.5.5-r2.ebuild
new file mode 100644
index 000000000000..89dc72a719c4
--- /dev/null
+++ b/dev-java/c3p0/c3p0-0.9.5.5-r2.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Tests require an existing running SQL server and 'junit.jar.file' property
+JAVA_PKG_IUSE="doc examples source"
+
+inherit java-pkg-2
+
+DESCRIPTION="JDBC drivers with JNDI-bindable DataSources"
+HOMEPAGE="https://www.mchange.com/projects/c3p0/";
+SRC_URI="https://downloads.sourceforge.net/project/c3p0/c3p0-src/c3p0-${PV}/${P}.src.tgz";
+S="${WORKDIR}/${P}.src"
+
+LICENSE="|| ( EPL-1.0 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+
+CP_DEPEND="
+       dev-java/log4j-12-api:2
+       dev-java/mchange-commons:0
+"
+
+DEPEND="
+       >=virtual/jdk-1.8:*
+       ${CP_DEPEND}
+"
+
+RDEPEND="
+       >=virtual/jre-1.8:*
+       ${CP_DEPEND}
+"
+
+PATCHES=( "${FILESDIR}/c3p0-0.9.5.5-source-target.patch" )
+
+src_prepare() {
+       java-pkg_clean
+       default #780585
+       java-pkg-2_src_prepare
+       java-pkg_jar-from --into lib/ log4j-12-api-2
+       java-pkg_jar-from --into lib/ mchange-commons
+
+       # Test sources interfere with Javadoc generation on JDK 11
+       # Remove since the tests will never be run
+       rm -r src/java/com/mchange/v2/c3p0/test ||
+               die "Failed to remove unused test sources"
+}
+
+src_compile() {
+       eant jar $(usev doc javadoc) \
+               -Dant.build.javac.source="$(java-pkg_get-source)" \
+               -Dant.build.javac.target="$(java-pkg_get-target)"
+}
+
+src_install() {
+       java-pkg_newjar "build/${P}.jar"
+       einstalldocs
+
+       use doc && java-pkg_dojavadoc build/apidocs
+       use examples && java-pkg_doexamples src/java/com/mchange/v2/c3p0/example
+       use source && java-pkg_dosrc src/java/com/mchange/v2
+}

diff --git a/dev-java/c3p0/files/c3p0-0.9.5.5-source-target.patch 
b/dev-java/c3p0/files/c3p0-0.9.5.5-source-target.patch
new file mode 100644
index 000000000000..d066a59fde1b
--- /dev/null
+++ b/dev-java/c3p0/files/c3p0-0.9.5.5-source-target.patch
@@ -0,0 +1,49 @@
+diff --git a/build.xml b/build.xml
+index 47a0f2a..47f8f2b 100644
+--- a/build.xml
++++ b/build.xml
+@@ -180,8 +180,6 @@
+   <target name="init-codegen" depends="debuggen,subst">
+     <javac destdir="${build.classes.dir}" 
+            classpathref="codegen-classpath"
+-         source="${jvm.target.version}"
+-         target="${jvm.target.version}"
+            debug="true">
+       <src>
+       <pathelement location="${build.codegen.dir}" />
+@@ -224,8 +222,6 @@
+   <target name="compile-common" depends="codegen">
+     <javac destdir="${build.classes.dir}" 
+            classpathref="build-classpath" 
+-         source="${jvm.target.version}"
+-         target="${jvm.target.version}"
+            debug="on">
+       <sourcepath>
+       <pathelement location="${build.codegen.dir}" />
+@@ -246,8 +242,6 @@
+   <target name="compile-subst" depends="codegen">
+     <javac destdir="${build.classes.dir}" 
+            classpathref="build-classpath" 
+-         source="${jvm.target.version}"
+-         target="${jvm.target.version}"
+            debug="on">
+       <sourcepath>
+       <pathelement location="${build.codegen.dir}" />
+@@ -262,8 +256,6 @@
+   <target name="compile-mgmt" depends="codegen" unless="no-mgmt">
+     <javac destdir="${build.classes.dir}" 
+            classpathref="build-classpath" 
+-         source="${jvm.target.version}"
+-         target="${jvm.target.version}"
+            debug="on">
+       <sourcepath>
+       <pathelement location="${java.src.dir}" />
+@@ -318,8 +310,6 @@
+   <target name="compile-junit" depends="compile">
+     <javac destdir="${test.classes.dir}" 
+            classpathref="test-classpath" 
+-         source="${jvm.target.version}"
+-         target="${jvm.target.version}"
+            debug="on">
+       <sourcepath>
+       <pathelement location="${java.src.dir}" />

Reply via email to