<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>One hand clapping &#187; gtk</title>
	<atom:link href="http://warped.org/blog/tag/gtk/feed/" rel="self" type="application/rss+xml" />
	<link>http://warped.org/blog</link>
	<description>Max Baker -- A Man with a Hand</description>
	<lastBuildDate>Mon, 12 Mar 2012 18:25:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>chown3d Part 2 &#8211; GTK+ and GLIB in your own home directory</title>
		<link>http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/</link>
		<comments>http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 19:44:16 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[chown3d]]></category>
		<category><![CDATA[glib]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=34</guid>
		<description><![CDATA[ch0wned. adj. This is the state when you are a linux user and don't have root access. For today&#8217;s installment we go over getting some basic libraries up to shape. If your Linux distro is old enough, you can&#8217;t use 3rd party binaries like Adobe Acrobat Reader (acroread), Firefox, and Flash because the GTI+ and [...]]]></description>
			<content:encoded><![CDATA[<p><tt>ch0wned. adj. This is the state when you are a linux user and don't have root access. </tt></p>
<p>For today&#8217;s installment we go over getting some basic libraries up to shape.   If your Linux distro is old enough, you can&#8217;t use 3rd party binaries like Adobe Acrobat Reader (acroread), Firefox, and Flash because the GTI+ and GLIB libraries that they are compiled against are just too damned old.   So we have to both install local copies, and have the applications find those copies instead of the system ones. </p>
<h2>On Versions</h2>
<p>It&#8217;s good to note that you can upgrade a <i>newer</i> version of most things, but don&#8217;t expect to always get the <i>newest</i> version.  Instead you need to find the next newest version that still works on your old Linux distro while satisfying the prerequisites for your favorite applications.</p>
<h2>GTK+ and GLIB and RHEL4</h2>
<p>Here are the packages I installed in order to get GTK+ and GLIB up to date enough to use Firefox, Pidgin, Thunderbird, Acrobat, and some other goodies on Red Hat EL4 (Fedora 4 should be similar) :</p>
<ol>
<li>atk-1.25.2.tar.bz2 &#8211; Needed by Pidgin
</li>
<li>pixman-0.13.2.tar.gz
</li>
<li>libxml2-2.6.30.tar.bz2 &#8211; Needed by Pidgin, the EL4 version is horribly broken and Gtalk / Jabber end up w/ a very weird send-only behavior
</li>
<li>pkg-config-0.23.tar.gz &#8211; Needed by most everything.  You will have a new package repository in $HOME/lib/pkg-config for your new libraries.
</li>
<li>cairo-1.8.6.tar.gz
</li>
<li>dbus-1.2.12.tar.gz
</li>
<li>dbus-glib-0.78.tar.gz
</li>
<li>glib-2.19.5.tar.bz2
</li>
<li>pango-1.22.4.tar.bz2
</li>
<li>zlib-1.2.3.tar.bz2 &#8211; RHEL4 version is crap.
</li>
<li>gtk+-2.14.7.tar.bz2
</li>
</ol>
<p>Order does count, but I don&#8217;t remember what order I compiled and installed these in.  Trial and error will tell.  Use <a HREF="http://warped.org/blog/2009/03/04/chown3d-a-linux-distro-in-your-home-directory/">config_gapp from Part 1</a> to compile.</p>
<p> You will need to do this on each of the above :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> xvfj gtk+-2.14.7.tar.bz2
$ <span style="color: #7a0874; font-weight: bold;">cd</span> gtk+-2.14.7
$ ..<span style="color: #000000; font-weight: bold;">/</span>config_gapp
$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Remember this is installing these libraries into $HOME/lib using the config_gapp script. </p>
<p>Some of the libraries might take some extra args to make things happy.</p>
<ol>
<li>zlib &#8211; I need to add -fPIC to make mozilla happy

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #007800;">CFLAGS</span>=-fPIC ..<span style="color: #000000; font-weight: bold;">/</span>config_gapp</pre></div></div>

</li>
<li>gtk+-2.14.7 &#8211; I had to add &#8211;without-libjasper
<pre lang=bash>$ ../config_gapp --without-libjasper</pre>
</li>
</ol>
<p>Some blood sweat and tears later, and now you should be able to run a binary version of Firefox if you are on a 32-bit RHEL4 machine. </p>
<h2>Running Apps using the Libraries in your Home Directory</h2>
<p>In order to have applications grab the libraries in your home directory instead of the system ones, I use a wrapper script that sets up a bunch of needed environment variables.  I call this script &#8220;run_gapp&#8221; :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># install apps using local versions of libraries for this platform</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This script is for an x86_64 machine</span>
<span style="color: #666666; font-style: italic;"># Remove 64 anywhere below if you are on a 32-bit build</span>
&nbsp;
<span style="color: #007800;">LOC_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>me
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CPPFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">${LOC_HOME}</span>/include -I/usr/X11R6/include <span style="color: #007800;">$CPPFLAGS</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">${LOC_HOME}</span>/include -I/usr/X11R6/include <span style="color: #007800;">$CFLAGS</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CXXFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">${LOC_HOME}</span>/include -I/usr/X11R6/include <span style="color: #007800;">$CXXFLAGS</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LDFLAGS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">${LOC_HOME}</span>/lib -L/usr/X11R6/lib -L/usr/lib64 <span style="color: #007800;">$LDFLAGS</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PKG_CONFIG_PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${LOC_HOME}</span>/lib/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/pkgconfig:<span style="color: #007800;">$PKG_CONFIG_PATH</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${LOC_HOME}</span>/lib:/usr/X11R6/lib64:/usr/lib64:<span style="color: #007800;">$LD_LIBRARY_PATH</span>&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #ff0000;">&quot;$@&quot;</span></pre></div></div>

<p>Now to run a binary we just use the wrapper</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">run_gapp <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>firefox</pre></div></div>

<p>Next up we&#8217;ll explore building some applications like pidign, firefox, amarok, xine-lib and more.</p>
]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

