Spring depends on Java?

Spring depends on Java?

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
HAARP
Posts: 182
Joined: 06 Apr 2006, 07:18

Spring depends on Java?

Post by HAARP »

Code: Select all

# emerge -vDNp spring

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] app-portage/portage-utils-0.1.28  78 kB 
[ebuild  N    ] media-libs/glew-1.3.5  382 kB 
[ebuild  N    ] dev-util/scons-0.97  430 kB 
[ebuild  N    ] media-libs/devil-1.6.7-r2  USE="X gif jpeg opengl png sdl xpm -allegro -mng -tiff" 2,943 kB 
[ebuild  N    ] dev-java/java-config-wrapper-0.13  7 kB 
[ebuild  N    ] dev-java/java-config-2.0.33-r1  25 kB 
[ebuild  N    ] dev-java/java-config-1.3.7  15 kB 
[ebuild  N    ] dev-java/sun-jdk-1.6.0.03  USE="X alsa -doc -examples -jce -nsplugin" 67,006 kB 
[ebuild  N    ] virtual/jdk-1.6.0  0 kB 
[ebuild  N    ] games-strategy/spring-0.75_p2  USE="-debug" 4,009 kB [1]
Is that Java stuff really all necessary? Because I'm not really that keen on emerging Java...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Its used for the java bindings in unitsync.so

Aside from that javas great, people just happen to like writing bad programs in it.
HAARP
Posts: 182
Joined: 06 Apr 2006, 07:18

Post by HAARP »

AF wrote:Its used for the java bindings in unitsync.so
So in short, it's essential to compile Spring? Damn.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

No, you can compile Spring and unitsync
just fine without having a JDK installed, but
it requires hacking the buildsystem a bit. In
rts/build/scons/config.py, comment out the
lines:

Code: Select all

d += [Dependency([], ['jni.h'])]
and

Code: Select all

check_java(env, conf)
by putting a '#' in front of them. Then, in
tools/unitsync/javabind.cpp, place this
line between the last DLL_EXPORT and
the "#include <jni.h>" directive:

Code: Select all

#ifdef JAVAJAVA
and all the way down at the bottom of
the file, insert an extra

Code: Select all

#endif
This will make scons oblivious to Java, and
build unitsync without JNI bindings.
Last edited by Kloot on 01 Nov 2007, 19:42, edited 1 time in total.
semi
Posts: 69
Joined: 30 Mar 2007, 20:42

Post by semi »

The spring ebuild depends on virtual/jdk so you can emerge some other package that provides it.
HAARP
Posts: 182
Joined: 06 Apr 2006, 07:18

Post by HAARP »

Thanks! Will this break anything, like online play?
semi wrote:The spring ebuild depends on virtual/jdk so you can emerge some other package that provides it.
Sorry, I don't understand this sentence..
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

HAARP wrote:Thanks! Will this break anything, like online play?
Can't use AFLobby then, unless you replace your unitsync.so with a version compiled with Java (java libraries are not needed, just header files).
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Nope, it won't break anything except
AFLobby (which depends on the JNI
parts of unitsync, but I assume you
don't use it).

e: what Tobi said ;)
HAARP
Posts: 182
Joined: 06 Apr 2006, 07:18

Post by HAARP »

Excellent, thanks.

Sorry AF, it's not that I find Java bad or something, it's just that I don't want 80MB of libs just to compile a bit of Java support into Spring...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

You dont need 80MB of libs you just need a 200kb jni.h and the accompanying 20kb linux specific file.

Perhaps we could look into bundling the 2 headers with the spring source/svn? Where exactly would they go in the spring folder structure?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Ya was just thinking about that, could put them in tools/unitsync/include, that seems like the most logical location given that Spring does not need them at all.

That is, if they are licensed under GPL or a GPL compatible license.
HAARP
Posts: 182
Joined: 06 Apr 2006, 07:18

Post by HAARP »

I can't even get to compiling. I don't know however if this is related to me removing Java. Can anyone help?

http://pastebin.ca/757999

edit: screw this, you're right. Using pastebin now.
Last edited by HAARP on 01 Nov 2007, 21:31, edited 1 time in total.
User avatar
Relative
Posts: 1371
Joined: 15 Oct 2006, 13:17

Post by Relative »

You could of used a paste bin :/
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

boost-thread is apparently missing in the dependencies of the ebuild.
HAARP
Posts: 182
Joined: 06 Apr 2006, 07:18

Post by HAARP »

Tobi wrote:boost-thread is apparently missing in the dependencies of the ebuild.
I already had dev-libs/boost installed. The problem seems to be that the ebuild doesn't check whether it's compiled with the "threads" useflag. I added that flag manually and recompiled boost, which provided me with boost_thread - exactly what Spring needed.
Compiling now.
semi
Posts: 69
Joined: 30 Mar 2007, 20:42

Post by semi »

http://trac.springlobby.info/changeset/697

This should fix the issue. Just update your portage overlays with
"layman --sync ALL" and retry with emerge.

It should now work with both boost 1.33 (that needs to test that threads use flag is set) and boost 1.34 (which does not have that use flag at all).

If you have any other problems with the ebuilds, shout!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Well Sun did put java under the gpl licence a month or two ago, hence the OpenJDK/Java 7 project

for example:

Big long link to file in openjdk svn
Post Reply

Return to “Linux”