Friday, March 20, 2009

Build QtRuby with Ruby 1.9.1 and Qt 4.5 #1

openSUSE 11.1 also supports QtRuby. Its packege name is "ruby-kde4" because openSUSE's rpm manages both QtRuby and Korundum(KDE bindings for Ruby) as one.
>rpm -q ruby-kde4
ruby-kde4-4.1.3-1.20

Of course, this one is built with package's ruby(1.8.7) and Qt(4.4.3). I should build with ruby(1.9.1) and Qt(4.5). How? I sought that in rubyforge, then found in forum. Thanks, Davor. I follow instructions written in this link. Davor's patch has been merged to svn trunk currently.
>svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdebindings
>svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
>cd kdebindings
>cp CMakeLists.txt.qtruby CMakeLists.txt
>cp ../kdelibs/cmake/modules/FindQt4.cmake ./cmake/modules/
>cp ../kdelibs/cmake/modules/FindRUBY.cmake ./cmake/modules/
>cp ../kdelibs/cmake/modules/MacroOptionalFindPackage.cmake ./cmake/modules/
>cp ../kdelibs/cmake/modules/MacroPushRequiredVars.cmake ./cmake/modules/

And create symlink from config.h to include path.
>sudo ln -s /opt/ruby-1.9.1/include/ruby-1.9.1/x86_64-linux/ruby/config.h /opt/ruby-1.9.1/include/ruby-1.9.1/ruby/config.h

Then I make cmake with build options. For my ruby 1.9.1 environment(phosphorescence: Install Ruby 1.9.1), I planned to took these values:
>cmake \
>-DCMAKE_INSTALL_PREFIX=/opt/ruby-1.9.1 \
>-DRUBY_EXECUTABLE=/opt/ruby-1.9.1/bin/ruby \
>-DRUBY_INCLUDE_PATH=/opt/ruby-1.9.1/include/ruby-1.9.1 \
>...

But I found notable 2 messages in output of cmake.
-- Found Qt-Version 4.4.3 (using /usr/bin/qmake)
-- Ruby found: /usr/lib64/libruby.so

Ouch! they are default Qt and Ruby. Unfortunately, defaults are not my build targets. to be continued...

No comments:

Post a Comment