Created attachment 145654 [details] [patch] java/junit fix build with openjdk8 If OpenJDK8 is set as the default compiler, this build fails with: https://github.com/junit-team/junit/issues/749 I started looking at porting junit 4.12-beta-1, but they switched the build from ant to maven so it will be a bit of work. For now, I backported https://github.com/junit-team/junit/commit/88f7a12d472b1157639db5148b29c8a8825802a3 and it seems to work ok.
over to maintainer
I concur that this fixes the build with OpenJDK8. Better would be updating the port to JUnit 4.12 though. I have to ask, why are we bothering to build JUnit like this? It would be much easier to just download the the JARs and install them into the appropriate directory and then we wouldn't need to worry about the build process at all. However, if we don't want to update to JUnit 4.12, then committing would remove one of the issues of a change in default from openjdk7 (EOL in April) to openjdk8.
Created attachment 153253 [details] junit 4.12
I've updated the port to 4.12. As glewis suggested I'm using the binary now. Maybe there is more sites to add to MASTER_SITES. Can you test it?
The patch does not apply cleanly, there's a Makefile.rej left over. It also fails to build.
Created attachment 156082 [details] new patch
I've simplified the Makefile and tested with poudriere. That looks good to you?
Test-building right now. Will take some time...
It builds fine, but libreoffice fails to build with it: checking for standalone hamcrest jar.... configure: error: junit does not contain hamcrest; please use a junit jar that includes hamcrest, install a hamcrest jar in the default location (/usr/share/java), specify its path with --with-hamcrest=..., or disable junit with --without-junit
Hmm, probably we'll need to create a hamcrest port and set it as a junit dependency. I'll check it. Thanks!
fwiw, at least on DF, junit won't even build with openjdk7 now (since the last update to openjdk7). I actually think the latest openjdk7 is a regression, I had more than one new failure with it.
Created attachment 156114 [details] patch_junit_hamcrest_libreoffice
I've created the hamcrest port. This change solves the previous problem. What do you think?
hamcrest builds fine, thanks. In the future, please: new ports as shar in a new PR, seperate from other stuff 8-} I'm testing...
The patch to the libreoffice makefile references hamcrest, but does not add the build_depends or run_depends ?
libreoffice built for me even though junit failed (on DragonFly). However, IIRC, libreoffice is a highly patched and restricted port so maybe DF is just immune ...
Is it necessary? Because hamcrest is a dependency of junit, and junit is a dependency of libreoffice.
If hamcrest is a build_dep for junit, where in the makefile of junit is this listed ?
There is a LIB_DEPENDS in my last (messy) patch.
to correct myself, libreoffice is *NOT* heavily patched in dports, it's almost stock. It built because JAVA is not a default option, and the JAVA option is what pulls in junit. I don't see why libreoffice would fail by default...
I'm still testing this. One run with libreoffice and java still caused some build failure, I need to investigate more.
test finished, looks fine.
A commit references this bug: Author: pi Date: Sat May 2 07:05:59 UTC 2015 New revision: 385166 URL: https://svnweb.freebsd.org/changeset/ports/385166 Log: New port: java/hamcrest Provides a library of matcher objects (also known as constraints or predicates) allowing 'match' rules to be defined declaratively, to be used in other frameworks. Typical scenarios include testing frameworks, mocking libraries and UI validation rules. WWW: http://hamcrest.org/ PR: 192575 Submitted by: danilo Changes: head/java/Makefile head/java/hamcrest/ head/java/hamcrest/Makefile head/java/hamcrest/distinfo head/java/hamcrest/pkg-descr
The lib-depends did not work: /!\ junit-4.12: Makefile errors /!\ All LIB_DEPENDS should use the new format and start out with lib. (libfoo.so vs foo.so) *** Error code 1 Stop. So I changed it to a run-depends.
(In reply to Danilo Egea Gondolfo from comment #7) I'm testing the dependend ports now for the junit update: devel/jgoodies-common devel/jakarta-commons-io devel/libvirt-java editors/openoffice-4 editors/libreoffice editors/openoffice-devel java/jflex java/bouncycastle java/berkeley-db java/icedtea-web math/jts math/scilab net/jakarta-commons-net net-p2p/vuze www/jmeter
Most ports worked, two failed (openoffice-devel fail is unrelated): http://people.freebsd.org/~pi/logs/je-6.1.5.log http://people.freebsd.org/~pi/logs/jgoodies-common-1.2.1.log I'm not sure the failures are hamcrest/junit-related, so if I do not hear anything else, I'll commit the junit update in a few hours or so.
A commit references this bug: Author: pi Date: Sat May 2 18:01:00 UTC 2015 New revision: 385202 URL: https://svnweb.freebsd.org/changeset/ports/385202 Log: java/junit: 4.11 -> 4.12 Changes: https://github.com/junit-team/junit/blob/master/doc/ReleaseNotes4.12.md Moved from building from source with ant to using the binary jar file, as the new build mechanism is based on maven. java/hamcrest was split from 4.12. PR: 192575 Submitted by: danilo (maintainer), kevin.bowling@kev009.com Changes: head/java/junit/Makefile head/java/junit/distinfo
Committed, thanks for the fixed and the hamcrest port.
java/berkeley-db works with this change in build.xml: <path id="unittest.classpath"> <path refid="class.path"/> <pathelement location="${env.JAVALIBDIR}/junit.jar"/> <pathelement location="${env.JAVALIBDIR}/hamcrest.jar"/> <pathelement location="${unittest.destdir}"/> </path>