Has anyone succesfully built pgadmin4 from source on TrueOS?


#1

There is only pgadmin3 in the AppCafe, and I found pgadmin4 v3.0 source code on postgresql website but I have no idea how to build it in TrueOS… I don’t want to just try it and ruin my system though. Has anyone else tried to do this?


#2

c’mon man :wink: live a little

“If” it’s in the TrueOS ports tree, should be no issue/

If not, then create a test BE and tinker


#3

@RodMyers I finally got brave and decided to give it a shot…

[groot@TrueOS] ~/pgadmin4-3.0/runtime% qmake
Info: creating stash file /usr/home/groot/pgadmin4-3.0/runtime/.qmake.stash
Project MESSAGE: Building for QT5+…
Project MESSAGE:
Project MESSAGE: Building for Linux/Mac…
Project ERROR: The python-config executable could not be found. Ensure Python is installed and in the system path

Edit:
It’s not in the TrueOS ports tree, or the FreeBSD ports tree (as of right now).


#4

cool deal.

Remember Boot Environments are your friend


#5

Try:
/usr/local/bin/python2-config


#6

did it through python wheel:
https://www.pgadmin.org/download/pgadmin-4-python-wheel/

pkg install python27 py27-pip py27-virtualenv py27-sqlite3 postgresql96-client postgresql96-contrib
virtualenv ~/bin/pgadmin4
source ~/bin/pgadmin4/bin/activate  # source ~/bin/pgadmin4/bin/activate.csh  - if in tcsh/csh
pip install ~/Downloads/pgadmin4-3.0-py2.py3-none-any.whl

Then create an executable with vim ~/bin/pgadmin4/bin/pgadmin4 with something like the following content (replace shebangs with more appropriate):

#!/usr/local/bin/bash
source `dirname "$0"`/activate
python ${VIRTUAL_ENV}/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

Run it with ~/bin/pgadmin4/bin/pgadmin4.
By default, it wants access to /var/log/pgadmin/pgadmin4.log.


#7

Python Wheel is for web application in python environment, and does not include the desktop Runtimes.

Edit:
I also emailed the pgadmin3 port maintainer, and asked why It hasn’t been upgraded to pgadmin4 yet. I thought it could have been a licensing issue, but I was told that somebody just needs to build a port for it.


#8

https://www.pgadmin.org/download/

pgAdmin 4 is a complete rewrite of pgAdmin, built using Python and Javascript/jQuery. A desktop runtime written in C++ with Qt allows it to run standalone for individual users, or the web application code may be deployed directly on a webserver for use by one or more users through their web browser.

From the source code README:

pgAdmin 4 is written as a web application in Python, using jQuery and Bootstrap
for the client side processing and UI. On the server side, Flask is being
utilised.

pgadmin4 is a web application. Whether you run it as a “stand-alone executable” or as a python script, you’ll end up using it within a web-browser. The stand-alone executable just starts a local web-server under the hood to serve its UI.

In python, pip can actually build native components during python module install and I believe it does so with pagadmin4 wheel. It works fine for me, with the exception that I need to start it with custom made bash-script.

Edit:
In the ${PGADMIN4_SRC}/runtime folder:

PYTHON_CONFIG=`which python2.7-config` qmake
make