Zeal: Update macOS build instructions

Created on 20 Sep 2018  路  48Comments  路  Source: zealdocs/zeal

Hey,

I tried the build instructions in the wiki but it seems Zeal moved to using cmake instead of qmake/make since those instructions were written.

Do you have any updated hints on building Zeal on a Mac?

Help Wanted platformacos scopdocumentation typtask

Most helpful comment

I try to build zeal master branch with --HEAD, it works.

You can build master branch with the following instructions

brew tap markwu/personal
brew install qt
brew install qt5-webkit
brew install --HEAD zeal

All 48 comments

I don't use macOS, so somebody else needs to update the wiki. Generally the process should be pretty similar to building on Linux.

@trollixx thanks, I'll try to figure it out. Which version of Qt5 would you recommend?

Always aim for the latest version, current you need at least 5.6.

Looks like the problem is the dependency on qtwebkit instead of qtwebengine because the former is not shipped anymore with all Qt versions since 5.6. So it's not that easy to get the dependencies together.

I have a homebrew formula if you want to try it.

https://github.com/markwu/homebrew-personal/blob/master/Formula/zeal.rb

Please keep cmake in version 3.12.x and qt in version 5.5 (Already removed from homebrew-core), it will build zeal successfully.

But, It will failed to build zeal in newest cmake version 3.13.x and qt 5.11.1.

it is error messages came from cmake 3.13.0 and qt 5.11.1.

Last 15 lines from /Users/markwu/Library/Logs/Homebrew/zeal/01.cmake:
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++
-- Check for working CXX compiler: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found LibArchive: /usr/local/opt/libarchive/lib/libarchive.dylib (found version "3.3.3")
-- Found SQLite: /usr/lib/libsqlite3.dylib (found version "3.24.0")
-- Configuring done
CMake Error: AutoUic (Registry): The uic executable "" does not exist

Seems like you don't have uic installed. It should be part of the Qt installation.

The uic executable is there, I fixed that problem after downgrade cmake to 3.12.x. I guess it is the bug of cmake 3.13.0.

But new error messages comes, I still trying to figure it out:

==> Downloading https://github.com/zealdocs/zeal/archive/v0.6.1.tar.gz
Already downloaded: /Users/markwu/Library/Caches/Homebrew/downloads/317934405fce17c9a1ce09ff56d59254224b67e098b2d531d0fe801f88d34796--zeal-0.6.1.tar.gz
==> Patching
patching file src/libs/core/CMakeLists.txt
==> cmake ..
Last 15 lines from /Users/markwu/Library/Logs/Homebrew/zeal/01.cmake:
  any of the following names:

    Qt5WebKitConfig.cmake
    qt5webkit-config.cmake

  Add the installation prefix of "Qt5WebKit" to CMAKE_PREFIX_PATH or set
  "Qt5WebKit_DIR" to a directory containing one of the above files.  If
  "Qt5WebKit" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  src/libs/core/CMakeLists.txt:13 (find_package)

It just tells you that Qt WebKit is missing. It's not part of the standard Qt distribution.

Then, I need to figure out how to add it back, I got qt 5.11.1 from homebrew bottle.

The last qtwebkit submodule for qt is verion5.9.1, there is no submodule for 5.11.x.

@markwu that's exactly the problem I had. :)

I try to build qt 5.9.2 inside mojave, no lucky. it seems xcode 10 break the compilation of old qt.

Okay, I can build zeal in MacOS mojave now, but I don't like this solution.

  1. Use brew extract [email protected] YOURTAP/PATH to restore [email protected] formula to your tap. And move it to homebrew/core tap path, and rename it to [email protected].
  2. Use brew extract cmake --version=3.12.4 YOURTAP/PATH to restore cmake 3.12.4 formula to your tap. And move it to homebrew/core tap path, and rename it to replace cmake.rb.
  3. Install qt 5.5 with brew install [email protected] and cmake 3.12.4 with brew install cmake. It should install [email protected] and cmake from bottle. If not, just add --force-bottle.
  4. Then, you can use my formula above to build zeal.

I try this one https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/Formula/qt5-webkit.rb, it can install qt5webkit with qt 5.11.1, but there are A LOT OF ERRORS.

Maybe port to qtwebengine is the way to go, seems qtwebkit does not maintain for 1 years.

cmake 3.13.1 already fixed the uic excutable bug, you can use it instead of 3.12.4 now ...

Finally, I can build zeal with Qt 5.11.1 and QtWebKit 5.212. I will write a formula for it later today.

Here comes with my personal Tap https://github.com/markwu/homebrew-personal

You can follow this instructions to install zeal with qt 5.11.x and qt-webkit 5.212

brew tap markwu/personal
brew install qt
brew install qt5-webkit
brew install zeal

If you want to install zeal with [email protected], you have to extract it first. Please follow the instructions to install it:

Use brew extract [email protected] YOURTAP/PATH to restore [email protected] formula to your tap. And move it to homebrew/core tap path, and rename the file to [email protected], and remember open it and change the class name to QtAt55.

brew tap markwu/personal
brew install [email protected]
brew install [email protected]

But, there some different between qt 5.5 and qt 5.11.1, It looks better in qt 5.5.

qt 5.5

2018-12-03 10 50 53
2018-12-03 10 51 12

qt 5.11.1 (Seems some html get the wrong css style)

2018-12-03 11 58 26
2018-12-03 11 58 48

@trollixx Do you kown any issues about this, should I create a new one for this?

I try to build zeal master branch with --HEAD, it works.

You can build master branch with the following instructions

brew tap markwu/personal
brew install qt
brew install qt5-webkit
brew install --HEAD zeal

Qt 5.12 just relased, you have reinstall qt5-webkit again, it will compiled against Qt 5.12.x.

brew reinstall qt5-webkit

Any volunteers to update the wiki? :)

Sorry, English is not my native language. I will leave my formula here, and if someone can update the document, I'll be appreciated.

If you want to host and maintain the brew formula, you are okay to go.

I'll try to replicate this in the next couple of days and update the wiki.

I'm testing this now will update in a few.

To finish it up I had to do:

cp -Rp /usr/local/Cellar/zeal/HEAD-a64dadc/Zeal.app ~/Applications/Zeal.app

I needed to run

brew install libjpeg libpng

before qt5-webkit would install successfully.

@razzfox I can add these two libraries to formula dependency.

Any volunteers to update the wiki? :)

are there any plans to port from Qt WebKit to Qt WebEngine?

I just update my formula for recent code change. It can compile zeal stable version 0.6.1 and HEAD with Qt 5.11.2. For Qt5.5, It only support zeal stable version 0.6.1

I finally updated the build instructions in the wiki. :)

https://github.com/zealdocs/zeal/commit/090f5270545c24c7840fb199b994b382b5606323

On MacOS, you need to enable loopback aliases other than 127.0.0.1 manually:

sudo ifconfig lo0 alias 127.0.0.22 up

090f527

On MacOS, you need to enable loopback aliases other than 127.0.0.1 manually:

sudo ifconfig lo0 alias 127.0.0.22 up

What will happened if I don't enable loopback aliases?

Okay, now I know what's going on.

image

Maybe I should create a daemon for this https://medium.com/@david.limkys/permanently-create-an-ifconfig-loopback-alias-macos-b7c93a8b0db ?

sure yes

I just add a zeal-loopbackalias daemon support, maybe you want to try it.

After install zeal with head version, you can enable the daemon with

sudo brew services start markwu/personal/zeal

Than, the lookpback should be installed without problem. You can verify it with:

$ ifconfig lo0 | grep 127.0.0.22, the result will be

    inet 127.0.0.22 netmask 0xff000000

I don't use macOS much, it doesn't route all 127.*.*.* addresses by default? I picked 127.0.0.22 to reduce possibility of conflicts.

I don't use macOS much, it doesn't route all 127.*.*.* addresses by default? I picked 127.0.0.22 to reduce possibility of conflicts.

Mac doesn't route all 127.*.*.* by default I guess, therefore I need to add alias for it.

Does linux and windows route all 127.*.*.* by default?

Does linux and windows route all 127.*.*.* by default?

yes

I have just pushed a change that replaces 127.0.0.22 with 127.0.0.1. Hopefully that will make it work out of the box.

@trollixx

Do you use different port when change it to use 127.0.0.1?

For many developers, they installed local http server, it use 127.0.0.1 and localhost.

There might have some problems if you use the default 80 port.

@trollixx I saw you use port other than 80. Thanks!

I also removed the loopback alias daemon from this formula.

@trollixx I saw you use port other than 80.

Yes, a random non-priviliged port is selected on every run.

I already update the wiki documents about building zeal on macOS. Since there is no need for qt5-webkit, I already removed it and related patches from my formula.

It is so good that zeal adapt WebEngine, the life become easier.

Zeal can be installed from macports: https://github.com/macports/macports-ports/pull/7444.

I try to build zeal master branch with --HEAD, it works.

You can build master branch with the following instructions

brew tap markwu/personal
brew install qt
brew install qt5-webkit
brew install --HEAD zeal

Is working as of 27th of August 2020

@RakibFiha Just following the wiki, it should be work.

https://github.com/zealdocs/zeal/wiki/Build-Instructions-for-macOS

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cweiske picture cweiske  路  5Comments

sheershoff picture sheershoff  路  4Comments

taulant picture taulant  路  5Comments

eromoe picture eromoe  路  4Comments

Rohaq picture Rohaq  路  3Comments