[Libreoffice] Autogen.sh pb with junit

Miklos Vajna vmiklos at frugalware.org
Wed Apr 6 04:07:43 PDT 2011


On Mon, Apr 04, 2011 at 11:22:52AM +0200, Bjoern Michaelsen <bjoern.michaelsen at canonical.com> wrote:
> On current debians (I just tried sid) and Ubuntus there is the no
> classpath set in the system junit jar that also does not contain
> hamcrest. Since this problem is widespread: How about checking, if
> either:
> 
>  - the jar sets an classpath in the manifest
>  - the jar contains hamcrest
> 
> and complain explicitly
> "your junit jar neither sets a classpath nor includes hamcrest --
> please provide a full junit jar or use --without-junit"
> if neither is the case. This also helps people making the right choice
> with the upstream jars, where both (including hamcrest and excluding
> hamcrest) are available.
> 
> Doing this little additional testing might prevent some newcomers to
> run away screaming (it might not be the first issue they hit on their
> first build).

I'm attaching a patch that tries to implement this.

I've tested with our (Frugalware) junit jar where the classpath is in
manifest and also with upstream junit jar, which bundles hamcrest.

OK to push to libreoffice-3-4?

Miklos
-------------- next part --------------
From 2be5486a20abe69b7e96e0b8333eb42b4cfe5c90 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos at frugalware.org>
Date: Wed, 6 Apr 2011 12:52:37 +0200
Subject: [PATCH] configure: check for junit's hamcrest dependency

Make sure either class-path entry is available for hamcrest or it's
bundled.
---
 configure.in |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index 94626f1..fe2cfd4 100755
--- a/configure.in
+++ b/configure.in
@@ -7667,7 +7667,15 @@ if test "$SOLAR_JAVA" != "" && test "$with_junit" != "no"; then
     "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
         grep org/junit/Before.class > /dev/null 2>&5
     if test $? -eq 0; then
-        AC_MSG_RESULT([$OOO_JUNIT_JAR])
+        # check if either class-path entry is available for hamcrest or
+        # it's bundled
+        if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |grep hamcrest || \
+            "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |grep -q 'Class-Path: hamcrest'; then
+            AC_MSG_RESULT([$OOO_JUNIT_JAR])
+        else
+            AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
+provide a full junit jar or use --without-junit])
+        fi
     else
         AC_MSG_RESULT([no])
         AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
-- 
1.7.4.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110406/18571496/attachment.pgp>


More information about the LibreOffice mailing list