Created attachment 145654 [details]
[patch] java/junit fix build with openjdk8
If OpenJDK8 is set as the default compiler, this build fails with:
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]
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]
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]
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-}
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
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:
Date: Sat May 2 07:05:59 UTC 2015
New revision: 385166
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.
Submitted by: danilo
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
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:
Most ports worked, two failed (openoffice-devel fail is unrelated):
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:
Date: Sat May 2 18:01:00 UTC 2015
New revision: 385202
java/junit: 4.11 -> 4.12
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
Submitted by: danilo (maintainer), firstname.lastname@example.org
Committed, thanks for the fixed and the hamcrest port.
java/berkeley-db works with this change in build.xml: