Skip to content

Commit

Permalink
use DDEV_PHP_VERSION env variable instead of statically requiring php…
Browse files Browse the repository at this point in the history
… 8.1
  • Loading branch information
wotnak committed Nov 4, 2023
1 parent 8e9f134 commit bf1b176
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

[DDEV addon](https://ddev.readthedocs.io/en/latest/users/extend/additional-services/) that installs [php-geos](https://git.osgeo.org/gitea/geos/php-geos) module.

⚠️ Currently works only with php 8.1.

`ddev get wotnak/ddev-php-geos`
9 changes: 0 additions & 9 deletions install.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
name: php-geos

pre_install_actions:
- |
#ddev-nodisplay
#ddev-description:Check php version
if [ ${DDEV_PHP_VERSION} != "8.1" ]; then
echo "Currently this add-on only supports PHP 8.1.";
exit 1;
fi
project_files:
- web-build/Dockerfile.php-geos
- php/geos.ini
1 change: 1 addition & 0 deletions php/geos.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#ddev-generated
[PHP]
extension=geos.so
29 changes: 18 additions & 11 deletions web-build/Dockerfile.php-geos
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#ddev-generated
# Build and install the GEOS PHP extension.
# See https://git.osgeo.org/gitea/geos/php-geos
RUN apt-get update && apt-get install -y php8.1-dev libgeos-dev \
&& git clone https://github.com/libgeos/php-geos \
&& ( \
cd php-geos \
RUN set -eux ;\
apt-get update ;\
apt-get install -y php${DDEV_PHP_VERSION}-dev libgeos-dev ;\
# Use github mirror for cloning.
git clone https://github.com/libgeos/php-geos ;\
# Build the extension.
( \
cd php-geos ;\
# Checkout latest commit with PHP 8 support.
&& git checkout e77d5a16abbf89a59d947d1fe49381a944762c9d \
&& ./autogen.sh \
&& ./configure \
&& make \
&& make install \
) \
&& rm -r php-geos
git checkout e77d5a16abbf89a59d947d1fe49381a944762c9d ;\
./autogen.sh ;\
./configure ;\
make ;\
make install ;\
) ;\
# Cleanup after build.
rm -r php-geos ;\
apt-get purge -y php${DDEV_PHP_VERSION}-dev

0 comments on commit bf1b176

Please sign in to comment.