Skip to content

Commit f3e0b44

Browse files
authored
Merge pull request #34 from ausi/fix/php-7-4
Make configure compatible with PHP 7.4
2 parents efb4ea2 + 25b45e7 commit f3e0b44

16 files changed

+283
-21
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ install:
8686
- git pull
8787
- popd
8888
- if [[ $RELEASE != precise ]]; then unset ICU_RELEASE; fi # disable ICU installation for Trusty; see https://github.com/travis-ci/travis-ci/issues/3616#issuecomment-286302387
89+
- | # older distros don't ship a libjpeg.pc, add our own to pkg-config path
90+
if ! pkg-config --exists libjpeg; then
91+
export PKG_CONFIG_PATH=$PWD:$PKG_CONFIG_PATH
92+
fi
8993
- ./bin/install-icu
94+
- export PKG_CONFIG_PATH=$ICU_INSTALL_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
95+
- touch custom_configure_options
9096
- ./bin/install-libzip
9197
- ./bin/install-libsodium
9298
- ./bin/install-password-argon2
@@ -96,6 +102,7 @@ install:
96102
else
97103
cp default_configure_options.$RELEASE $HOME/.php-build/share/php-build/default_configure_options
98104
fi
105+
- cat custom_configure_options >> $HOME/.php-build/share/php-build/default_configure_options
99106
- | # disable xdebug on master
100107
if [[ $VERSION = master && $RELEASE != xenial ]]; then
101108
sed -i -e '/install_xdebug_master/d' $HOME/.php-build/share/php-build/definitions/$VERSION

bin/compile

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,23 @@ php-build -i development "${VERSION}" "${INSTALL_DEST}/${VERSION}"
2020

2121
pushd "${INSTALL_DEST}/${VERSION}"
2222

23-
# pear
24-
curl -fsSL --retry 20 -O http://pear.php.net/go-pear.phar
2523

26-
env TZ=UTC $TRAVIS_BUILD_DIR/bin/install-pear
27-
rm go-pear.phar
28-
"$INSTALL_DEST/$VERSION/bin/pear" config-set php_ini "$INSTALL_DEST/$VERSION/etc/php.ini" system
29-
"$INSTALL_DEST/$VERSION/bin/pear" config-set auto_discover 1
24+
# update default_cert_file
25+
wget -O /usr/local/ssl/cert.pem https://curl.haxx.se/ca/cacert.pem
26+
27+
28+
# don't install pear on master (issue with php 8.0)
29+
# this could be a temp issue though
30+
if [[ ! $VERSION =~ ^master$ ]]; then
31+
curl -fsSL --retry 20 -O http://pear.php.net/go-pear.phar
32+
33+
env TZ=UTC $TRAVIS_BUILD_DIR/bin/install-pear
34+
rm go-pear.phar
35+
"$INSTALL_DEST/$VERSION/bin/pear" config-set php_ini "$INSTALL_DEST/$VERSION/etc/php.ini" system
36+
"$INSTALL_DEST/$VERSION/bin/pear" config-set auto_discover 1
37+
38+
"$INSTALL_DEST/$VERSION/bin/pear" channel-update pear.php.net
39+
fi
3040

3141
# php-fpm
3242
ln -sv $PWD/sbin/php-fpm $PWD/bin/php-fpm

bin/compile-extension-apcu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ else
1111
apcu=apcu
1212
fi
1313

14+
pecl channel-update pecl.php.net
15+
1416
echo | pecl_install $apcu
1517

1618
travis_time_finish

bin/compile-extension-memcache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ travis_time_start
77

88
if [[ ! $VERSION =~ ^7 && ! $VERSION =~ ^master$ ]]; then
99
pecl download memcache-beta
10-
tar zxvf memcache*.tgz && pushd memcache*
10+
tar zxvf memcache*.tgz && pushd memcache*/
1111
make clean || true
1212
phpize
1313
./configure && make && make install

bin/compile-extension-memcached

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ install_memcache
1919

2020
if [[ $VERSION =~ ^7 || $VERSION =~ ^master$ ]]; then
2121
pecl download memcached-3.1.2
22-
tar zxvf memcached*.tgz && pushd memcached*
22+
tar zxvf memcached*.tgz && pushd memcached*/
2323
make clean || true
2424
else
2525
pecl download memcached-2.2.0
26-
tar zxvf memcached*.tgz && pushd memcached*
26+
tar zxvf memcached*.tgz && pushd memcached*/
2727
make clean || true
2828
fi
2929
phpize

bin/install-icu

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ rm -rf $ICU_INSTALL_DIR
2020
make install
2121
popd
2222

23-
echo "--with-icu-dir=$ICU_INSTALL_DIR" >> $TRAVIS_BUILD_DIR/default_configure_options.${RELEASE}
23+
# PHP >= 7.4 exclusively uses pkg-config for ICU
24+
if [[ $VERSION =~ ^5 || $VERSION =~ 7\.[0123] ]]; then
25+
echo "--with-icu-dir=$ICU_INSTALL_DIR" >> $TRAVIS_BUILD_DIR/custom_configure_options
26+
fi

bin/install-libsodium

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ make check
2020
make install
2121
popd
2222

23-
# add the option in default_configure_options
24-
echo "--with-sodium=$LIBSODIUM_INSTALL_DIR" >> $TRAVIS_BUILD_DIR/default_configure_options.${RELEASE}
23+
# add the option in custom_configure_options
24+
echo "--with-sodium=$LIBSODIUM_INSTALL_DIR" >> $TRAVIS_BUILD_DIR/custom_configure_options

bin/install-libzip

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,22 @@ pushd cmake
2020
#install cmake specific to host architecture.
2121
if [[ $HOSTTYPE == "powerpc64le" ]]
2222
then
23-
wget -O - https://cmake.org/files/v3.12/cmake-3.12.0.tar.gz | tar -xz --strip-components=1
23+
wget -O - https://cmake.org/files/v3.14/cmake-3.14.0.tar.gz | tar -xz --strip-components=1
2424
#compile cmake
2525
./configure > /dev/null 2>&1 && make > /dev/null 2>&1 && sudo make install > /dev/null 2>&1
2626
else
27-
wget -O - https://cmake.org/files/v3.12/cmake-3.12.3-Linux-x86_64.tar.gz | tar -xz --strip-components=1
27+
wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.sh
28+
sudo sh cmake-3.14.0-Linux-x86_64.sh --prefix=/usr --skip-license
2829
fi
2930
popd
3031

3132
# compile libzip
32-
git clone -b rel-1-5-1 https://github.com/nih-at/libzip.git
33+
git clone -b rel-1-5-2 https://github.com/nih-at/libzip.git
3334
pushd libzip
34-
../cmake/bin/cmake -DCMAKE_INSTALL_PREFIX=$LIBZIP_INSTALL_DIR .
35+
cmake -DCMAKE_INSTALL_PREFIX=$LIBZIP_INSTALL_DIR .
3536
make
3637
make install
3738
popd
3839

39-
# add the option in default_configure_options
40-
echo "--with-libzip=$LIBZIP_INSTALL_DIR" >> $TRAVIS_BUILD_DIR/default_configure_options.${RELEASE}
40+
# add the option in custom_configure_options
41+
echo "--with-libzip=$LIBZIP_INSTALL_DIR" >> $TRAVIS_BUILD_DIR/custom_configure_options

bin/install-password-argon2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ make test
1919
make install PREFIX=$LIBARGON2_INSTALL_DIR
2020
popd
2121

22-
# add the option in default_configure_options
23-
echo "--with-password-argon2=$LIBARGON2_INSTALL_DIR" >> $TRAVIS_BUILD_DIR/default_configure_options.${RELEASE}
22+
# add the option in custom_configure_options
23+
echo "--with-password-argon2=$LIBARGON2_INSTALL_DIR" >> $TRAVIS_BUILD_DIR/custom_configure_options

bin/install-pear

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sleep .1
1010
send -s -- "1\r"
1111

1212
expect -re "Installation base (.*):"
13-
send -s -- "/home/travis/.phpenv/versions/$env(VERSION)\r"
13+
send -s -- "$env(HOME)/.phpenv/versions/$env(VERSION)\r"
1414

1515
expect -re "1-\[0-9]+, 'all' or Enter to continue:"
1616
sleep .1

0 commit comments

Comments
 (0)