Advertisement
Guest User

Untitled

a guest
Jan 30th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. Hello Andrea,
  2.  
  3. I spent a bit of time trying out Qt5 and Unity 2D and here is how I proceed.
  4.  
  5. 1) First of all, getting Qt5 and some of its dependencies and compiling it (ensure you have at least around 6GB of free space):
  6.  
  7. git clone git://gitorious.org/qt/qt5.git qt5
  8. cd qt5
  9. perl init-repository --no-webkit
  10. cd qtbase
  11. git submodule update --init src/3rdparty/v8
  12. sudo apt-get install libx11-xcb-dev libxcb.*dev libv8-dev libxext-dev libgl1-mesa-dev
  13. export PATH=$PWD/qtbase/bin:$PATH
  14. export LD_LIBRARY_PATH=$PWD/qtbase/lib:$LD_LIBRARY_PATH
  15. export PKG_CONFIG_PATH=$PWD/qtbase/lib/pkgconfig:$PKG_CONFIG_PATH
  16. ./configure -developer-build -nomake examples -nomake tests -no-gtkstyle -no-webkit -opensource -confirm-license
  17. make -j3
  18.  
  19.  
  20. 2) Recompile the libraries that Unity 2D depends on against Qt5, that are dee-qt, bamf-qt, dbusmenu-qt and dconf-qt. I adapted them so that they compile and work more or less fine against Qt5:
  21.  
  22. bzr branch lp:~fboucault/dee-qt/qt5
  23. cd qt5
  24. cmake .
  25. make
  26. cd ..
  27.  
  28. bzr branch lp:~fboucault/bamf-qt/qt5
  29. cd qt5
  30. cmake .
  31. make
  32. cd ..
  33.  
  34. bzr branch lp:~fboucault/libdbusmenu-qt/qt5
  35. cd qt5
  36. cmake -DWITH_DOC=OFF .
  37. make
  38. cd ..
  39.  
  40. bzr branch lp:~fboucault/dconf-qt/qt5
  41. cd qt5
  42. cmake .
  43. make
  44. cd ..
  45.  
  46.  
  47. 3) Finally modify Unity 2D's code for it to compile against Qt5. For that there is a bunch of tasks that need to be accomplished properly listed just after. To get a (working) idea of it I pasted a very crude patch that does part of it there:
  48.  
  49. http://pastebin.com/31G903eY
  50.  
  51. Qt4 compatible tasks:
  52. * fix Qt includes to be fully specified (e.g. QObject becomes QtCore/QObject)
  53. * CMakeLists.txt:
  54. - use INCLUDE_DIRS instead of INCLUDE_DIR
  55. - migrate away from qt4_automoc in panel and libunity-2d-private and use qt4_wrap_cpp instead (removes all #include .moc in *.cpp)
  56.  
  57. Qt5 only tasks:
  58. * CMakeLists.txt:
  59. - replace uses of qt4_wrap_cpp with qt5_wrap_cpp
  60. - replace uses of qt4_add_dbus_adaptor with qt5_add_dbus_adaptor
  61. * drop usage of QX11Info (maybe isolate dependencies on X while at it)
  62. * in QML: Accessible.name and Accessible.role do not exist anymore; find the replacement
  63.  
  64.  
  65.  
  66. Notes:
  67. * That makes Unity 2D run with Qt5 but still using QtQuick 1.1. We will also want to migrate to QtQuick 2.0.
  68. * automoc in Qt5 will be done through its inclusion in CMake 2.8.7 and we will be able to remove:
  69.  
  70. set(FOO_MOC_HEADERS foo_header.h)
  71. qt5_wrap_cpp(FOO_MOC_SRCS ${FOO_MOC_HEADERS})
  72. add_library(foo SHARED ${FOO_SRCS} ${FOO_MOC_SRCS})
  73.  
  74. by adding:
  75. set(CMAKE_AUTOMOC ON)
  76. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  77.  
  78. See http://public.kitware.com/pipermail/cmake-developers/2011-December/002715.html
  79.  
  80.  
  81. I hope that helps,
  82.  
  83. Florian
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement