Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

Monday, June 30, 2008

Solipse for Eclipse on solaris-gtk-x86

Many thanks to Hugo Garcia for setting up the Solipse project to house our progress in creating a distributable build of Eclipse for solaris-gtk-x86. The scripts that I had previously posted on this blog have now been moved to the downloads area of the project site. We have successfully been able to build fully-functional Eclipse distributions (sans the internal browser and OpenGL support) from 3.3 to 3.4 on OpenSolaris and Nexenta, and our goal is currently to iron out the last details of the SWT browser component, OpenGL support and the p2 SDKProfile and to contribute the binaries back to eclipse to make the build official.
Thanks to everyone who sent suggestions and who found some use for the initial scripts, and please feel welcome on the Solipse community site!

Monday, February 11, 2008

Eclipse 3.4M5 solaris-gtk-x86 Build Script for Nexenta

Last week I finally installed NexentaCP Beta since the Gnusolaris Alpha apt repository has been taken offline. I probably could have found an indirect way to upgrade from Alpha to Beta but opted to wipe the window clean. The re-install was completely painless. Getting the nexenta-gnome desktop required adding the unstable repository to my /etc/apt/sources.list. Upgrading to the unstable repository gave me a small taste of the new Nexenta and the power of ZFS. The ease of the debian-based update manager had always impressed me, but adding ZFS to the mix makes the entire process worry-free as well. If an upgrade ever goes wrong, rolling back to a previous state is easy.

My Nexenta upgrade coincided nicely with the release of Eclipse 3.4M5. Because I had to re-install Eclipse anyway, and because a shiny new Nexenta install deserves nothing less than the latest-and-greatest Eclipse release, I downloaded the M5 source, installed the Eclipse build dependencies, ran my 3.4M4 modification script and with a few minor tweaks was quickly able to get Ganymede up and running, Java editor bread-crumb saccharine and all.
The script for building Eclipse 3.4 M5 for solaris-gtk-x86 can be downloaded from the solipse downloads page. Please be aware of the Nexenta-specific instructions for building the SWT library with gcc instead of SunStudio cc.
 


Eclipse 3.4 M5 running on Nexenta (Solaris) x86 GTK.
Breadcrumbs in the Java Editor are one of the sauciest additions to this latest release. Even though they do not add functionality that is not already in the workbench and they occupy precious screen real estate, they are great eye candy.

Monday, January 7, 2008

Eclipse 3.4M4 solaris-gtk-x86 Build Script for Nexenta

The following script is based on another script for compiling Eclipse 3.3 for Nexenta (solaris-gtk-x86). The build process changed slightly from version 3.3, particularly in the native compilation of the eclipse launcher. If you are curious to see what needed to change, you can diff the 3.4M4 and 3.3 scripts. I have not used Eclipse 3.4M4 extensively yet, but from some initial trials, the version I have built with this script seems to be working well. As always, if this post has been of any use, please let me know.
You should be able to drop the script into a directory that contains the eclipse-sourceBuild-srcIncluded-3.4M4.zip, execute it, and it will decompress the archive, modify the build scripts to support nexenta with gtk on x86, and create a distibutable file in the result directory.

The script can now be downloaded from the solipse downloads page.  Be aware of the Nexenta-specific configurations for compiling the SWT libraries.


The Ganymede splash-screen on nexenta solaris-gtk-x86.
The Ganymede splash-screen on nexenta solaris-gtk-x86.

The Ganymede workbench on nexenta solaris-gtk-x86.
The Ganymede workbench on nexenta solaris-gtk-x86.

Eclipse 3.3 solaris-gtk-x86 Build Script for Nexenta

The following script was extracted from another blog posting about compiling Eclipse 3.3 for Nexenta (solaris-gtk-x86). I have separated it out and modified the original post because most of the steps for figuring-out dependencies are valid for building Eclipse 3.4M4 and building Eclipse 3.4M5, but the build itself is slightly different.
I have used this script to build Eclipse 3.3 for myself, have since programmed a bit with my version so I know it has worked for my basic needs and would be curious to know if anyone else has gotten any use out of it.
The script itself makes extensive use of the simple command-line find-and-replace syntax I wrote about here.
You should be able to drop the script into a directory that contains the eclipse-sourceBuild-srcIncluded-3.3.zip, execute it, and it will decompress the archive, modify the build scripts to support nexenta with gtk on x86, and create a distibutable file in the result directory.
The script can now be downloaded from the solipse downloads page.  Be aware of the Nexenta-specific configurations for compiling the SWT libraries.
 


The Europa splash-screen on nexenta solaris-gtk-x86.
The Europa splash-screen on nexenta solaris-gtk-x86.

The Europa workbench on nexenta solaris-gtk-x86.
The Europa workbench on nexenta solaris-gtk-x86.

Tuesday, October 9, 2007

Building Eclipse for solaris gtk x86 on Nexenta

As this is my first post, I wanted to contribute something useful.   Hopefully this post will help someone somewhere.  I am trying to solve the following problems:
  • How to install Nexenta and upgrade to the latest version (as of 10-08-2007).  Installation is easy, upgrading is not. 
  • How to install a zone so that we have a clean area for building Eclipse;  hopefully I will give you enough to get started in the latest version of Nexenta.
  • How to unpack Java and SunStudio to setup for an Eclipse build.
  • How to modify the Eclipse build scripts to create a distribution of solaris-gtk-x86 3.3 that runs on Nexenta.  Unfortunately, solaris-gtk-x86 is not a supported Eclipse distribution, and the scripts require a bit of change, but these steps should give you a good starting point and hopefully will give you an understanding of which parts of Eclipse are os-specific.

Without further ado, the first step in this process is below.  This should be an easy one, but it will be time-consuming to burn the .iso image and to install the OS.

Step 1: Install Nexenta Alpha 6


  • This is my hardware: Intel P3 750 with 1GB RAM and an 80GB hard drive.
  • Download the Alpha 6 .iso. I have read some postings that the CD install of Alpha 7 may not work and I have not tried to install this version. I prefer to upgrade instead.

Step 2: Upgrade Nexenta from Alpha 6 to the latest version in the Testing repository



Unfortunately, this is not quite as straightforward as it should be. There are threads in the Nexenta forums with information about why the upgrade process takes a couple of extra steps.

These instuctions can be performed from a terminal.
  • sudo apt-get remove samba (for some reason, when I had tried to upgrade previously with samba installed, I got an error that led to disaster in the form of Nested trap rebooting messages and an inability to reboot because of an incomplete upgrade, so I just took it out of the equation temporarily).
  • sudo reboot
  • sudo apt-get clean
  • sudo apt-get update
  • sudo apt-get dist-upgrade (by this point, you probably should have seen the dreaded message telling you to do an apt-get install -f).
  • sudo apt-get install-f (now allow the package manager to remove all your gnome packages but do NOT reboot).
  • sudo apt-get install gnome gnome-applets gnome-control-center gnome-core gnome-desktop-environment gnome-panel gnome-session gnome-terminal (this should re-install all the removed packages and some more).
  • sudo apt-get install totem-gstreamer-firefox-plugin (this one does not get re-installed in step 7, so do it manually).
  • sudo apt-get install dpkg apt (during the upgrade install previously, I had seen errors about the versions of dpkg and apt being incorrect, so I figured I should just upgrade those up front).
  • sudo apt-get update
  • sudo apt-get dist-upgrade (now there should be only one package that is getting removed -- libnewt0.51, but it will get replaced -- and a whole lot of other packages that will be upgraded and installed. This upgrade took about 45 minutes for me because a couple of connections timed-out, but it completed successfully and successfully rebooted after the upgrade).
  • sudo apt-get install samba (we uninstalled this previously).
  • sudo reboot.

Step 3: Create a New Zone


See these instructions for setting up a new zone for Nexenta. I named my zone eclipse_zone and put it in /export/home/zones/eclipse_zone.

Step 4: Install JDK 6 in the eclipse_zone


See these instructions for setting up the JDK in a new base Nexenta zone.

Step 5: Install Sun Studio 12



Even though Nexenta provides installations of gcc and cc, I chose to include a step in here for installing Sun Studio 12. A standalone, non-solaris package version of this is available for download through the Sun Developer Network. It is free to sign up and the download is free.
Again, do NOT download the solaris package version. Instead, download the standalone archive. This will install both Sun Studio and Netbeans 5.5.1.
I use SunStudio in the Eclipse build for its cc compiler, for all native libraries except the SWT (see the script below for the reason). I have not tried to build Eclipse using just the gcc compiler, but I don't see why this would not work with some changes to the build scripts (for example, all -K PIC arguments would need to be changed to -fPIC for gcc). If you have built Eclipse entirely using gcc on Solaris, please send me a link to your instructions as I would be interested in trying this!
  • copy SunStudio12-solaris-x86-200705-ii.tar to /usr/opt
  • root@eclipse_zone:~# cd /usr/opt
  • root@eclipse_zone:/usr/opt# tar -xf SunStudio12-solaris-x86-200705-ii.tar

You should now have SunStudio and Netbeans installed in the eclipse_zone. I have not tried to start SunStudio or Netbeans from inside a zone -- I would guess offhand that this would not work since there is no X server running inside the zone, but it might be worth trying out sometime.

Step 6: Set up Nexenta packages required for Eclipse compilation



There are a few packages that must be installed in the zone before the Eclipse libraries will compile. Some of these packages are installed with the full Nexenta desktop, so if you are installing in the root zone, they may already be available to you. In a different vein, I originally tried to compile the required gtk+ libraries from scratch (along with all the dependencies such as cairo, pango, freetype, etc.). Unfortunately, this turned out to be a rather large time sink for me, as I was able to install the libraries, but I ran into collisions with some of the libraries that already existed from my nexenta install. If you would like all the latest and greatest versions of gtk+, then it might be a good idea for you to contribute those libraries to nexenta's unstable package installation branch. If you are able to do this successfully, I would really like to see some instructions for this. In any case, I did not pursue this because my goal is to get Eclipse 3.3 compiling and running, and the existing nexenta packages fulfill the Eclipse pre-requisites. The following instructions can be performed from a terminal.
  • root@eclipse_zone:~# apt-get install libgnomeui-dev
  • root@eclipse_zone:~# apt-get install libxtst-dev
  • root@eclipse_zone:~# apt-get install libxt-dev
  • root@eclipse_zone:~# apt-get install make
  • root@eclipse_zone:~# apt-get install gcc
  • root@eclipse_zone:~# apt-get install unzip
  • root@eclipse_zone:~# apt-get install zip

Step 7: Install Apache Ant



Finally, a step that is straightforward and that works as expected!
Download the apache ant binary.
  • copy apache-ant-1.7.0-bin.tar to /usr/opt
  • root@eclipse_zone:~# cd /usr/opt
  • root@eclipse_zone:/usr/opt# tar -xf apache-ant-1.7.0-bin.tar

Step 8: Set your environment variables



These environment variables are necessary for the Eclipse build process.
  • root@eclipse_zone:~# export JAVA_HOME=/usr/opt/jdk1.6.0_02
  • root@eclipse_zone:~# export ANT_HOME=/usr/opt/apache-ant-1.7.0
  • root@eclipse_zone:~# export CC=/usr/opt/SUNWspro/bin/cc
  • root@eclipse_zone:~# export PATH=$ANT_HOME/bin:$PATH

Step 9: Dig into the Eclipse build scripts



In my original post I included just a laundry list of commands to modify the Eclipse build scripts from the command-line, but in the spirit of continuous improvement, I have since extracted the commands from that original post into a shell script both to automate the process and because the script better conveys the intention of the modifications I made. This script for building Eclipse 3.3 is now in a dedicated post of its own, along with similar scripts for building Eclipse 3.4M4 and for building Eclipse 3.4M5.

The versions of Eclipse that I am currently running (Europa and Ganymede) were built from these scripts in the global zone, not in an eclipse-specific build zone. As with my install of Pidgin, I often find that it is best to perform an initial build of some software in a dedicated zone to work out dependencies. Since Pidgin and Eclipse both use the X Server graphics libraries, I plan to run them in the global zone. In this case, I decided to perform my actual Eclipse build in the global zone. The instructions below assume that you are building Eclipse in its own zone, but you can certainly perform the build in the global zone as I did.

Originally, I found directions that provide a good starting point and good ideas for scripting some of the process outlined below, but I was not completely successful with the instructions because of the dependency the Eclipse build process has on compiling the cde libraries for Solaris.  For a Nexenta Solaris build, we will not be using the cde libraries, but rather the gnome libraries.  The Eclipse Nexenta build is more like a combination of the Linux and Solaris builds than a straight port of the Solaris Sparc build.

Download the eclipse source build eclipse-sourceBuild-srcIncluded-3.3.zip

  • root@eclipse_zone:~# mkdir /usr/opt/eclipse
  • copy eclipse-sourceBuild-srcIncluded-3.3.zip to /usr/opt/eclipse
  • root@eclipse_zone:~# cd /usr/opt/eclipse
  • copy the script above to /usr/opt/eclipse and name it build_eclipse.sh
  • root@eclipse_zone:/usr/opt/eclipse# chmod 755 build_eclipse.sh
  • root@eclipse_zone:/usr/opt/eclipse# ./build_eclipse.sh


After a long time (on my P3 750Mhz, it takes about 110 minutes), there should be a packaged version of eclipse for solaris x86 with the gtk windowing libraries named /usr/opt/eclipse/result/solaris-gtk-x86-sdk.zip

Keep in mind that you will need to run this version of Eclipse with Java 6, or else you will see a nasty stack trace about the incorrect Java version if you try to launch eclipse. For my own setup, I created a desktop launcher that points to a small wrapper script that looks like this:

#!/bin/sh

export JAVA_HOME=/path/to/jdk1.6.0_02
export PATH=$JAVA_HOME/bin:$PATH
/path/to/eclipse/eclipse

So you should now (hopefully) have a working version of Eclipse on Nexenta.  If you have found this helpful, or if you find any improvements that can be made, please let me know.

Note: since first posting this entry, I have received a good amount of feedback and it has developed into the Solipse project.  I am happy this initial post was useful to a number of people and am happy to keep contributing toward an officially-supported eclipse solaris-gtk-x86 distribution.