Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Build pgmodeler on Mac with Homebrew-installed pg and openssl

Building pgmodeler for Mac

Check requirements at

You will need Qt 5.9.x installed, full XCode installed, and homebrew installation of postgres and openssl.

The example below is v10.5 of PG and v5.9.6 of Qt, modify accordingly. Also, replace {{USERNAME}} with you Mac username.

The installation is the same as the instructions at the link above. There are a few path differences due to homebrew installation locations.

The specific instructions that are different are listed below under the original section names from the installation page.

Tweaking the build script

pgmodeler.pri changes should be:

diff --git a/pgmodeler.pri b/pgmodeler.pri
index d74b69a9..f49ec495 100644
--- a/pgmodeler.pri
+++ b/pgmodeler.pri
@@ -146,8 +146,8 @@ unix:!macx {

 macx {
-  PGSQL_LIB = /Library/PostgreSQL/10/lib/libpq.dylib
-  PGSQL_INC = /Library/PostgreSQL/10/include
+  PGSQL_LIB = /usr/local/Cellar/postgresql/10.5/lib/libpq.dylib
+  PGSQL_INC = /usr/local/Cellar/postgresql/10.5/include
   XML_INC = /Applications/
   XML_LIB = /usr/lib/libxml2.dylib

Building the software

/Users/{{USERNAME}}/Qt/5.9.6/clang_64/bin/qmake -r
make install
/Users/{{USERNAME}}/Qt/5.9.6/clang_64/bin/macdeployqt /Applications/ -executable=/Applications/ -executable=/Applications/

Resolving dependencies

The libssl.1.* and libcrypto.1.* are found in the openssl install, not in the pg install

cp /usr/local/Cellar/postgresql/10.5/lib/libpq.5.dylib /Applications/
cp /usr/local/Cellar/openssl/1.0.2p/lib/libssl.1.* /Applications/
cp /usr/local/Cellar/openssl/1.0.2p/lib/libcrypto.1.* /Applications/
install_name_tool -change "@loader_path/../lib/libcrypto.1.0.0.dylib" "@loader_path/../Frameworks/libcrypto.1.0.0.dylib" /Applications/
install_name_tool -change "@loader_path/../lib/libcrypto.1.0.0.dylib" "@loader_path/../Frameworks/libcrypto.1.0.0.dylib" /Applications/
install_name_tool -change "@loader_path/../lib/libssl.1.0.0.dylib" "@loader_path/../Frameworks/libssl.1.0.0.dylib" /Applications/
install_name_tool -change libpq.5.dylib "@loader_path/../Frameworks/libpq.5.dylib" /Applications/

You should then be able to open pgmodeler from Launchpad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.