Utilitaires
Scripts
Divers
Jeux
Rechercher
Quillevere.net
Computer science thoughts

Compile pgModeler on Windows

06/03/2021

pgModeler is an Open Source software allowing to model a database, that is to say to schematize everything related to the construction of a base (tables, fields, relations, constraints ...) and oriented towards the PostgreSQL DBMS.

The executables are however not free, unless you build them by your own means. Here is how to proceed to generate a version. I will rely here on version 0.9.3 of December 2020, and managing up to PostgreSQL v.13.

  • Make sure you have enough disk space: you need at least 3.5 GB available.
  • Download MSys2. It is a suite of tools for compiling sources to generate Windows Executable.
  • Download the sources of pgModeler : you can download the file pgmodeler-0.9.3.tar.gz present on the site
  • Run MSys2 (you must start 64-bit MGWin version).
  • Copy the downloaded file pgmodeler-0.9.3.tar.gz (without unzipping it) into the folder msys2/home/{PROFIL}. This last parameter {PROFIL} is in fact the name of your Windows profile, which was taken over by MSys2
  • Start the decompression of the file with gzip and tar :
    gunzip pgmodeler-0.9.3.tar.gz
    tar -xf pgmodeler-0.9.3.tar
    rm pgmodeler-0.9.3.tar
  • A directory pgmodeler-0.9.3 was then created, containing the sources of pgModeler.
  • Open the "pgmodeler.pri" file with a text editor and search lines starting with "windows {" and containing " !defined(PGSQL_LIB, var)". Then modify the following 4 lines according to the path where you installed MSys2 :
    !defined(PGSQL_LIB, var): PGSQL_LIB = D:/Install/msys2/mingw64/bin/libpq.dll
    !defined(PGSQL_INC, var): PGSQL_INC = D:/Install/msys2/mingw64/include
    !defined(XML_INC, var): XML_INC = D:/Install/msys2/mingw64/include/libxml2
    !defined(XML_LIB, var): XML_LIB = D:/Install/msys2/mingw64/bin/libxml2-2.dll
  • Save the text file and enter the following command on MSys2 (if you have a firewall, give an access to MSys2) :
    pacman -Suy
  • A request to close MSys2 is displayed at the end. Validate it then restart the software.
  • Run the following command again to dowload the other packages :
    pacman -Suy
  • Download other packages that will also be used for compilation
    pacman -S base-devel mingw-w64-x86_64-make mingw-w64-x86_64-gcc mingw-w64-x86_64-postgresql mingw-w64-x86_64-qt5
  • Create the executable destination directory
    mkdir pgmodeler_final
  • Start the compilation. This operation is quite long, depending on the performance of your system :
    cd pgmodeler-0.9.3
    mingw32-make
  • Then:
    mingw32-make install
  • Then, enter the target of the compiled files (here the pgmodeler_final directory, created at the very start of the procedure)
    export INSTALLATION_ROOT=~/pgmodeler_final
    qmake -r CONFIG+=release PREFIX=$INSTALLATION_ROOT pgmodeler.pro
    make
    make install
  • Then go to the installation directory and apply:
    cd $INSTALLATION_ROOT
    windeployqt pgmodeler.exe pgmodeler_ui.dll
  • Finally, copy the latest DLL files to the target directory
    cd $MSYS2_ROOT/mingw64/bin/
    cp libicuin*.dll libicuuc*.dll libicudt*.dll libpcre2-16-0.dll libharfbuzz-0.dll libpng16-16.dll libfreetype-6.dll libgraphite2.dll libglib-2.0-0.dll libpcre-1.dll libbz2-1.dll libssl-1_1-x64.dll libcrypto-1_1-x64.dll libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll zlib1.dll libpq.dll libxml2-2.dll liblzma-5.dll libstdc++-6.dll libwinpthread-1.dll zlib1.dll libpq.dll libxml2-2.dll liblzma-5.dll libiconv-2.dll libintl-8.dll libbrotlidec.dll libbrotlicommon.dll libdouble-conversion.dll libzstd.dll $INSTALLATION_ROOT

Once all these commands are done, you can run pgModeler from the installation directory.

Dernière modification le 10/03/2021 - Quillevere.net

Articles connexes

Search in this website

fr en rss RSS info Informations