Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update macOS build instructions #995

Closed
dakira opened this issue Sep 20, 2018 · 48 comments
Closed

Update macOS build instructions #995

dakira opened this issue Sep 20, 2018 · 48 comments

Comments

@dakira
Copy link

dakira commented Sep 20, 2018

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?

@dakira dakira changed the title Update Mac build instructions Updated Mac build instructions Sep 20, 2018
@trollixx
Copy link
Member

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

@dakira
Copy link
Author

dakira commented Sep 20, 2018

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

@trollixx
Copy link
Member

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

@dakira
Copy link
Author

dakira commented Sep 20, 2018

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.

@trollixx trollixx changed the title Updated Mac build instructions Update macOS build instructions Oct 17, 2018
@markwu
Copy link

markwu commented Nov 25, 2018

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.

@markwu
Copy link

markwu commented Nov 25, 2018

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

@trollixx
Copy link
Member

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

@markwu
Copy link

markwu commented Nov 26, 2018

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)

@trollixx
Copy link
Member

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

@markwu
Copy link

markwu commented Nov 26, 2018

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

@markwu
Copy link

markwu commented Nov 26, 2018

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

@dakira
Copy link
Author

dakira commented Nov 26, 2018

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

@markwu
Copy link

markwu commented Nov 26, 2018

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

@markwu
Copy link

markwu commented Nov 26, 2018

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

  1. Use brew extract qt@5.5 YOURTAP/PATH to restore qt@5.5 formula to your tap. And move it to homebrew/core tap path, and rename it to qt@5.5.rb.
  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 qt@5.5 and cmake 3.12.4 with brew install cmake. It should install qt@5.5 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.

@markwu
Copy link

markwu commented Nov 29, 2018

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

@markwu
Copy link

markwu commented Nov 29, 2018

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

@markwu
Copy link

markwu commented Dec 3, 2018

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

@markwu
Copy link

markwu commented Dec 3, 2018

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 qt@5.5, you have to extract it first. Please follow the instructions to install it:

Use brew extract qt@5.5 YOURTAP/PATH to restore qt@5.5 formula to your tap. And move it to homebrew/core tap path, and rename the file to qt@5.5.rb, and remember open it and change the class name to QtAt55.

brew tap markwu/personal
brew install qt@5.5
brew install zeal-qt@5.5

@markwu
Copy link

markwu commented Dec 3, 2018

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?

@markwu
Copy link

markwu commented Dec 4, 2018

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

@markwu
Copy link

markwu commented Dec 8, 2018

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

brew reinstall qt5-webkit

@trollixx
Copy link
Member

Any volunteers to update the wiki? :)

@pryorda
Copy link

pryorda commented Dec 22, 2018

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

@pryorda
Copy link

pryorda commented Dec 23, 2018

To finish it up I had to do:

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

@razzfox
Copy link

razzfox commented Dec 23, 2018

I needed to run

brew install libjpeg libpng

before qt5-webkit would install successfully.

@markwu
Copy link

markwu commented Dec 24, 2018

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

@sunjie21
Copy link

sunjie21 commented Jan 1, 2019

Any volunteers to update the wiki? :)

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

@markwu
Copy link

markwu commented Jan 28, 2019

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

@dakira
Copy link
Author

dakira commented Jan 17, 2020

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

@dakira dakira closed this as completed Jan 17, 2020
@frankli0324
Copy link

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

@markwu
Copy link

markwu commented Mar 27, 2020

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?

@markwu
Copy link

markwu commented Mar 27, 2020

Okay, now I know what's going on.

image

@markwu
Copy link

markwu commented Mar 27, 2020

@frankli0324
Copy link

sure yes

@markwu
Copy link

markwu commented Mar 28, 2020

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

@trollixx
Copy link
Member

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.

@markwu
Copy link

markwu commented Mar 29, 2020

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?

@frankli0324
Copy link

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

yes

trollixx added a commit that referenced this issue Mar 31, 2020
@trollixx
Copy link
Member

trollixx commented Mar 31, 2020

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.

@markwu
Copy link

markwu commented Mar 31, 2020

@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.

@markwu
Copy link

markwu commented Apr 1, 2020

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

I also removed the loopback alias daemon from this formula.

@trollixx
Copy link
Member

trollixx commented Apr 2, 2020

@trollixx I saw you use port other than 80.

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

@markwu
Copy link

markwu commented May 9, 2020

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.

@sikmir
Copy link

sikmir commented Jun 17, 2020

Zeal can be installed from macports: macports/macports-ports#7444.

@RakibFiha
Copy link

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

@markwu
Copy link

markwu commented Aug 28, 2020

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

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

@github-actions github-actions bot locked and limited conversation to collaborators Aug 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

9 participants