PocketMine-MP/tests/travis/setup-php.yml
2020-11-03 17:56:15 +00:00

80 lines
2.6 KiB
YAML

dist: xenial
language: php
php:
- 7.3
- 7.4
before_script:
- phpenv config-rm xdebug.ini
- |
set -e
LEVELDB_VERSION="f520e1d607759b00e335e332469c9c1b13e05f41"
if [ ! -f "./leveldb-mcpe/built_version" ] || [ $(cat "./leveldb-mcpe/built_version") != "$LEVELDB_VERSION" ]; then
echo "Building new LevelDB"
rm -rf "./leveldb-mcpe" || true
mkdir "./leveldb-mcpe"
curl -fsSL "https://github.com/pmmp/leveldb/archive/$LEVELDB_VERSION.tar.gz" | tar -zx
mv "./leveldb-$LEVELDB_VERSION" leveldb-mcpe-build
DIR=$(pwd)/leveldb-mcpe
cd leveldb-mcpe-build
CFLAGS="-fPIC" CXXFLAGS="-fPIC" cmake . \
-DCMAKE_INSTALL_PREFIX="$DIR" \
-DCMAKE_PREFIX_PATH="$DIR" \
-DCMAKE_INSTALL_LIBDIR=lib \
-DLEVELDB_BUILD_TESTS=OFF \
-DLEVELDB_BUILD_BENCHMARKS=OFF \
-DLEVELDB_SNAPPY=OFF \
-DLEVELDB_ZSTD=OFF \
-DLEVELDB_TCMALLOC=OFF \
-DCMAKE_BUILD_TYPE=Release
make -j4 install
echo "$LEVELDB_VERSION" > "./built_version"
cd ..
else
echo "Using cached build for LevelDB version $LEVELDB_VERSION"
fi
- git clone https://github.com/pmmp/php-leveldb.git leveldb
- cd leveldb
- git checkout bed651cf74e83139d97ebbcacc749fa7752b7782
- phpize
- ./configure --with-leveldb=../leveldb-mcpe && make && make install
- cd ..
- git clone https://github.com/pmmp/ext-chunkutils2.git chunkutils
- cd chunkutils
- git checkout -f d8d762a597ac0da6f333f862096d6af0e6286b75
- phpize
- ./configure && make && make install
- cd ..
# - pecl install channel://pecl.php.net/pthreads-3.1.6
- echo | pecl install channel://pecl.php.net/yaml-2.1.0
- pecl install channel://pecl.php.net/crypto-0.3.1
- pecl install channel://pecl.php.net/ds-1.2.9
- pecl install channel://pecl.php.net/igbinary-3.1.2
- git clone https://github.com/pmmp/pthreads.git
- cd pthreads
- git checkout b81ab29df58fa0fb239a9d5ca1c2380a0d087feb
- phpize
- ./configure
- make
- make install
- cd ..
- |
git clone https://github.com/pmmp/ext-morton.git -b 0.1.0 --depth=1
cd ext-morton
phpize
./configure
make
make install
cd ..
- echo "extension=pthreads.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension=chunkutils2.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension=leveldb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension=morton.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- composer self-update --2
cache:
- leveldb-mcpe