Qt compilation on a fresh Ubuntu 11.10

28 januari, 2012

After I installed a fresh copy of Ubuntu’s 11.10 version on my laptop, one of the first tasks (after installing gvim of course) was getting Qt on my machine.

Turned out it was a bit more painful than the docs describe…

Due to the deployment issues at work, I’m currently bound of using Qt 4.7.4 rather than the newest kid in town, being 4.8.0.  Therefor I was forced to compile the whole lot from source.

Gcc is installed straight out of the box, but the ‘build-essential’ tools are required, else you can’t actually compile:

The docs then dictate to ./configure, make and sudo make install.  And I did.  After an hour of 2 or 3 (who keeps track, right), I launched qtconfig.

I noticed Qt used a double spaced font ‘Batang’, and I couldn’t set it to a more decent (like in readable) font…

Some google searches later I learned that you need to configure it with the -fontconfig, in order to use the anti-aliased fonts of your Ubuntu installation.  If you just run ‘make clean && ./configure -fontconfig’ you’ll get a configuration error that ‘FontConfig support cannot be enabled due to functionality tests!’.  Bollocks.

To get rid of that problem, you’ll need to ‘sudo apt-get install libfontconfig1-dev’, and then configure the Qt source with the fontconfig option enabled, and you’ll be all set up and good to go.


Python 32-bit execution on Snow Leopard using virtualenv

28 februari, 2010

One of the first things I wanted to do when I bought my new Imac, was installing PyQt4, because we are going to use this at work.

Because I didn’t want to pollute my shiny new system, I decided to use the virtualenv technology.

After reading the documentation, I found out it wasn’t as evident as I thought it was going to be.

In order to install PyQt4 on Snow Leopard, you’ll need to install QT.  Easy enough, as this is simply installing a dmg.  However, as far as I know this is installed systemwide, and thus not only in a virtual environment.  Not exactly a problem for me.

Then I created a new virtual environment:

cd ~/environments/

virtualenv PyQt4

Then we can enter the new virtual environment:

cd ~/environments/PyQt4

source bin/activate

Then I downloaded sip and PyQt4 sources for MacOS X and unpacked them.

Because (the already installed) is only availble in a 32-bit version, and Snow Leopard is 64-bit by default, we have to configure both packages to work as 32-bit.  First sip:

cd sip-4.10

python configure.py –destdir /Users/bram/Development/python/environments/PyQt4/lib/ –bindir /Users/bram/Development/python/environments/PyQt4/bin/ –incdir /Users/bram/Development/python/environments/PyQt4/include/ –arch i386
make

make install

This will configure sip inside the virtual environment, without polluting the entire system.  Please note the –arch i386 parameter, which is necessary for PyQt4 to compile without errors in the next step:

cd ../yQt-mac-gpl-4.7

python configure.py –destdir /Users/bram/Development/python/environments/PyQt4/lib/ –bindir /Users/bram/Development/python/environments/PyQt4/bin/ –use-arch i386


Follow

Get every new post delivered to your Inbox.