Setup runtime dev environment on Mac OS X with Qt5.8 and annulen QtWebkit-58

July 26, 2017

pgAdmin4-1.6 is shipped with Qt5.8 and annulen QtWebkit-58. So we will be installing first Qt5.8 and then moving annulen QtWebkit-58 to Qt5.8 source.

Step by step instructions:

To run Qt5.8 with annulen QtWebkit-58, download its tar.gz file and extract it, then move files in include, lib and mkspecs to Qt5.8/installation directory:

Compile runtime with Qt5.8

# Run `which python` to know activated virtual env python version. (assuming virtual environment is activated)
output: /home/surinder/virtualenvs/p27/bin/python

# set PYTHONPATH on terminal
export PYTHONPATH=$PYTHONPATH:/home/surinder/virtualenvs/p27/lib/python2.7/site-packages/

# change directory to runtime folder
cd runtime

# Compile and create Makefile
/Users/surinder/Qt5.8.0/5.8/clang_64/bin/qmake -o Makefile pgAdmin4.pro "DEFINES += PGADMIN4_USE_WEBKIT"

# run make
make

Note: If you got linking error while make, edit Makefile and replace line: 39 with this:

LIBS          = $(SUBLIBS) -F/Users/surinder/Qt5.8.0/5.8/clang_64/lib -ldl
-framework CoreFoundation -lpython2.7 -framework QtWebKitWidgets
-framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit
-framework QtWebKit -framework QtNetwork -framework OpenGL -framework AGL

then run make again.

Now run pgAdmin4 in Desktop mode

./pgAdmin4.app/Contents/MacOS/pgAdmin4

If you still got error ImportError: No module named backports

Just create an empty __init__.py into backports package. touch /Users/surinder/Documents/Workspaces/pgAdmin_27/lib/python2.7/site-packages/backports/__init__.py

Now the issue will be resolved and pgAdmin4 will run in Desktop mode.

Note: Make sure to create config_local.py and set SERVER_MODE to FALSE to enable pgAdmin4 in desktop mode.


Discussion, links, and tweets

Hello My name is Surinder Kumar, I am Python and Javascript developer from India and work at EnterpriseDB as a software engineer.
I enjoy working on Python(primarily) and other latest technologies such as Node.js, React and like to contribute to open source projects.