Saturday, November 21, 2009

Installing QtRuby on Ruby 1.9.1 from openSUSE source rpm

At 1st, install Ruby 1.9.1 with same instruction of this article:
phosphorescence: Install Ruby 1.9.1

Then I should go to install QtRuby with source from repository, but smoke/generator of QtRuby is still unstable yet as I had write in this article:
phosphorescence: Confusing about smoke/generator

So I decide to install from source RPM package of openSUSE 11.2 - my own environment.

At 2nd, access to http://download.opensuse.org/source/distribution/11.2/repo/oss/suse/src/, and install source RPM by Firefox. Firefox on openSUSE integrates management for sources and packages of openSUSE.
I install source RPMs: ruby-kde4-4.3.1-3.1.src.rpm and kdelibs4-4.3.1-6.7.2.src.rpm.

At 3rd, see the source directory of RPM.
> ls /usr/src/packages/SOURCES
4_3_BRANCH.diff             hotplug-kde3.diff            kdelibs-4.3.1.tar.bz2                  plasma-libs.diff
add-suse-translations.diff  ignore-inline-menu.diff      kdesu-settings.diff                    plasma_no_examples.diff
clever-menu.diff            kde3-applications.diff       khtml-4.3.2.diff                       policykit-workaround.patch
default-useragent.diff      kde3-autostart.diff          khtml-closetab-crash-kde207173.diff    windeco-color.diff
desktop-translations.diff   kde4rc                       khtml-r1033984.diff                    xdg-user-dir-bnc540574.diff
display-key-support.diff    kdebindings-4.3.1.tar.bz2    kjs-mark-register-stack.diff           ycp.xml
flash-player-non-oss.diff   kdebug-areas-update.diff     kstyle-no-dynamic-cast-bnc529640.diff
hidden.desktop              kded-checksycocaoption.diff  oom-protect.diff
There are 2 tarballs. Then I use these to install QtRuby like this article:
phosphorescence: qt4-qtruby 2.0.3 is released
>tar -jxvf /usr/src/packages/SOURCES/kdebindings-4.3.1.tar.bz2
>tar -jxvf /usr/src/packages/SOURCES/kdelibs-4.3.1.tar.bz2
>cd kdebindings-4.3.1
>cp CMakeLists.txt CMakeLists.txt.bkup
>cp CMakeLists.txt.qtruby CMakeLists.txt
>cp ../kdelibs-4.3.1/cmake/modules/FindQt4.cmake ./cmake/modules/
>cp ../kdelibs-4.3.1/cmake/modules/FindRUBY.cmake ./cmake/modules/
>cp ../kdelibs-4.3.1/cmake/modules/MacroOptionalFindPackage.cmake ./cmake/modules/
>cp ../kdelibs-4.3.1/cmake/modules/MacroPushRequiredVars.cmake ./cmake/modules/
>cmake                                                                             \
>  -DCMAKE_INSTALL_PREFIX=/opt/ruby-1.9.1                                          \
>  -DRUBY_EXECUTABLE=/opt/ruby-1.9.1/bin/ruby                                      \
>  -DRUBY_LIBRARY=/opt/ruby-1.9.1/lib/libruby.so.1.9.1                             \
>  -DRUBY_INCLUDE_PATH=/opt/ruby-1.9.1/include/ruby-1.9.1                          \
>  -Wno-dev                                                                        \
>  -DENABLE_SMOKE=on                                                               \
>  -DENABLE_QTRUBY=on                                                              \
>  -DENABLE_QTWEBKIT_SMOKE=on                                                      \
>  -DENABLE_QTSCRIPT_SMOKE=on                                                      \
>  -DENABLE_QTUITOOLS_SMOKE=on                                                     \
>  -DENABLE_QTTEST_SMOKE=off                                                       \
>  -DENABLE_PHONON_SMOKE=off                                                       \
>  -DENABLE_QSCI_SMOKE=off                                                         \
>  -DENABLE_QWT_SMOKE=off                                                          \
>  -DENABLE_KDE_SMOKE=off                                                          \
>  -DENABLE_KDEVPLATFORM_SMOKE=off                                                 \
>  -DENABLE_KHTML_SMOKE=off                                                        \
>  -DENABLE_KTEXTEDITOR_SMOKE=off                                                  \
>  -DENABLE_SOLID_SMOKE=off                                                        \
>  -DENABLE_PLASMA_SMOKE=off                                                       \
>  -DENABLE_QTWEBKIT_RUBY=on                                                       \
>  -DENABLE_QTUITOOLS_RUBY=on                                                      \
>  -DENABLE_QTSCRIPT=on                                                            \
>  -DENABLE_QTTEST=off                                                             \
>  -DENABLE_PHONON_RUBY=off                                                        \
>  -DENABLE_QSCINTILLA_RUBY=off                                                    \
>  -DENABLE_QWT_RUBY=off                                                           \
>  -DENABLE_SOPRANO_RUBY=off                                                       \
>  -DENABLE_KDEVPLATFORM_RUBY=off                                                  \
>  -DENABLE_KORUNDUM_RUBY=off                                                      \
>  -DENABLE_KHTML_RUBY=off                                                         \
>  -DENABLE_KTEXTEDITOR_RUBY=off                                                   \
>  -DENABLE_SOLID_RUBY=off                                                         \
>  -DENABLE_KROSSRUBY=off                                                          \
>  -DENABLE_PLASMA_RUBY=off                                                        \
>  -DENABLE_QIMAGEBLITZ_SMOKE=off
>make
>make install
I note these instruction has done with kalyptus - stable QtRuby installer.

At last, fix the shebang line of rbqtapi, then installation succeeds. Let's check the commands.
>/opt/ruby-1.9.1/bin/rbrcc -version
Ruby Resource Compiler for Qt version 4.5.3
>/opt/ruby-1.9.1/bin/rbuic4 -v
Qt User Interface Compiler version 4.5.3
>/opt/ruby-1.9.1/bin/rbqtapi -v
QtRuby 2.0.5 using Qt-4.5.3

5 comments:

Pavel said...

Hello! First of all, thanks for your blog and posts about Ruby and Qt - it is very interesting to me!
But when I run cmake with your options, I get the error. It would be great if you will help me!
My OS is openSUSE 11.2. I have installed gcc, gcc.4.1, but it wasn't help.

-- The CXX compiler identification is unknown
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error at cmake/modules/FindQt4.cmake:1498 (MESSAGE):
Qt qmake not found!
Call Stack (most recent call first):
cmake/modules/FindKDE4Internal.cmake:289 (find_package)
CMakeLists.txt:35 (find_package)

Pavel said...

Sorry, cmake is succefully finished. Now I get an error here (after I type make):
make[2]: *** [ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/Qt.o]
make[1]: *** [ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/all]

Youhei Kondou said...

Hello Pavel, thanks to reply!
I guess it's same with http://rubyforge.org/forum/message.php?msg_id=70314 .
If you are using Ruby 1.9.1, are you linking ruby.h in correct path? see the related articles in http://phosphor-escence.blogspot.com/2009_03_01_archive.html .

welly said...

I Have a problem (after I type make):
make[2]: *** [ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/Qt.o]
make[1]: *** [ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/all]

Youhel Kondou : Your Answer not solve my problem

Youhei Kondou said...

Please read again http://rubyforge.org/forum/message.php?msg_id=70314
BTW, I already have not follow the latest QtRuby. So please hear in there.

Post a Comment