Sunday, April 08, 2007

How To Build A New Freetype

I've had several requests for my RPM for freetype2 including sub-pixel rendering for openSUSE 10.2. So here are instructions on how to build your own, including my modified SPEC file. If you're in the USA it might be illegal to download my file, so this file is only for people who live in free countries. Or at least semi-free countries, like the UK.

  1. Download freetype2 source rpm from http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/suse/src/ - it might be a newer version by the time you come to download this.
  2. Download freetype-2.3.3.tar.bz2 and freetype-doc-2.3.3.tar.bz2 from freetype.org.
  3. Download freetype2.spec if your government will let you.
  4. Install the source rpm: sudo rpm -ivh freetype2-2.3.1-7.src.rpm
  5. Put the tar.bz2 files in /usr/src/packages/SOURCES
  6. Put the spec file in /usr/src/packages/SPECS
  7. Build the rpm: rpmbuild /usr/src/packages/SPECS/freetype2.spec
  8. The built rpms will be in /usr/src/packages/RPMS/i586
Note that you will need to have any required libraries and tools installed in order to build this. It should just be the basic development tools I think.

3 comments:

Loki said...

Easier:
1) download http://ftp.skynet.be/pub/suser-guru/rpm/experimental/packages/freetype2/src/freetype2-2.3.3-0.1.guru.suse102.src.rpm
2) rebuild like this:
rpmbuild --rebuild \
--with subpixel \
freetype2-2.3.3-0.1.guru.suse102.src.rpm

If you're on 32bit, you'll most probably also want to pass the option --target=i586 to rpmbuild

Anonymous said...

@loki
>pass the option --target=i586 to rpmbuild

Having done so, I could not install i586 package on x86_64 Suse, since the 586 rpm claims to provide libfreetype.so.6(64bit) instead of i586 version. This breaks dependencies. How can I fix the situation? Otherwise, x86_64 rpm works like a charm for me, many thanks!

Unknown said...

There's a couple of threads on the Suse forums about the missing freetype2 32-bit compat on x86_64 when you use rpmbuild. At best they claim you can uninstall the 32-bit compat which in turn should offer to install the i586 version to resolve dependencies. I can't seem to get this to work right and would still like to see how to build the 32-bit compat package to begin with.

Seems to be a big mystery on how to do this. Wondering if it's just an RPM package name "problem".