-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package request: postgis #8142
Comments
Probably is but there are several dependencies some of which cannot be cross compiled. |
I see, I was just curious to see if I can run my django server on my android phone. Seems like postgis doesn't let me to do so. |
And now in 2019,is it possible to use postgis with postgresql on termux ? |
Made some headway on PostGIS but getting stuck compiling the PROJ dependency with the following error:
|
sqlite, libsqlite and libsqlite-dev are all installed |
@bencevans have a look in the config.log file for more information about why it can't find sqlite. Also note that proj and geos are already available from the science repo so |
Thanks for the top @Grimler91. It's gotten me a bit further 🚀 PostGIS build is now getting stuck at finding proj_api.h which I can't find either scanning the file system. |
@bencevans I'm guessing you haven't installed You probably also want to fix the |
This comment has been minimized.
This comment has been minimized.
|
Seems instructions now broken due to upgrade to gdal 3 in the repositories. |
@xeffyr I tried following your instructions but it seems like lots of the packages are not available:
|
Now: btw, message has all suggestions:
|
@xeffyr Thanks so much - I got it built and working. Here is the full set of steps I followed:
|
What are the next steps now that it can be built to package this up? |
@timlinux hey ;) Have you already tried PostgreSQL/PostGIS inside a Android 10 environment ? Happy new year ! |
Yes it's possible to have postgresql and postgis on android 10. |
I built this last night using the latest stable release of PostGIS. You need to install additional packages for it to work, and raster support also seems to work, so compile options are different. Here's what I did: pkg install build-essential
pkg install wget curl libiconv postgresql libxml2 libsqlite readline libiconv postgresql libxml2 libsqlite proj libgeos json-c libprotobuf-c
wget https://download.osgeo.org/postgis/source/postgis-3.1.0.tar.gz
tar xfz postgis-3.1.0.tar.gz
cd postgis-3.1.0
./configure --prefix=$PREFIX --with-projdir=$PREFIX
make -j8
make install
mkdir -p $PREFIX/var/lib/postgresql
initdb $PREFIX/var/lib/postgresql
pg_ctl -D $PREFIX/var/lib/postgresql start
psql -l
createdb gis Then boot up psql: Then inside the psql console run: |
Hi all, thanks for your help. I could not build postgis with @seabre guidelines, but needed instead to add the --without-raster option. |
@mdouchin I wiped my termux install and tried from scratch to see what the issue was. In addition to the packages installed in the instructions above, the package pkg install build-essential
pkg install wget curl libiconv postgresql libxml2 libsqlite readline libiconv postgresql libxml2 libsqlite proj libgeos json-c libprotobuf-c gdal
wget https://download.osgeo.org/postgis/source/postgis-3.1.0.tar.gz
tar xfz postgis-3.1.0.tar.gz
cd postgis-3.1.0
./configure --prefix=$PREFIX --with-projdir=$PREFIX
make -j8
make install
mkdir -p $PREFIX/var/lib/postgresql
initdb $PREFIX/var/lib/postgresql
pg_ctl -D $PREFIX/var/lib/postgresql start
psql -l
createdb gis |
@seabre Thanks a lot ! Tested and approved ! Silly newbie question: how hard would it be to add postgis as a termux package, since building is working ? I could follow a step-by-step "create a package" guide and provide some help ? |
@mdouchin I started looking at packaging postgis, but it needs some work when cross-compiling. Configure steps tries to run various config tools (like Please have a look at the github wiki pages if you are interested in learning about how to create packages and the build system: https://github.com/termux/termux-packages/wiki/Creating-new-package, https://github.com/termux/termux-packages/wiki/Building-packages Also, moving this to science-packages since it depends on packages there. |
Thanks for your detailed answer. Meanwhile I created a script based on this issue answers https://github.com/mdouchin/termux-postgis-script |
Hello I just tried today on a new termux instance, and encoutered an issue with libproj not found during the The error tells
I checked, and proj is installed in version 8.0.1 . Perhaps PostGIS 3.1.0 cannot be built against it ? I really think we should provide a PostGIS package. I will try to help, but have not much time at present :( |
Could be that |
Thanks for the answer. |
I compiled PostGIS as in seabre instruction, but
What I do wrong? |
What compiler are you using? (clang or inofficial gcc?) Try installing |
I also discovered recently you need to add these packages to make it work
|
postgis is not really set up for cross-compilation. It wants to run cross-compiled programs to check proj and protobuf versions, so we need to patch that in configure script. The current patch added to do this will be annoying to maintain. I tried patching the configure.ac script instead but got weird errors that seemed to have more to do with the autoconf version we have in the docker image. Fixes #8142
postgis is not really set up for cross-compilation. It wants to run cross-compiled programs to check proj and protobuf versions, so we need to patch that in configure script. The current patch added to do this will be annoying to maintain. I tried patching the configure.ac script instead but got weird errors that seemed to have more to do with the autoconf version we have in the docker image. Fixes #8142
postgis is not really set up for cross-compilation. It wants to run cross-compiled programs to check proj and protobuf versions, so we need to patch that in configure script. The current patch added to do this will be annoying to maintain. I tried patching the configure.ac script instead but got weird errors that seemed to have more to do with the autoconf version we have in the docker image. Fixes #8142
Postgis has been added, seems to work when i run simple commands on archlinux wiki, but please test it and report issues |
I managed to install successfully thanks to @seabre's |
@davemackintosh you mean compilation from source on device? Was there an issue with/did you try the package available through apt/pkg? |
Is it possible to have postgis for termux?
The text was updated successfully, but these errors were encountered: