How to build qtwebkit on mac?



  • Re: My Qt4 help file is garbage with Qt 5.6 - how do I get QtWebKit working with Qt 5.6?

    My steps:

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: release/libWTF.a(GOwnPtr.o) has no symbols
    

    First error is:

    /Users/david/dev/qt561_fmosoft/qtwebkit/Source/JavaScriptCore/offlineasm/parser.rb:139:in `lex': Lexer error at llint/LowLevelInterpreter.asm:23, unexpected sequence "\r\n# First come the co" (RuntimeError)
    	from /Users/david/dev/qt561_fmosoft/qtwebkit/Source/JavaScriptCore/offlineasm/parser.rb:192:in `initialize'
    	from /Users/david/dev/qt561_fmosoft/qtwebkit/Source/JavaScriptCore/offlineasm/parser.rb:702:in `new'
    	from /Users/david/dev/qt561_fmosoft/qtwebkit/Source/JavaScriptCore/offlineasm/parser.rb:702:in `parseData'
    	from /Users/david/dev/qt561_fmosoft/qtwebkit/Source/JavaScriptCore/offlineasm/parser.rb:707:in `parse'
    	from /Users/david/dev/qt561_fmosoft/qtwebkit/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb:62:in `<main>'
    

    I'm running Yosemite (10.10.3).



  • @davidb said in How to build qtwebkit on mac?:

    file: release/libWTF.a(GOwnPtr.o) has no symbols

    This is not a problem

    /Users/david/dev/qt561_fmosoft/qtwebkit/Source/JavaScriptCore/offlineasm/parser.rb:139:in `lex': Lexer error at llint/LowLevelInterpreter.asm:23, unexpected sequence "\r\n# First come the co" (RuntimeError)

    No idea what can it be. Are you using ruby interpreter coming with the system?

    In the meanwhile, you can try building https://github.com/annulen/webkit/releases/tag/qtwebkit-tp3 - it certainly builds on 10.10. Instruction: https://github.com/annulen/webkit/wiki/Building-QtWebKit-on-OS-X



  • @Konstantin-Tokarev I have not installed ruby, so I assume I'm using what comes with the OS X 10.10.
    I have built Qt 5.6.1-1 configured with:

    ./configure -prefix $PWD/qtbase -release -opensource -plugin-sql-sqlite -nomake tests -nomake examples -no-compile-examples -confirm-license
    

    Of the items mentioned in the instruction link you sent, I have NOT installed cmake or libpng, or added qmake to $PATH (I used the full path to qmake in my build of Qt 5.6.1-1 to run it in qtwebkit).

    So I will try installing homebrew and following the instructions to install those 2 items.



  • When I try to follow the instructions since qmake is not in my $PATH, I get errors:

    Davids-MacBook-Pro-4:qtwebkit david$ ./Tools/Scripts/build-webkit --qt --cmakeargs="-Wno-dev -DCMAKE_PREFIX_PATH=/Users/david/dev/qt561_fmosoft/qtbase/bin/qmake"
    Can't exec "qmake": No such file or directory at /Users/david/dev/qt561_fmosoft/qtwebkit/Tools/Scripts/webkitdirs.pm line 1791.
    Use of uninitialized value $hostDataPath in scalar chomp at /Users/david/dev/qt561_fmosoft/qtwebkit/Tools/Scripts/webkitdirs.pm line 1791.
    Use of uninitialized value $hostDataPath in concatenation (.) or string at /Users/david/dev/qt561_fmosoft/qtwebkit/Tools/Scripts/webkitdirs.pm line 1792.
    Can't exec "qmake": No such file or directory at /Users/david/dev/qt561_fmosoft/qtwebkit/Tools/Scripts/webkitdirs.pm line 1794.
    Use of uninitialized value $mkspec in scalar chomp at /Users/david/dev/qt561_fmosoft/qtwebkit/Tools/Scripts/webkitdirs.pm line 1794.
    Use of uninitialized value $hostDataPath in concatenation (.) or string at /Users/david/dev/qt561_fmosoft/qtwebkit/Tools/Scripts/webkitdirs.pm line 1795.
    Use of uninitialized value $mkspec in concatenation (.) or string at /Users/david/dev/qt561_fmosoft/qtwebkit/Tools/Scripts/webkitdirs.pm line 1795.
    Unable to determine current SVN revision in /Users/david/dev/qt561_fmosoft/qtwebkit at /Users/david/dev/qt561_fmosoft/qtwebkit/Tools/Scripts/VCSUtils.pm line 417.
    Calling 'qmake /Users/david/dev/qt561_fmosoft/qtwebkit/WebKit.pro CONFIG-=production_build' in /Users/david/dev/qt561_fmosoft/qtwebkit/WebKitBuild/Release
    
    Could not execute qmake at /Users/david/dev/qt561_fmosoft/qtwebkit/Tools/Scripts/webkitdirs.pm line 2264.
    

    I also tried:

    ./Tools/Scripts/build-webkit --qt --cmakeargs="-Wno-dev -DCMAKE_PREFIX_PATH=/Users/david/dev/qt561_fmosoft"
    

    and:

    ./Tools/Scripts/build-webkit --qt --cmakeargs="-Wno-dev -DCMAKE_PREFIX_PATH=/Users/david/dev/qt561_fmosoft/qtbase/bin"
    

    but got the same errors. Given my build of Qt at /Users/david/dev/qt561_fmosoft, what should the command be?



  • @davidb Your CMAKE_PREFIX_PATH should be /Users/david/dev/qt561_fmosoft

    Remove build directory (rm -rf WebKitBuild) and run again



  • Thanks @Konstantin-Tokarev but I still got the same errors. I tried adding the path to qmake in my $PATH and run again, and that got me past those errors, but now I get:

    /Users/david/dev/qt561_fmosoft/qtwebkit/Source/WTF/wtf/qt/MainThreadQt.cpp:78:10: fatal error: 'MainThreadQt.moc' file not found
    #include "MainThreadQt.moc"
    

    Any ideas? a question: I'm assuming I don't need to build/install ICU or any other dependencies listed at https://wiki.qt.io/Building_Qt_5_from_Git, since I'm on mac that has successfully built Qt 5.6.1 (see previous post for configuration). Maybe that's a bad assumption?

    I could try the version at https://github.com/annulen/webkit/releases/tag/qtwebkit-tp3 - I assume I should download the source code (zip or tar.gz). Does that source work with Qt 5.6 (currently required for me)? Or is that source for Qt 5.7 only? Do I need to do anything with qtwebkit-tp3-qt56-darwin.tar.xz?

    I'm sorry for all the questions, but I'd really like to use qtwebkit with Qt 5.6 on mac. I really appreciate your help.



  • My build finished, though with lots of warnings about "'this' pointer cannot be null in well-defined C++ code; point may be assumed to always convert to true", which I assume is not a problem - rebuilding Assistant made my help file display correctly, so I'm very happy!

    Starting with OSX 10.10 Yosemite, with Qt 5.6.1-1 built with configuration in an above post, here are my steps in case it helps somebody:

    1. follow instructions at https://github.com/annulen/webkit/wiki/Building-QtWebKit-on-OS-X to install homebrew, then libpng, cmake, and ninja.
    2. add the path to qmake to $PATH, following http://www.cyberciti.biz/faq/appleosx-bash-unix-change-set-path-environment-variable/
    3. reboot
    4. unzip qtwebkit-opensource-src-5.6.1.tar.xz from http://download.qt.io/community_releases/5.6/5.6.1/ and rename it qtwebkit
    5. move qtwebkit into my Qt source tree
    6. cd to qtwebkit
    7. qmake
    8. make

    From there, I used Qt Creator 4.1 to load qttools/assistant/assistant/assistant.pro, configured for release, to clean, run qmake, and rebuild all.



  • @davidb said in How to build qtwebkit on mac?:

    Thanks @Konstantin-Tokarev but I still got the same errors. I tried adding the path to qmake in my $PATH and run again, and that got me past those errors, but now I get:

    /Users/david/dev/qt561_fmosoft/qtwebkit/Source/WTF/wtf/qt/MainThreadQt.cpp:78:10: fatal error: 'MainThreadQt.moc' file not found
    #include "MainThreadQt.moc"
    

    Any ideas? a question: I'm assuming I don't need to build/install ICU or any other dependencies listed at https://wiki.qt.io/Building_Qt_5_from_Git, since I'm on mac that has successfully built Qt 5.6.1 (see previous post for configuration). Maybe that's a bad assumption?

    I could try the version at https://github.com/annulen/webkit/releases/tag/qtwebkit-tp3 - I assume I should download the source code (zip or tar.gz).

    Yes

    Does that source work with Qt 5.6 (currently required for me)?

    Yes

    Or is that source for Qt 5.7 only? Do I need to do anything with qtwebkit-tp3-qt56-darwin.tar.xz?

    These are ready to use binaries, in case you don't want to compile anything.

    I'm sorry for all the questions, but I'd really like to use qtwebkit with Qt 5.6 on mac. I really appreciate your help.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.