DebianBuildingInstructions

From IcedTea

Jump to: navigation, search

Contents

Building IcedTea on Debian x86

IcedTea6 is the recommended version of IcedTea as this uses OpenJDK6 builds, which have a stable API and are pretty close to passing the TCK for JDK6. IcedTea uses OpenJDK from the live Mercurial forest, which now receives regular commits from OpenJDK developers -- use at your own risk.

Obtaining IcedTea

Both IcedTea and IcedTea6 now have released tarballs available. Visit http://icedtea.classpath.org/download/source/ to get a copy.

Alternatively, you can download the bleeding edge version of each from Mercurial:

  • IcedTea6
hg clone http://icedtea.classpath.org/hg/icedtea6
  • IcedTea
hg clone http://icedtea.classpath.org/hg/icedtea

Prerequisite: Mercurial

Used:

  • To obtain development versions (rather than releases) of IcedTea and IcedTea6
  • To dynamically grab OpenJDK in IcedTea

Under Debian Etch:

# First install with Etch dependencies
aptitude install mercurial
# then upgrade mercurial to backports.org version
aptitude install -t etch-backports mercurial

The mercurial command is named hg.

Prerequisite for IcedTea7: Mercurial forest support

Compilation requires the 'forest' Mercurial extension. What for? To dynamically get OpenJDK in its mercurial repository, rather than from a tarball. So:

#hg clone http://www.terminus.org/hg/hgforest hgforest # ancienne URL
hg clone http://hg.akoha.org/hgforest/ hgforest
mkdir ~/.hgext
cp hgforest/forest.py ~/.hgext
cat <<EOF >> ~/.hgrc
[extensions]
hgext.forest = ~/.hgext/forest.py
EOF

Compilation: Principles

Compiling this project isn't straightforward, because its dependencies are often very recent or unreleased.

Note that you need Internet access: the IcedTea archive is small, but it grabs a version of OpenJDK from Sun during compilation, about 90MB compressed via HTTP (for IcedTea6) or via Mercurial (for IcedTea).

You also need to reserve some disk space. Builds of IcedTea6 take up close to 6GB of space, as OpenJDK is built twice; once with ecj and then with the just-build IcedTea as a bootstrap mechanism.

HOWTO compile IcedTea6 under Debian Etch (9/2008)

There are two main issues:

  1. The version of gcj on etch is too old (4.1). IcedTea will pick up gij and libgcj.jar from this and fail when the OpenJDK tries to use the 1.4 gij VM.
  2. The version of freetype is too old (2.2 as opposed to 2.3). IcedTea doesn't check this, the OpenJDK build fails with this error.

Things to avoid:

  1. Avoid using Kaffe, CACAO and Ant to build the langtools; for some reason, Ant tries to run CACAO with Kaffe's libraries.
  2. You need a version of jar that can support -J. fastjar doesn't cut it.
  3. Avoid using gcj as your 'java' alternative as it will fail to execute the StripProperties ant task.

The backporter's setup

We'll need to recompile a few packages (FreeType, zlib, ...) from Lenny to Etch: this is called backporting.

You can't install Lenny's .deb directly on Etch, because of binary compatibility issues (more info).

Backported FreeType packages for x86 are available.

Method 1: pbuilder

The no-brainer method is to use pbuilder. It will:

  • retrieve build dependencies automatically
  • compile packages in a pure, clean Etch subsystem, allowing you to share your built packages
  • install the build dependencies in the compilation environment, not in your system

This is enough for simple backports which do not require backported dependencies.

In this documentation we'll use the fast 'cowdancer' flavour of pbuilder.

Here's how to set it up:

MIRROR=http://ftp.fr.debian.org/debian/

# Install cowbuilder
aptitude --assume-yes install pbuilder cowdancer cdebootstrap
# 'dpkg-source', 'dch' and 'fakeroot' utils:
aptitude --assume-yes install dpkg-dev devscripts fakeroot

# Create Etch compilation environment
sed -i -e "s,MIRRORSITE=.*,MIRRORSITE=$MIRROR," /etc/pbuilderrc
cowbuilder --create --distribution=etch

# Add Lenny source for 'apt-get source'
echo "deb-src $MIRROR lenny main" >> /etc/apt/sources.list
aptitude update

Method 2: manually

If you feel more confident with manually building packages, you can follow this Debian documentation.

Here's how to set it up:

  1. Add deb-src http://http.us.debian.org/debian lenny main to your /etc/apt/sources.list file. Use the same mirror as for your other sources, in preference to us.debian.org.
  2. Run apt-get update to get the source package search list
  3. Install fakeroot

There's an example for FreeType below.

Backport FreeType

With pbuilder

Here is an unattented set of instructions:

cd /usr/src
apr-get source libfreetype6
yes | dch -D etch-backports \
  --newversion $(dpkg-parsechangelog | sed -ne 's,^Version: ,,p')~bpo40+1 \
  --force-bad-version -- \
  "Rebuild for Debian Backports <http://www.backports.org/>"
pdebuild --pbuilder cowbuilder
(cd /var/cache/pbuilder/result/ && \
   dpkg -i libfreetype6-dev_2.3.5-1~bpo40+1_i386.deb \
           libfreetype6_2.3.5-1~bpo40+1_i386.deb)

Or manually

  1. Run apt-get source libfreetype6
  2. Run dpkg-source -x package.dsc to patch the downloaded source for Debian
  3. Change to the freetype directory and run dpkg-buildpackage -rfakeroot -us -uc.
  4. Install the produced deb files for libfreetype6 and libfreetype6-dev using dpkg -i

Backport zlib

There is apparently a bug in Etch's zlib, which can make IcedTea6 crash [1]. We need to backport it.

To simplify the backport (in particular, remove the gcc-multilib dependency appeared in Lenny, and fix /usr/bin/ld: cannot find -lgcc_s errors), we won't compile for 64bit.

Place the following patch in /usr/src/zlib-diff:

diff -ur zlib-1.2.3.3.dfsg/debian/control zlib-1.2.3.3.dfsg.beuc/debian/control
--- zlib-1.2.3.3.dfsg/debian/control	2008-03-21 11:52:40.000000000 +0100
+++ zlib-1.2.3.3.dfsg.beuc/debian/control	2008-03-21 11:15:32.000000000 +0100
@@ -4,7 +4,7 @@
 Maintainer: Mark Brown <broonie@debian.org>
 Standards-Version: 3.7.3
 XS-VCS-Bzr: http://bzr.debian.org/bzr/pkg-zlib/zlib/debian
-Build-Depends: debhelper (>= 5), quilt, gcc-multilib [amd64 i386 kfreebsd-amd64 powerpc ppc64 s390 sparc]
+Build-Depends: debhelper (>= 5), quilt
 
 Package: zlib1g
 Architecture: any
@@ -57,26 +57,6 @@
  in gzip and PKZIP.  This minimal package includes the shared library
  for use with the Debian installer.
 
-Package: lib64z1
-Architecture: sparc s390 i386 powerpc
-Depends: ${shlibs:Depends}
-Replaces: amd64-libs (<< 1.4)
-Description: compression library - 64 bit runtime
- zlib is a library implementing the deflate compression method found
- in gzip and PKZIP.  This package includes a 64 bit version of the
- shared library.
-
-Package: lib64z1-dev
-Section: libdevel
-Architecture: sparc s390 i386 powerpc
-Depends: lib64z1 (= ${binary:Version}), zlib1g-dev (= ${binary:Version}), lib64c-dev
-Replaces: amd64-libs-dev (<< 1.4)
-Provides: lib64z-dev
-Description: compression library - 64 bit development
- zlib is a library implementing the deflate compression method found
- in gzip and PKZIP.  This package includes the development support
- files for building 64 bit applications.
-
 Package: lib32z1
 Architecture: amd64 ppc64 kfreebsd-amd64
 Depends: ${shlibs:Depends}
diff -ur zlib-1.2.3.3.dfsg/debian/rules zlib-1.2.3.3.dfsg.beuc/debian/rules
--- zlib-1.2.3.3.dfsg/debian/rules	2008-03-21 11:52:40.000000000 +0100
+++ zlib-1.2.3.3.dfsg.beuc/debian/rules	2008-03-21 11:09:23.000000000 +0100
@@ -34,7 +34,7 @@
 	CFLAGS += -O3
 endif
 
-64-ARCHS=s390 sparc i386 powerpc
+64-ARCHS=s390 sparc powerpc
 ifneq (,$(findstring $(DEB_HOST_ARCH), $(64-ARCHS)))
 EXTRA_INSTALL=install64
 EXTRA_BUILD=build64-stamp

Then proceed with the backport:

apt-get source zlib
cd zlib-1.2.3.3.dfsg/
patch -p1 < ../zlib-diff
yes | dch -D etch-backports \
  --newversion $(dpkg-parsechangelog | sed -ne 's,^Version: ,,p')~bpo40+1 \
  --force-bad-version -- \
  "Rebuild for Debian Backports <http://www.backports.org/>"
pdebuild --pbuilder cowbuilder
dpkg -i /var/cache/pbuilder/result/zlib1g_1.2.3.3.dfsg-11~bpo40+1_i386.deb

Package dependencies

The rest of the packages can be safely installed from the Etch repository.

IcedTea refers to missing packages using the Fedora package namespace. Here's the mapping for Debian:

  • ant => ant
  • ecj => ecj-bootstrap-gcj (Lenny: ecj-gcj)
  • cups-devel => libcupsys2-dev
  • libXt-devel => libxt-dev
  • libXp-devel => libxp-dev
  • lesstif-devel => lesstif2-dev
  • alsa-lib-devel => libasound2-dev
  • libXtst-devel => libxtst-dev
  • plugin support headers and libraries => iceape-dev
  • gtk+-2.0 gthread-2.0 => libgtk2.0-dev
  • gdk-pixbuf-2.0 => libgdk-pixbuf-dev (optional?)
  • giflib-devel => libungif4-dev | libgif-dev
  • libjpeg-devel => libjpeg-dev
  • freetype => libfreetype6-dev
  • xalan2 => libxalan2-java
  • unzip
  • gawk

So:

apt-get install --assume-yes ant \
  libcupsys2-dev libxt-dev libxp-dev lesstif2-dev libasound2-dev libxtst-dev iceape-dev libgtk2.0-dev libgdk-pixbuf-dev \
  libungif4-dev libjpeg-dev libxalan2-java unzip gawk
apt-get install --assume-yes ecj-bootstrap-gcj

Rhino

Rhino is a JavaScript interpreter written in Java.

There's no package for Etch and it isn't easy to backport, but since Java is portable, the most simple to do is to grab a precompiled Jar from the project:

cd /usr/src/
wget ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R1.zip
unzip rhino1_7R1.zip

We'll specifiy --with-rhino=/usr/src/rhino1_7R1/js.jar to ./configure.

Java 1.5 environment

Java is a self-hosted language: you need Java to compile Java :) You can either install a recent GNU Classpath (e.g. 0.97.1, but anything from 0.95 on should work) along with a VM that uses a pre-installed Classpath (CACAO, JamVM, Kaffe) directly, or install gcj 4.3 which uses a recent enough version of Classpath.

Method 1: with a 1.5 Classpath-using JVM and a recent (>=0.95) Classpath release

The easiest way to install Classpath on Debian etch is to install java-gcj-compat-dev:

apt-get install java-gcj-compat-dev

You'll also need:

apt-get install libgconf2-dev

This will give you a version of ecj, the Eclipse Compiler for Java, which runs natively. Then, simply download a Classpath tarball, unpack it and use the following simple triplet

./configure
make
make install

to install it. You then need to compile either CACAO, Kaffe or JamVM in the same way, passing the appropriate option to configure (see ,/configure --help) so it knows where you installed Classpath. For example, to build CACAO, the following script will suffice, just alter the directories to suit. CACAO_HOME is where the CACAO sources will be downloaded to. CLASSPATH_BUILD_DIR is where you installed GNU Classpath. WORKING_DIR is used as a working directory for building, and the results are placed in INSTALL_DIR. You will need Mercurial (see above) to obtain the latest development version.

#!/bin/sh                                                                                                                     
CACAO_HOME=$HOME/projects/classpath/cacao
CLASSPATH_BUILD_DIR=$HOME/build/classpath
WORKING_DIR=$HOME/builder
INSTALL_DIR=$HOME/build/cacao
if [ -e $CACAO_HOME ]; then
    cd $CACAO_HOME;
    make distclean;
    hg pull -u;
else
    cd	`dirname $CACAO_HOME`;
    hg	clone http://mips.complang.tuwien.ac.at/hg/cacao/;
    cd	$CACAO_HOME;
fi
./autogen.sh
if [ ! -e $WORKING_DIR ]; then
    mkdir $WORKING_DIR;
fi
cd $WORKING_DIR
rm -rf cacao
mkdir cacao
cd cacao
$CACAO_HOME/configure --prefix=$INSTALL_DIR --with-classpath-prefix=$CLASSPATH_BUILD_DIR \
    --enable-statistics
make &> $CACAO_HOME/errors && echo COMPILED
make install && echo DONE

Once the VM is installed, make sure that invoking the VM with -version reports 1.5 and not 1.4 as the Java version.

Then, assuming CLASSPATH is your Classpath and VM install directory, point IcedTea6's ./configure at it with

unset JAVA_HOME
./configure \
  --with-libgcj-jar=$CLASSPATH/share/classpath/glibj.zip \
  --with-java=$CLASSPATH/bin/java --with-jar=$CLASSPATH/bin/gjar \
    --with-rmic=$CLASSPATH/bin/grmic --with-javah=$CLASSPATH/bin/gjavah \
  --with-rhino=/usr/src/rhino1_7R1/js.jar

You might want to try a faster build without documentation, especially while experimenting. Note however that this also turns off optimisation at present. For this, add:

--enable-fast-build     optimize for quick building: use -O0 and do not build documentation

Method 2: local GCC 4.3 installation

GCC v4.3 includes Java 1.5 support, required to compile IcedTea.

We will manually compile; a clean Lenny backport may be simpler (this is unlikely, the packaging is pretty tricky).

Reserve some disk space:

$ ls -lh gcc-4.3.0.tar.bz2
-rw-r--r-- 1 sylvain src 57M 2008-03-18 18:05 gcc-4.3.0.tar.bz2
$ du -sh gcc-4.3.0/ # before compilation
511M    gcc-4.3.0/
$ du -sh gcc-4.3.0/ # after compilation!
1,7G    gcc-4.3.0/

Dependencies:

  • bison: OK
  • GMP 4.1+: OK (apt-cache policy libgmp3-dev => 4.2.1)
  • MPFR 2.3.0+: KO, backport needed

Backport mpfr:

cd /usr/src/
apt-get source mpfr
pushd mpfr-2.3.1.dfsg.1/
yes | dch -D etch-backports \
  --newversion $(dpkg-parsechangelog | sed -ne 's,^Version: ,,p')~bpo40+1 \
  --force-bad-version -- \
  "Rebuild for Debian Backports <http://www.backports.org/>"
pdebuild --pbuilder cowbuilder
popd
aptitude purge libmpfr1
dpkg -i /var/cache/pbuilder/result/libmpfr*.deb

Actual compilation:

apt-get --assume-yes install bzip2
apt-get --assume-yes install bison unzip
wget ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-4.3.0/gcc-4.3.0.tar.bz2
tar xjf gcc-4.3.0.tar.bz2
pushd gcc-4.3.0
mkdir builddir
cd builddir/
../configure --prefix=/opt/gcc-4.3.0 --enable-languages=java
make
make install
popd

Result (count 2-3h):

# /opt/gcc-4.3.0/bin/gij -version
java version "1.5.0"
gij (GNU libgcj) version 4.3.0

Yay!

We need to manually install the small java-gcj-compat package so that it points to the local GCC 4.3 installation:

wget ftp://sources.redhat.com/pub/rhug/java-gcj-compat-1.0.77.tar.gz
tar xzf java-gcj-compat-1.0.77.tar.gz
cd java-gcj-compat-1.0.77/
./configure --prefix=/opt/gcc-4.3.0
make install
ll /usr/bin/ecj /opt/gcc-4.3.0/lib/jvm/java-1.5.0-gcj-1.5.0.0/bin
ln -fs ../../../../bin/gjar /opt/gcc-4.3.0/lib/jvm/java-1.5.0-gcj-1.5.0.0/bin/jar
# TODO: why isn't the following done automatically?
cp -a /opt/gcc-4.3.0/lib/gcj-4.3.0-9/* /opt/gcc-4.3.0/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre/lib/i386/
cp -a /opt/gcc-4.3.0/lib/gcc/i686-pc-linux-gnu/4.3.0/include/* /opt/gcc-4.3.0/lib/jvm/java-1.5.0-gcj-1.5.0.0/include/

This defines a symlinked JDK structure for IcedTea.

Then configure IcedTea as follows:

./configure \
  --with-libgcj-jar=/opt/gcc-4.3.0/share/java/libgcj-4.3.0.jar \
  --with-gcj-home=/opt/gcc-4.3.0/lib/jvm/java-1.5.0-gcj-1.5.0.0 \
  --with-java=/opt/gcc-4.3.0/bin/java --with-jar=/opt/gcc-4.3.0/bin/jar \
    --with-rmic=/opt/gcc-4.3.0/bin/rmic --with-javah=/opt/gcc-4.3.0/bin/javah \
  --with-rhino=/usr/src/rhino1_7R1/js.jar

You might want to try a faster build without documentation, especially while experimenting. Note however that this also turns off optimisation at present. For this, add:

--enable-fast-build     optimize for quick building: use -O0 and do not build documentation

Fix default libc linker options

You also need to patch glibc slightly (thanks to twisti for this) so it includes an extra file as needed. This deals with the undefined reference to `___tls_get_addr' issue by essentially telling the linker not to include 'tls' when statically compiling libstdc++ unless it is actually used. This fix is already present in Debian Lenny.

You actually just need to edit the last line of the /usr/lib/libc.so text file:

cat <<EOF | patch /usr/lib/libc.so
--- /usr/lib/libc.so-dist	2008-03-28 22:02:33.000000000 +0100
+++ /usr/lib/libc.so	2008-03-28 22:02:49.000000000 +0100
@@ -2,4 +2,4 @@
    Use the shared library, but some functions are only in
    the static library, so try that secondarily.  */
 OUTPUT_FORMAT(elf32-i386)
-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
+GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.2 ) )
EOF

On x86_64 and ppc64, patch /usr/lib64/libc.so it reads:

GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld64.so.1 ) )

Compilation

Now you can start the actual build process:

cd /usr/src/icedtea6/
make

You'll probably need 2-3h before eventually seeing:

IcedTea is served: openjdk/control/build/linux-i586

Congrats!

Advanced: create a Debian binary package

We can manually create a Debian package (not a traditional source package, because we'd need to backport GCC 4.3 properly), directly with dpkg -b:

cd /usr/src/icedtea6/


# JRE
path=openjdk/control/build/linux-i586/j2re-image
shlib=$(find $path -type f -perm -a+x '!' -name '*.sh' | xargs -r dpkg-shlibdeps -O 2>/dev/null | sed 's/^shlibs:Depends=//')
date=$(php -r "print strftime('%Y%m%d', strtotime('$(hg log -l1 | sed -ne 's/date: //p')'));")

mkdir DEBS
mkdir -p tmp/usr/lib/jvm
mkdir -p tmp/DEBIAN
chmod g-s tmp/DEBIAN
cp -al $path tmp/usr/lib/jvm/java-6-openjdk

cat <<EOF > tmp/DEBIAN/control
Package: openjdk-6-jre
Version: 6.$date
Maintainer: Sylvain Beucler <beuc@beuc.net>
Architecture: i386
Depends: $shlib
Description: OpenJDK Java runtime
 The packages are built using the IcedTea build support and patches from the IcedTea project.
 .
  Homepage: http://icedtea.classpath.org/
EOF

dpkg -b tmp/ DEBS/
rm -rf tmp/


# Same for JDK
path=openjdk/control/build/linux-i586/j2sdk-image
shlib=$(find $path -type f -perm -a+x '!' -name '*.sh' | xargs -r dpkg-shlibdeps -O 2>/dev/null | sed 's/^shlibs:Depends=//')
date=$(php -r "print strftime('%Y%m%d', strtotime('$(hg log -l1 | sed -ne 's/date: //p')'));")

mkdir DEBS
mkdir -p tmp/usr/lib/jvm
mkdir -p tmp/DEBIAN
chmod g-s tmp/DEBIAN
cp -al $path tmp/usr/lib/jvm/java-6-openjdk

cat <<EOF > tmp/DEBIAN/control
Package: openjdk-6-jdk
Version: 6.$date
Maintainer: Sylvain Beucler <beuc@beuc.net>
Architecture: i386
Depends: $shlib
Description: OpenJDK Development Kit (JDK)
 OpenJDK is a development environment for building applications,
 applets, and components using the Java programming language.
 .
 The packages are built using the IcedTea build support and patches
 from the IcedTea project.
 .
  Homepage: http://icedtea.classpath.org/
EOF

dpkg -b tmp/ DEBS/
rm -rf tmp/
$ ls -lh DEBS/*
-rw-r--r-- 1 root root 165M 2008-03-29 16:02 openjdk-6-jdk_6.20080328_i386.deb
-rw-r--r-- 1 root root 126M 2008-03-29 13:43 openjdk-6-jre_6.20080328_i386.deb

I borrowed naming conventions, locations and descriptions from here.

To publish them:

cd DEBS/
apt-ftparchive packages . | gzip > Packages.gz

I uploaded a test binary repository at http://icedtea.beuc.net/ ; add this to your sources.list if you want to test:

deb http://icedtea.beuc.net/debian/ ./

then:

aptitude update
aptitude install openjdk-6-jre

HOWTO compile IcedTea7 under Debian Etch (3/2008)

Similar to IcedTea6. Don't forget to use the 'forest' Mercurial plug-in as explained above.

wget http://icedtea.classpath.org/download/source/icedtea-1.6.tar.gz
tar xzf icedtea-1.6.tar.gz
cd icedtea-1.6/                                                                                                           
.configure --with-...

HOWTO compile IcedTea6 under Debian Lenny (3/2008)

All dependencies are present in the system. We use GCJ-4.3/java-gcj-compat-dev for bootstrap. We just need to specify gjar instead of fastjar (which lacks option -J):

apt-get install --assume-yes ant \
  libcupsys2-dev libxt-dev libxp-dev lesstif2-dev libasound2-dev libxtst-dev iceape-dev libgtk2.0-dev libgdk-pixbuf-dev \
  libungif4-dev libjpeg-dev libxalan2-java libfreetype6-dev unzip gawk
apt-get install --assume-yes java-gcj-compat-dev

unset JAVA_HOME
./configure --with-jar=gjar-4.3
make

HOWTO build IcedTea6 Ubuntu packages under Debian Lenny (4/2008)

Here's a method to rebuild the Ubuntu package. TODO: this is incomplete because of missing run-time Java dependencies that need to be recompiled/backported too. This is becoming obsolete because IcedTea6 is now in Debian: http://packages.debian.org/source/lenny/openjdk-6

  • Install pbuilder (to automatically retrieve build dependencies and avoid invading your system with -dev packages):
aptitude install dget pbuilder cowdancer cdebootstrap fakeroot dpkg-dev
cowbuilder --create --distribution=lenny
  • Download the source package
dget http://archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-6/openjdk-6_6b08-0ubuntu4.dsc
dpkg-source -x openjdk-6_6b08-0ubuntu4.dsc
cd openjdk-6-6b08/
  • Alter the build dependencies, as debian/rules forces using g++-4.3, but the build-deps don't match (alternatively we could fix debian/rules):
cat <<EOF | patch -p0
--- debian/control~     2008-04-08 17:17:23.000000000 +0200
+++ debian/control      2008-04-08 17:25:17.000000000 +0200
@@ -3,7 +3,7 @@
 Priority: extra
 Maintainer: Matthias Klose <doko@ubuntu.com>
 Uploaders: Michael Koch <konqueror@gmx.de>
-Build-Depends: debhelper (>= 5), autotools-dev, lzma, m4, lsb-release, wget, zip, unzip, sharutils, gawk, pkg-config, procps, automake, autoconf, ant, g++-4.2 [amd64 powerpc], g++-4.1 [i386 lpia], gcj (>= 4:4.2.1), ecj, java-gcj-compat-dev (>= 1.0.76-2ubuntu3), libxtst-dev, libxi-dev, libxt-dev, libxp-dev, libxaw7-dev, libcupsys2-dev, lesstif2-dev, libasound2-dev, libfreetype6-dev, libxalan2-java, liblcms1-dev, libxinerama-dev, libffi4-dev [!amd64 !i386 !lpia], libjpeg62-dev, libpng12-dev, libgif-dev | libungif4-dev, zlib1g-dev,  fastjar, mauve, xvfb, autoconf, automake
+Build-Depends: debhelper (>= 5), autotools-dev, lzma, m4, lsb-release, wget, zip, unzip, sharutils, gawk, pkg-config, procps, automake, autoconf, ant, g++-4.3, gcj (>= 4:4.3), ecj, java-gcj-compat-dev (>= 1.0.76-2ubuntu3), libxtst-dev, libxi-dev, libxt-dev, libxp-dev, libxaw7-dev, libcupsys2-dev, lesstif2-dev, libasound2-dev, libfreetype6-dev, libxalan2-java, liblcms1-dev, libxinerama-dev, libffi4-dev [!amd64 !i386 !lpia], libjpeg62-dev, libpng12-dev, libgif-dev | libungif4-dev, zlib1g-dev,  fastjar, mauve, xvfb, autoconf, automake
 Standards-Version: 3.7.3
 Homepage: http://openjdk.java.net/
 XS-Vcs-Bzr: bzr+ssh://<user>@bazaar.launchpad.net/~ubuntu-java/uj/openjdk6
EOF
  • Build:
pdebuild --pbuilder cowbuilder
  • You now can install /var/cache/pbuilder/result/openjdk-6*.deb.


Note: if at a point the build-dependencies are fixed, you'll only need to:

VERSION="6b08-0ubuntu4"
dget http://archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-6/openjdk-6_$VERSION.dsc
cowbuilder --build openjdk-6_$VERSION.dsc


There's also a missing tzdata-java dependency which is not packaged in Debian yet. Same technique:

dget http://archive.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata_2008b-1ubuntu1.dsc
cowbuilder --build tzdata_2008b-1ubuntu1.dsc
dpkg -i /var/cache/pbuilder/result/tzdata-java_2008b-1ubuntu1_all.deb

Apparently there's a last java-access-bridge dependency, same problem. This one depends on openjdk which needs to be already built, and available to your cowbuilder, which complicates things. More about this soon.

Building Icedtea on Debian (Lenny) PowerPC

Here are some instructions to build Icedtea on Debian (Lenny).

Thanks to send a mail if you see a bug in the instructions: avdyk AT debian DOT org.

You can also build icedtea from the Icedtea Ubuntu package using debuild or your favorite Debian tool

Install dependencies

apt-get install libjpeg62-dev libungif4-dev autotools-dev m4 lsb-release \
  wget procps automake autoconf g++ ecj g++-4.2 ant libxtst-dev libxi-dev \
  libxt-dev libxp-dev libxaw7-dev libcupsys2-dev lesstif2-dev \
  libasound2-dev libfreetype6-dev libxalan2-java liblcms1-dev \
  libxinerama-dev gawk pkg-config libbonobo2-dev libatspi-dev \
  at-spi libgtk2.0-dev iceape-dev openssl ca-certificates \
  mercurial libxul-dev lynx java-gcj-compat-dev zip unzip

And install the Forest extension for Mercurial:

http://mail.openjdk.java.net/pipermail/build-dev/2007-October/000342.html

http://blogs.sun.com/jmxetc/entry/how_i_installed_the_mercurial

Get a copy of latest Icedtea

hg clone http://icedtea.classpath.org/hg/icedtea
cd icedtea

Apply a patch for Debian PowerPC

lynx -source http://people.debian.org/~avdyk/icedtea/Makefile.am.patch | patch -p0

Download some patches

wget http://people.debian.org/~avdyk/icedtea/const_strings.patch
wget http://people.debian.org/~avdyk/icedtea/arguments.patch

Configure and make

In Debian, we have to use an alternate jar (not fastjar that is shipped with gcj) You can use gjar.

unset JAVA_HOME
./configure \
    --with-gcj-home=/usr/lib/jvm/java-1.5.0-gcj-4.2-1.5.0.0 \
    --with-libgcj-jar=/usr/share/java/libgcj-4.2.jar \
    --prefix=/usr/local/icedtea \
    --with-jar=gjar-4.2

Make

DISTRIBUTION_PATCHES="const_strings.patch arguments.patch" \
    make 2>&1 | tee log

Links and references

Personal tools