gitlab-ci: Add downstream job for PHP
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0cb727c..87d835b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -321,3 +321,8 @@
image: registry.gitlab.gnome.org/gnome/libxml2
script:
- sh .gitlab-ci/downstream-perl.sh
+
+downstream-php:
+ image: registry.gitlab.gnome.org/gnome/libxml2
+ script:
+ - sh .gitlab-ci/downstream-php.sh
diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile
index be81155..56372f4 100644
--- a/.gitlab-ci/Dockerfile
+++ b/.gitlab-ci/Dockerfile
@@ -38,3 +38,7 @@
libyaml-perl
RUN cpanm -n Alien::Libxml2
RUN apt-get remove -y libxml2-dev
+
+# PHP
+RUN apt-get install -y --no-install-recommends \
+ bison re2c libsqlite3-dev
diff --git a/.gitlab-ci/downstream-php.sh b/.gitlab-ci/downstream-php.sh
new file mode 100644
index 0000000..cba2538
--- /dev/null
+++ b/.gitlab-ci/downstream-php.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+set -e
+
+srcdir=$(pwd)
+
+mkdir -p install
+installdir="$srcdir/install"
+export PKG_CONFIG_PATH="$installdir/lib/pkgconfig"
+
+sh autogen.sh "--prefix=$installdir" --without-python
+make -j$(nproc)
+make install
+
+git clone --depth 1 https://gitlab.gnome.org/GNOME/libxslt.git
+cd libxslt
+sh autogen.sh \
+ "--prefix=$installdir" \
+ "--with-libxml-prefix=$installdir" \
+ --without-python
+make -j$(nproc)
+make install
+cd ..
+
+git clone --depth 1 https://github.com/php/php-src.git
+cd php-src
+./buildconf
+./configure --with-xsl --enable-soap --enable-debug
+make -j$(nproc)
+make TESTS=" \
+ ext/dom \
+ ext/libxml \
+ ext/simplexml \
+ ext/soap \
+ ext/xml \
+ ext/xmlreader \
+ ext/xmlwriter \
+ ext/xsl \
+" test