summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Clement <monsieurp@gentoo.org>2015-05-17 21:37:12 +0000
committerPatrice Clement <monsieurp@gentoo.org>2015-05-17 21:37:12 +0000
commit83cb42e21b7999330e741e85420c8bbdd4fa5018 (patch)
tree8793c5256bec0b8ac9af389e003053c0b579ef76 /dev-java/jboss-logging
parentDrop old; 5.1 series no longer builds with current libmysqlclient from servers (diff)
downloadgentoo-2-83cb42e21b7999330e741e85420c8bbdd4fa5018.tar.gz
gentoo-2-83cb42e21b7999330e741e85420c8bbdd4fa5018.tar.bz2
gentoo-2-83cb42e21b7999330e741e85420c8bbdd4fa5018.zip
Patch for mending Map misuse in order to get the package to compile against
slf4j-api-1.7.7. Fix bug 509602. Signed-off-by: Patrice Clement <monsieurp@gentoo.org> (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 93491BB8)
Diffstat (limited to 'dev-java/jboss-logging')
-rw-r--r--dev-java/jboss-logging/ChangeLog10
-rw-r--r--dev-java/jboss-logging/files/jboss-logging-3.1.4-MDC.patch152
-rw-r--r--dev-java/jboss-logging/files/jboss-logging-3.1.4-build.xml202
-rw-r--r--dev-java/jboss-logging/jboss-logging-3.1.4.ebuild25
4 files changed, 379 insertions, 10 deletions
diff --git a/dev-java/jboss-logging/ChangeLog b/dev-java/jboss-logging/ChangeLog
index 97594ce703b9..8afc4b719a88 100644
--- a/dev-java/jboss-logging/ChangeLog
+++ b/dev-java/jboss-logging/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-java/jboss-logging
-# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-java/jboss-logging/ChangeLog,v 1.4 2014/05/10 12:34:44 tomwij Exp $
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-java/jboss-logging/ChangeLog,v 1.5 2015/05/17 21:37:12 monsieurp Exp $
+
+ 17 May 2015; Patrice Clement <monsieurp@gentoo.org>
+ +files/jboss-logging-3.1.4-MDC.patch, +files/jboss-logging-3.1.4-build.xml,
+ jboss-logging-3.1.4.ebuild:
+ Patch for mending Map misuse in order to get the package to compile against
+ slf4j-api-1.7.7. Fix bug 509602.
*jboss-logging-3.1.4 (10 May 2014)
diff --git a/dev-java/jboss-logging/files/jboss-logging-3.1.4-MDC.patch b/dev-java/jboss-logging/files/jboss-logging-3.1.4-MDC.patch
new file mode 100644
index 000000000000..e8a3a50a41fd
--- /dev/null
+++ b/dev-java/jboss-logging/files/jboss-logging-3.1.4-MDC.patch
@@ -0,0 +1,152 @@
+--- jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/AbstractMdcLoggerProvider.java.orig 2015-05-17 20:55:35.000000000 +0000
++++ jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/AbstractMdcLoggerProvider.java 2015-05-17 20:58:00.000000000 +0000
+@@ -23,27 +23,27 @@
+
+ abstract class AbstractMdcLoggerProvider extends AbstractLoggerProvider {
+
+- private final ThreadLocal<Map<String, Object>> mdcMap = new ThreadLocal<Map<String, Object>>();
++ private final ThreadLocal<Map<String, String>> mdcMap = new ThreadLocal<Map<String, String>>();
+
+ public Object getMdc(String key) {
+ return mdcMap.get() == null ? null : mdcMap.get().get(key);
+ }
+
+- public Map<String, Object> getMdcMap() {
++ public Map<String, String> getMdcMap() {
+ return mdcMap.get();
+ }
+
+- public Object putMdc(String key, Object value) {
+- Map<String, Object> map = mdcMap.get();
++ public Object putMdc(String key, String value) {
++ Map<String, String> map = mdcMap.get();
+ if (map == null) {
+- map = new HashMap<String, Object>();
++ map = new HashMap<String, String>();
+ mdcMap.set(map);
+ }
+ return map.put(key, value);
+ }
+
+ public void removeMdc(String key) {
+- Map<String, Object> map = mdcMap.get();
++ Map<String, String> map = mdcMap.get();
+ if (map == null)
+ return;
+ map.remove(key);
+--- jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/Log4jLoggerProvider.java.orig 2015-05-17 20:16:57.000000000 +0000
++++ jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/Log4jLoggerProvider.java 2015-05-17 21:21:25.157000000 +0000
+@@ -34,11 +34,11 @@
+ }
+
+ @SuppressWarnings("unchecked")
+- public Map<String, Object> getMdcMap() {
++ public Map<String, String> getMdcMap() {
+ return MDC.getContext();
+ }
+
+- public Object putMdc(String key, Object val) {
++ public Object putMdc(String key, String val) {
+ try {
+ return MDC.get(key);
+ } finally {
+--- jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/Slf4jLoggerProvider.java.orig 2015-05-17 20:44:24.000000000 +0000
++++ jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/Slf4jLoggerProvider.java 2015-05-17 21:22:05.205000000 +0000
+@@ -33,14 +33,14 @@
+ return new Slf4jLogger(name, l);
+ }
+
+- public Object putMdc(final String key, final Object value) {
++ public Object putMdc(final String key, final String value) {
+ try {
+ return MDC.get(key);
+ } finally {
+ if (value == null) {
+ MDC.remove(key);
+ } else {
+- MDC.put(key, String.valueOf(value));
++ MDC.put(key, value);
+ }
+ }
+ }
+@@ -54,7 +54,7 @@
+ }
+
+ @SuppressWarnings({ "unchecked" })
+- public Map<String, Object> getMdcMap() {
++ public Map<String, String> getMdcMap() {
+ return MDC.getCopyOfContextMap();
+ }
+ }
+--- jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/JDKLoggerProvider.java.orig 2015-05-17 21:19:12.964000000 +0000
++++ jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/JDKLoggerProvider.java 2015-05-17 21:22:41.639000000 +0000
+@@ -23,4 +23,9 @@
+ public Logger getLogger(final String name) {
+ return new JDKLogger(name);
+ }
++
++ @Override
++ public Object putMdc(String key, String value) {
++ return null;
++ }
+ }
+--- jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/JBossLogManagerProvider.java.orig 2015-05-17 20:15:41.000000000 +0000
++++ jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/JBossLogManagerProvider.java 2015-05-17 21:20:42.844000000 +0000
+@@ -59,8 +59,8 @@
+ }
+ }
+
+- public Object putMdc(final String key, final Object value) {
+- return MDC.put(key, String.valueOf(value));
++ public Object putMdc(final String key, final String value) {
++ return MDC.put(key, value);
+ }
+
+ public Object getMdc(final String key) {
+@@ -72,7 +72,7 @@
+ }
+
+ @SuppressWarnings({ "unchecked" })
+- public Map<String, Object> getMdcMap() {
++ public Map<String, String> getMdcMap() {
+ // we can re-define the erasure of this map because MDC does not make further use of the copy
+ return (Map)MDC.copy();
+ }
+--- jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/MDC.java.orig 2015-05-17 19:12:40.000000000 +0000
++++ jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/MDC.java 2015-05-17 21:22:27.689000000 +0000
+@@ -25,7 +25,7 @@
+ private MDC() {
+ }
+
+- public static Object put(String key, Object val) {
++ public static Object put(String key, String val) {
+ return LoggerProviders.PROVIDER.putMdc(key, val);
+ }
+
+@@ -37,7 +37,7 @@
+ LoggerProviders.PROVIDER.removeMdc(key);
+ }
+
+- public static Map<String, Object> getMap() {
++ public static Map<String, String> getMap() {
+ return LoggerProviders.PROVIDER.getMdcMap();
+ }
+ }
+--- jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/LoggerProvider.java.orig 2015-05-17 19:06:30.000000000 +0000
++++ jboss-logging-3.1.4.GA/src/main/java/org/jboss/logging/LoggerProvider.java 2015-05-17 21:21:43.083000000 +0000
+@@ -23,13 +23,13 @@
+ public interface LoggerProvider {
+ Logger getLogger(String name);
+
+- Object putMdc(String key, Object value);
++ Object putMdc(String key, String value);
+
+ Object getMdc(String key);
+
+ void removeMdc(String key);
+
+- Map<String, Object> getMdcMap();
++ Map<String, String> getMdcMap();
+
+ void clearNdc();
+
diff --git a/dev-java/jboss-logging/files/jboss-logging-3.1.4-build.xml b/dev-java/jboss-logging/files/jboss-logging-3.1.4-build.xml
new file mode 100644
index 000000000000..35bbf84f9c39
--- /dev/null
+++ b/dev-java/jboss-logging/files/jboss-logging-3.1.4-build.xml
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- Ant build file (http://ant.apache.org/) for Ant 1.6.2 or above. -->
+<!-- ====================================================================== -->
+
+<!-- ====================================================================== -->
+<!-- ===================== - DO NOT EDIT THIS FILE! - ===================== -->
+<!-- ====================================================================== -->
+<!-- -->
+<!-- Any modifications will be overwritten. -->
+<!-- -->
+<!-- Generated by Maven Ant Plugin on 5/8/14 3:59 PM -->
+<!-- See: http://maven.apache.org/plugins/maven-ant-plugin/ -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<project name="jboss-logging-from-maven" default="package" basedir=".">
+
+ <!-- ====================================================================== -->
+ <!-- Build environment properties -->
+ <!-- ====================================================================== -->
+
+ <property file="${user.home}/.m2/maven.properties"/>
+ <property file="maven-build.properties"/>
+
+ <property name="maven.build.finalName" value="jboss-logging-3.1.4.GA"/>
+ <property name="maven.build.dir" value="target"/>
+ <property name="maven.build.outputDir" value="${maven.build.dir}/classes"/>
+ <property name="maven.build.srcDir.0" value="src/main/java"/>
+ <property name="maven.build.resourceDir.0" value="src/main/resources"/>
+ <property name="maven.build.testOutputDir" value="${maven.build.dir}/test-classes"/>
+ <property name="maven.build.testDir.0" value="src/test/java"/>
+ <property name="maven.build.testResourceDir.0" value="src/test/resources"/>
+ <property name="maven.test.reports" value="${maven.build.dir}/test-reports"/>
+ <property name="maven.reporting.outputDirectory" value="${maven.build.dir}/site"/>
+
+ <property name="maven.repo.local" value="${user.home}/.m2/repository"/>
+ <property name="maven.settings.offline" value="false"/>
+ <property name="maven.settings.interactiveMode" value="true"/>
+
+ <!-- ====================================================================== -->
+ <!-- Defining classpaths -->
+ <!-- ====================================================================== -->
+
+ <path id="build.classpath">
+ <pathelement location="${maven.repo.local}/org/jboss/logmanager/jboss-logmanager/1.2.0.GA/jboss-logmanager-1.2.0.GA.jar"/>
+ <pathelement location="${maven.repo.local}/log4j/log4j/1.2.16/log4j-1.2.16.jar"/>
+ <pathelement location="${maven.repo.local}/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar"/>
+ </path>
+ <path id="build.test.classpath">
+ <pathelement location="${maven.repo.local}/org/jboss/logmanager/jboss-logmanager/1.2.0.GA/jboss-logmanager-1.2.0.GA.jar"/>
+ <pathelement location="${maven.repo.local}/log4j/log4j/1.2.16/log4j-1.2.16.jar"/>
+ <pathelement location="${maven.repo.local}/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar"/>
+ </path>
+
+ <!-- ====================================================================== -->
+ <!-- Cleaning up target -->
+ <!-- ====================================================================== -->
+
+ <target name="clean" description="Clean the output directory">
+ <delete dir="${maven.build.dir}"/>
+ </target>
+
+ <!-- ====================================================================== -->
+ <!-- Compilation target -->
+ <!-- ====================================================================== -->
+
+ <target name="compile" description="Compile the code">
+ <mkdir dir="${maven.build.outputDir}"/>
+ <javac destdir="${maven.build.outputDir}"
+ nowarn="true"
+ debug="true"
+ optimize="false"
+ deprecation="true"
+ target="1.1"
+ verbose="false"
+ fork="false"
+ source="1.3">
+ <src>
+ <pathelement location="${maven.build.srcDir.0}"/>
+ </src>
+ <classpath refid="build.classpath"/>
+ </javac>
+ <copy todir="${maven.build.outputDir}">
+ <fileset dir="${maven.build.resourceDir.0}"/>
+ </copy>
+ </target>
+
+ <!-- ====================================================================== -->
+ <!-- Test-compilation target -->
+ <!-- ====================================================================== -->
+
+ <target name="compile-tests"
+ depends="compile"
+ description="Compile the test code"
+ unless="maven.test.skip">
+ <mkdir dir="${maven.build.testOutputDir}"/>
+ </target>
+
+ <!-- ====================================================================== -->
+ <!-- Run all tests -->
+ <!-- ====================================================================== -->
+
+ <target name="test"
+ depends="compile-tests, junit-missing"
+ unless="junit.skipped"
+ description="Run the test cases"/>
+
+ <target name="test-junit-present">
+ <available classname="junit.framework.Test" property="junit.present"/>
+ </target>
+
+ <target name="test-junit-status"
+ depends="test-junit-present">
+ <condition property="junit.missing">
+ <and>
+ <isfalse value="${junit.present}"/>
+ <isfalse value="${maven.test.skip}"/>
+ </and>
+ </condition>
+ <condition property="junit.skipped">
+ <or>
+ <isfalse value="${junit.present}"/>
+ <istrue value="${maven.test.skip}"/>
+ </or>
+ </condition>
+ </target>
+
+ <target name="junit-missing"
+ depends="test-junit-status"
+ if="junit.missing">
+ <echo>=================================== WARNING ===================================</echo>
+ <echo> JUnit is not present in your $ANT_HOME/lib directory. Tests not executed.</echo>
+ <echo>===============================================================================</echo>
+ </target>
+
+ <!-- ====================================================================== -->
+ <!-- Javadoc target -->
+ <!-- ====================================================================== -->
+
+ <target name="javadoc" description="Generates the Javadoc of the application">
+ <javadoc sourcepath="${maven.build.srcDir.0}"
+ packagenames="*"
+ destdir="${maven.reporting.outputDirectory}/apidocs"
+ access="protected"
+ old="false"
+ verbose="false"
+ version="true"
+ use="true"
+ author="true"
+ splitindex="false"
+ nodeprecated="false"
+ nodeprecatedlist="false"
+ notree="false"
+ noindex="false"
+ nohelp="false"
+ nonavbar="false"
+ serialwarn="false"
+ charset="ISO-8859-1"
+ linksource="false"
+ breakiterator="false">
+ <doctitle>&lt;![CDATA[JBoss Logging 3.1.4.GA]]&gt;</doctitle>
+ <header>&lt;![CDATA[JBoss Logging 3.1.4.GA]]&gt;</header>
+ <footer>&lt;![CDATA[JBoss Logging 3.1.4.GA]]&gt;</footer>
+ <bottom>&lt;![CDATA[&lt;i&gt;Copyright &amp;#169; 2012 Red Hat, Inc.&lt;/i&gt;]]&gt;</bottom>
+ <link href="http://java.sun.com/javase/6/docs/api/"/>
+ <doclet name="net.gleamynode.apiviz.APIviz"
+ path="${maven.repo.local}/org/jboss/apiviz/apiviz/1.2.5.GA/apiviz-1.2.5.GA.jar"/>
+ </javadoc>
+ </target>
+
+ <!-- ====================================================================== -->
+ <!-- Package target -->
+ <!-- ====================================================================== -->
+
+ <target name="package" depends="compile,test" description="Package the application">
+ <jar jarfile="${maven.build.dir}/${maven.build.finalName}.jar"
+ compress="true"
+ index="true"
+ basedir="${maven.build.outputDir}"
+ excludes="**/package.html">
+ </jar>
+ </target>
+
+ <!-- ====================================================================== -->
+ <!-- A dummy target for the package named after the type it creates -->
+ <!-- ====================================================================== -->
+
+ <target name="jar" depends="package" description="Builds the jar for the application"/>
+
+ <!-- ====================================================================== -->
+ <!-- Download dependencies target -->
+ <!-- ====================================================================== -->
+
+ <target name="test-offline">
+ <condition property="maven.mode.offline">
+ <equals arg1="${maven.settings.offline}" arg2="true"/>
+ </condition>
+ </target>
+
+</project>
diff --git a/dev-java/jboss-logging/jboss-logging-3.1.4.ebuild b/dev-java/jboss-logging/jboss-logging-3.1.4.ebuild
index 9ef732c53daf..83cf02f23b74 100644
--- a/dev-java/jboss-logging/jboss-logging-3.1.4.ebuild
+++ b/dev-java/jboss-logging/jboss-logging-3.1.4.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-java/jboss-logging/jboss-logging-3.1.4.ebuild,v 1.1 2014/05/10 12:34:44 tomwij Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-java/jboss-logging/jboss-logging-3.1.4.ebuild,v 1.2 2015/05/17 21:37:12 monsieurp Exp $
EAPI="5"
@@ -17,13 +17,13 @@ SLOT="0"
KEYWORDS="~amd64 ~x86"
COMMON_DEPEND="dev-java/jboss-logmanager:0
- <dev-java/slf4j-api-1.7.7:0
+ >=dev-java/slf4j-api-1.7.7
dev-java/log4j:0"
-RDEPEND=">=virtual/jre-1.5
+RDEPEND=">=virtual/jre-1.6
${COMMON_DEPEND}"
-DEPEND=">=virtual/jdk-1.5
+DEPEND=">=virtual/jdk-1.6
${COMMON_DEPEND}"
S="${WORKDIR}/${P}.GA/"
@@ -32,12 +32,21 @@ EANT_GENTOO_CLASSPATH="jboss-logmanager,slf4j-api,log4j"
JAVA_ANT_REWRITE_CLASSPATH="true"
java_prepare() {
- cp "${FILESDIR}"/${PN}-3.1.3-r1-build.xml build.xml || die
+ cp "${FILESDIR}"/${P}-build.xml build.xml || die
+
+ # https://github.com/qos-ch/slf4j/blob/master/slf4j-api/src/main/java/org/slf4j/MDC.java#L226
+ # MDC returns a Map<String, String>
+ # https://github.com/jboss-logging/jboss-logging/blob/master/src/main/java/org/jboss/logging/Slf4jLoggerProvider.java#L57
+ # Yet, for some reason, the JBoss folks have decided that it should return a Map<String, Object> :|
+ # This patch mends this mistake.
+ epatch "${FILESDIR}"/"${P}"-MDC.patch
}
src_install() {
- java-pkg_newjar target/${PN}-3.1.3.GA.jar
+ java-pkg_newjar target/${PN}-3.1.4.GA.jar
- use doc && java-pkg_dojavadoc target/site/apidocs
+ if use doc; then
+ java-pkg_dojavadoc target/site/apidocs
+ fi
use source && java-pkg_dosrc src/main/java/org
}