Howto install QT 4.2 and QtRuby 1.4.6 on Mac OS X Tiger

Monday, October 16th, 2006 at 6:30 pm

I had some (minor?) trouble to get QtRuby 1.4.6 and QT 4.2 running on my Mac (PowerPC, 10.4.8). However, with some help from Richard Dale (thank you!) and the Korundum forum I got it working.

Install QT 4.2

First, download QT 4.2 for your Mac. Unpack it and configure it with at least the “-no-framework” option, the remaining parameters are as far as I know up to you. And DON’T use the -prefix option (some people recommended this to put it in /Developer/qt), otherwise QtRuby 1.4.6 won’t find the QT stuff (Default installation path of QT is currently /usr/local/Trolltech/Qt-4.2.0).

>  ./configure -no-framework -system-zlib -qt-gif -qt-libpng -no-debug \
            -no-stl -no-exceptions -fast
 
>  make
>  sudo make install
>  export QTDIR=/usr/local/Trolltech/Qt-4.2.0
>  export PATH=$QTDIR/bin:$PATH</code>

Install QtRuby

Note: This is only to get version <=1.4.6 to work !!!

  • Fix missing headers – don’t link them, copy them (otherwise the build script will fail!)
    > sudo cp /usr/lib/ruby/1.8/universal-darwin8.0/*.h /usr/lib/ruby/1.8/powerpc-darwin8.0
  • Check out some updates of kalyptus we need to add to QtRuby Release 1.4.6
    svn co -r 588725 svn://anonsvn.kde.org/home/kde/trunk/KDE/kdebindings/kalyptus/
  • Download qt4-qtruby 1.4.6 and unpack
  • Copy from the previous svn checkout the files “kalyptus” and “kalyptusCxxToSmoke.pm” into the kalyptus folder of qtruby
  • According to this article we need to comment out the main() function of qtruby/bin/qtrubyinit.cpp
  • In the root of qt4-qtruby you run:
    > ./configure --with-smoke="qt" --enable-mac --with-qt-dir=/usr/local/Trolltech/Qt-4.2.0 
    > make
    > make install
    > cd /ruby/lib/ruby/site_ruby/1.8/powerpc-darwin8.0 
    > sudo mv qtruby.so qtruby.bundle
  • Test your Qt installation:
    > irb
    irb(main):001:0> 
      require 'Qt'
      a = Qt::Application.new(ARGV)
      hello = Qt::PushButton.new("Hello World!", nil)
      hello.resize(150, 50)
      hello.show()
      a.exec()

Enjoy playing with QtRuby ;)
Thanks to all developers making this possible and thanks for the support!

by markus

3 Responses to “Howto install QT 4.2 and QtRuby 1.4.6 on Mac OS X Tiger”

  1. lorenzo Says:

    Hi,
    with qt 4.2.3 following your instructions step by step I’ve these errors from the compiler:

    make all-recursive
    Making all in smoke
    Making all in qt
    perl generate.pl
    Found ‘qtdefines’. Reading preprocessor symbols from there…
    Global symbol “$qt_defines” requires explicit package name at (eval 1) line 3.
    Global symbol “$qt_defines” requires explicit package name at (eval 1) line 3.
    Global symbol “$qt_defines” requires explicit package name at (eval 1) line 3.
    Global symbol “$qt_defines” requires explicit package name at (eval 1) line 3.
    Global symbol “$qt_defines” requires explicit package name at (eval 1) line 3.
    Global symbol “$qt_defines” requires explicit package name at (eval 1) line 4.
    Global symbol “$qt_defines” requires explicit package name at (eval 1) line 4.
    Global symbol “$qt_defines” requires explicit package name at (eval 1) line 4.
    Global symbol “$qt_defines” requires explicit package name at (eval 1) line 4.
    Global symbol “$qt_defines” requires explicit package name at (eval 1) line 4.
    …propagated at ../../kalyptus/kalyptus line 229.
    make[3]: *** [smokedata.cpp] Error 255
    make[2]: *** [all-recursive] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2

    I’m using /developer/qt as QTDIR

    Thanks
    Lorenzo

  2. lorenzo Says:

    ehm 4.3.1
    sorry
    :)

  3. [ANN] QtRuby 1.4.6 | keyongtech Says:

    [...] It works now and I have summarized the installation of QT 4.2 and qt4-ruby 1.4.6 on a Mac here: http://www.markus.brosch.net/?p=110 Thanks again and best regards! — Posted via http://www.ruby-forum.com/. [...]

Leave a Reply

Bot-Check