Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
howto: ebuild for jswat-2.13 (and getting it to install)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
sibbe
n00b
n00b


Joined: 31 Jan 2003
Posts: 35
Location: Helsinki, Finland

PostPosted: Thu Feb 06, 2003 5:48 pm    Post subject: howto: ebuild for jswat-2.13 (and getting it to install) Reply with quote

I spent some hours trying to get latest (2.13) JSwat to emerge. Finally, i discovered what needs to be done before "emerge jswat". In case someone else needs new version of JSwat, here's a little tutorial. Also, this might solve some ant and junit problems.

First we ofcourse need java - because JSwat is a Java debugger :) To use JSwat 2.x, you need 1.4.x jdk, eg. sun-jdk-1.4.1.01. There is a 1.4.1-beta version of Blackdown JDK, but i haven't tested it.

To install Sun's JDK-1.4.x, do
Code:

emerge sun-jdk


Building JSwat needs ant (for actual building. for you who didn't know, "Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles.") and JUnit (used for some tests during the build process, i guess).

Lets start with getting the latest (masked!) ant and junit (I heard people have had some problems with older versions).

Code:

ACCEPT_KEYWORDS="~x86" emerge ant junit


Now that we have ant (and junit) installed, we need to add $ANT_HOME to our profile. Also, to use junit, we need to modifiy the $CLASSPATH. So, edit /etc/env.d/java/20JDKNAME file (/etc/env.d/java/20sun-jdk-1.4.1.01 in my system)

Add this:
Code:

ANT_HOME="/usr/share/ant"


And append ANT_HOME to ENV_VARS and junit.jar to CLASSPATH
Code:

CLASSPATH=/opt/sun-jdk-1.4.1.01/jre/lib/rt.jar:/usr/share/junit/lib/junit.jar:.
ENV_VARS="JAVA_HOME CLASSPATH JDK_HOME JAVAC ADDPATH ADDLDPATH ANT_HOME"


Now run java-config --set-system-vm=... (or --set-user-vm). In this case, that would be
Code:

java-config --set-system-vm=sun-jdk-1.4.1.01


This generates /etc/env.d/20java file (that is why we don't want to edit it directly; it is generated by java-config)

Then, lets update the environment
Code:

env-update && source /etc/profile


Now, take a break. Go drink some coffee, go out for a smoke or something. Eat cookies ;)

Ok, then to the emerge process. First, make your local portage dir and set it as PORTDIR_OVERLAY in make.conf (if you haven't already done so). For example,
Code:

PORTDIR_OVERLAY=/usr/home/sibbe/portage


This way your own ebuilds are not deleted during emerge rsync.

Next step is to get an ebuild file for the latest JSwat. I found couple from bugs.gentoo.org for version 2.11. Close enough, so just changed the version. Grab ebuild-file here.

Code:

# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $

S="${WORKDIR}/jswat-2.13"
DESCRIPTION="Extensible graphical Java debugger"
HOMEPAGE="http://www.bluemarsh.com/java/jswat"
SRC_URI="http://cesnet.dl.sourceforge.net/sourceforge/jswat/jswat-src-2.13.tar.gz"
LICENSE="GPL-2"
SLOT="2"
KEYWORDS="*"

DEPEND=">=dev-java/ant-1.4.1"
#this next line should be changed to >=virtual/jdk once we have a bunch of 1.4 JDK's
RDEPEND=">=virtual/jdk-1.4"

src_compile() {
   echo $S
   # we cannot use jikes here because we would get
   # a java.lang.VerifyError from the ClassLoader (why?)
   echo "2.13" | ant || die "compile problem"
}

src_install () {
   # install it as new CLASSPATH package because other programs
   # (like app-editors/jedit) can make use of it
   cd build/dist/jswat-2.13
   dojar jswat.jar parser.jar jclasslib.jar

   cd ../../..

   echo -e >jswat '#!/bin/sh\njava -classpath /usr/share/jswat/lib/jswat.jar:$JDK_HOME/lib/tools.jar com.bluemarsh.jswat.Main $@'
   chmod 755 jswat
   dobin jswat

   dodoc AUTHORS.txt BUGS.txt HISTORY.txt LICENSE.txt OLD_HISTORY.txt TODO.txt
   dohtml README.html
   dohtml -r docs
}


Final steps; cd to local portage dir, make directory for jswat, put ebuild there, build digest file for it and finally emerge jswat:
Code:

mkdir -p dev-java/jswat
wget http://www.kruu.org/jvtm/files/jswat-2.13.ebuild
ebuild /usr/home/sibbe/portage/dev-java/jswat/jswat-2.13.ebuild digest
emerge jswat


Now you should have JSwat 2.13 installed.

And to use your new and fresh Java debugger, check out the docs at http://www.bluemarsh.com/java/jswat/docs/index.html

edit: oh, and it might be wise to add "junit" to your make.conf's USE variables..
_________________
jyrki muukkonen
Back to top
View user's profile Send private message
pablo_pita
n00b
n00b


Joined: 05 Jan 2003
Posts: 25
Location: Frankfurt

PostPosted: Sat Feb 15, 2003 10:42 pm    Post subject: Reply with quote

I had been struggling getting ant and junit to work and your post just open the light to me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum