My words on free/open source software

Sunday, March 15, 2009

Compiling GIMP 2.6.5 on CentOS 5

GIMP 2.6.5 is the fantastic tool for photographers that live in the free world. But sadly it has no official RPM built for CentOS/RHEL users. I have spent 4 hours and compiled GIMP 2.6.5 on CentOS 5 for Tina by using the official tarball.

I planned to use the GIMP SRPM from Fedora Rawhide (which was 2.6.5) but after Fedora 10 the Rawhide had moved to a new format of RPM and I have no way to install nor unpack those new SRPMs to get the code (neither on CentOS 5 or Debian Unstable). Therefore I had to fall back to use official tarball and install it to /opt. By this I lost the benefit of package management. So I have no RPM here to share with you but only a rough record of the steps:

  1. download, build and install babl 0.0.22

  2. download, build and install gegl 0.0.22

  3. install intltool RPM from Fedora 10

  4. download gettext SRPM (gettext-0.17-8.fc10.src.rpm) from Fedora 10 and rpmbuild it (with Java disabled). the GCJ shipped with CentOS 5 couldn't compile the Java code within gettext so they had to be disabled by the patch following.

  5. build GIMP 2.6.5


The patch to disable Java of gettext:

--- /usr/src/redhat/SPECS/gettext.spec 2008-08-29 09:07:58.000000000 +0800
+++ gettext-for-el5.spec 2009-03-15 11:06:11.000000000 +0800
@@ -1,5 +1,5 @@
# libintl.jar requires gcj >= 4.3 to build
-%define buildjar 1
+%define buildjar 0

Summary: GNU libraries and utilities for producing multi-lingual messages
Name: gettext
@@ -86,12 +86,12 @@
export JAR=fastjar
%endif
%configure --without-included-gettext --enable-nls --disable-static \
- --enable-shared --with-pic-=yes --disable-csharp --enable-java \
+ --enable-shared --with-pic-=yes --disable-csharp --disable-java \
--disable-rpatha
make %{?_smp_mflags} GCJFLAGS="-findirect-dispatch"

# For generating gettext-tools/src/gnu.gettext.*
-make -C gettext-tools/src gnu.gettext.DumpResource
+#make -C gettext-tools/src gnu.gettext.DumpResource


%install
@@ -215,7 +215,7 @@
%{_infodir}/gettext*
%{_mandir}/man1/*
%{_libdir}/%{name}
-%exclude %{_libdir}/%{name}/gnu.gettext.*
+#%exclude %{_libdir}/%{name}/gnu.gettext.*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/archive.tar.gz
%{_datadir}/%{name}/styles
@@ -244,8 +244,8 @@
%{_libdir}/preloadable_libintl.so
%{_mandir}/man3/*
%{_datadir}/%{name}/javaversion.class
-%doc gettext-runtime/intl-java/javadoc*
-%{_libdir}/%{name}/gnu.gettext.*
+#%doc gettext-runtime/intl-java/javadoc*
+#%{_libdir}/%{name}/gnu.gettext.*


%files libs

4 comments:

Niels.Linnemann said...

Hey nice guide. really like it.

One comment though for newcomers maybe post the method of patching the gettext file. It will help a lot of users in the future I think.

Thx again :-)

Niels.Linnemann said...

Hi again

Well found out that you have left out that you need a newer Glib 2 than the default CentOS.

In order to compile gegl you need Glib >= 2.16 and the default CentOS has 2.12.

So in between babl and gegl one need Glib 2 >= 2.16.

Regards

Unknown said...

Please see http://wiki.centos.org/HowTos/RebuildSRPM to learn how to use the "--nomd5" flag for those problematic Fedora SRPMS.

Yan Li said...

Thanks Phil. I'll build and upgrade my installation when GIMP 2.8 is released.

About Me

My photo
Santa Cruz, California, United States