The official installation instructions for pgModeler recommends installing Xcode and the Enterprise DB distribution of Postgres to fulfill its build requirements. Luckily, Homebrew's got us covered!
-
Checkout the source
git clone https://github.com/pgmodeler/pgmodeler.git git checkout main
-
Install dependencies with brew
brew install postgresql@13 qt@5 libxml2 libpq
-
Tweak build script (
pgmodeler.pri
)macx { PGSQL_LIB = /usr/local/opt/libpq/lib/libpq.dylib PGSQL_INC = /usr/local/opt/libpq/include XML_INC = /usr/local/opt/libxml2/include/libxml2 XML_LIB = /usr/local/opt/libxml2/lib/libxml2.dylib INCLUDEPATH += $$PGSQL_INC $$XML_INC }
Brew installs to a different path by default for Apple Silicon devices:
macx { PGSQL_LIB = /opt/homebrew/opt/libpq/lib/libpq.dylib PGSQL_INC = /opt/homebrew/opt/libpq/include XML_INC = /opt/homebrew/opt/libxml2/include/libxml2 XML_LIB = /opt/homebrew/opt/libxml2/lib/libxml2.dylib INCLUDEPATH += $$PGSQL_INC $$XML_INC }
-
Build
<PATH_TO_QT5_BIN>/qmake -r pgmodeler.pro make make install
last build based on QT6, PQ15 and last brew packages needs:
macx {
!defined(PGSQL_LIB, var): PGSQL_LIB = /usr/local/Cellar/libpq/15.2/lib/libpq.dylib
!defined(PGSQL_INC, var): PGSQL_INC = /usr/local/Cellar/libpq/15.2/include
!defined(XML_INC, var): XML_INC = /usr/local/Cellar/libxml2/2.10.3_2/include/libxml2
!defined(XML_LIB, var): XML_LIB = /usr/local/Cellar/libxml2/2.10.3_2/lib/libxml2.dylib
INCLUDEPATH += "$$PGSQL_INC" "$$XML_INC"
}
and then