(This assumes an x86 system – although ppc also works as long as you replace all the so files!)
In order to get Titanium working on Gentoo, you will need to build a few things yourself since they don’t have a patch for webkit (yet – they are working on it
) and also a few other files will need to be replaced.
This is how I did it. First I checked out the titanium git repository
cd ~/sandbox
git clone git://github.com/marshall/titanium.git
git submodule update --init
cd kroll
git pull origin master
cd ~/sandbox
I read through the readme, and installed the different dependencies.
sudo apt-get install build-essential ruby rubygems libzip-ruby scons libxml2-dev libgtk2.0-dev python-dev ruby-dev libdbus-glib-1-dev libnotify-dev libgstreamer0.10-dev libxss-dev libcurl4-openssl-dev
is their suggestion, however on Gentoo, these are a lot different.
I found that libzip-ruby (rubyzip?) was not needed, and on Gentoo installing the packages themselves gives you the “dev” packages, so
emerge ruby rubygems scons libxml2 gtk+ dbus-glib libnotify gstreamer libXScrnSaver curl gperf
Once this is finished, you will have to do a little bit more work – We don’t need poco installed, but we will need to compile it ourselves, along with the titanium version of webkit (they’ve got it “patched” to support app:// urls – no actual patch yet (but they are working on it!))
We also need to use their version of libcurl, which is also patched, however again, we don’t need to install it to our system, just build it.
git clone git://github.com/mrobinson/libcurl_titanium.git
after the checkout, we just ./configure && make
Now we need to check out their copy of webkit, please note that this one WILL take a while to check out, so go grab a coffee, watch a good TV show, or perhaps hit the pub with some friends (I prefer the latter)
git clone git://github.com/marshall/webkit_titanium.git
… some random amount of time later…
git checkout --track -b titanium_pr2 origin/titanium_pr2
Now we are on the titanium_pr2 branch, which is what is currently in use, although they are migrating to ToT for WebKit which will allow us to use libsoup in the future, rather than the curl that is currently in use.
We need to link against the libcurl_titanium and not against the system libcurl, so we need to export 2 variables.
export LIBCURL_CFLAGS ="-I/home/username/sandbox/libcurl_titanium/include"
export LIBCURL_LIBS ="-L/home/username/sandbox/libcurl_titanium/lib/.libs -lcurl"
and then we just use the build.py script to build since we won’t be installing this into the system either. so…
./autogen.sh
./build.py
Depending on your processor (this takes around 15 hours on my Efika which is 400mhz with 128mb of ram) go ahead and go back to the pub, go to work, cook yourself a nice meal… you get the picture.
Once it is finished, assuming the titanium checkout is in ~/sandbox/titanium and the webkit_titanium checkout is in ~/sandbox/webkit_titanium you just run ./copy-libs-to-kroll.sh
Now we need to build poco, you can either emerge it, or just fetch it via emerge, and build it in your ~/sandbox (or wherever you are doing this at) once it is built (it really doesn’t take that long) you need to copy the .so files to ~/sandbox/titanium/kroll/thirdparty/linux/poco/lib/ – you can look at what is currently in there to know which files to copy. I tend to use cp -a so that the symlinks stay symlinks. You need to copy the libcurl .so files that were built in ~/sandbox/libcurl_titanium/lib/.libs into ~/sandbox/titanium/kroll/thirdparty/linux/libcurl/lib – again just the files that are needed.
As part of building webkit (assuming you didn’t have it installed on your system, you need to build icu, currently 3.8.1-r1 is the latest in portage, which is what is currently used in titanium as well.
I’ve submitted a few patches that have already been implemented to allow for the different paths for python and ruby that Gentoo uses, so at this point you should be able to go into ~/sandbox/titanium and run scons debug=1 dist and it should build. Once the compilation is completed, you should have a ~/sandbox/titanium/build/linux/dist directory which includes the titanium sdk as a .bin file as well as a .tgz file. Simply run either sudo sh titanium-sdk-0.4.bin or chmod +x titanium-sdk-0.4.bin && sudo ./titanium-sdk-0.4.bin in order to install it.
Please note – at the time of this writing, PR3 has been released, and the current master is what PR4 (or beta) is going to be based on. This is *very* much in flux, and it may be hit or miss on compiling and/or installing. Currently when installed (which needs to be done as root) the files do not all get the proper permissions, and you will likely need to go into /opt/titanium/modules and change all the .so files to be 755 and all the manifest files to 644. There may be others as well, but I cannot recall at the moment.
As a side note: if you want to use what is known as the PR3 release, you can (and probably should) use checkout --track -b titanium_pr3 origin/titanium_pr3 inside ~/sandbox/titanium as well as making sure to switch to the titanium_pr3 branch in kroll if you do that. (but why would we? We’re Gentoo users, we like bleeding edge
)
At this point you have a working Titanium Developer that you can run via the console ~/TitaniumApps/Titanium\ Developer/Titanium\ Developer
Enjoy writing webapps that don’t require Adobe Air!
Also, if you find any issues with this post please leave a comment and I will try to get it corrected as soon as possible.
steev General