travis: use pmmp/leveldb

This commit is contained in:
Dylan K. Taylor 2020-11-03 17:56:15 +00:00
parent 5c5fe15483
commit c3af0eff93

View File

@ -9,30 +9,37 @@ before_script:
- |
set -e
LEVELDB_VERSION="10f59b56bec1db3ffe42ff265afe22182073e0e2"
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-mcpe/archive/$LEVELDB_VERSION.tar.gz" | tar -zx
mv "./leveldb-mcpe-$LEVELDB_VERSION" leveldb-mcpe-build
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
make -j4 sharedlibs
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
#put the artifacts in a separate dir, to avoid bloating travis cache"
mv out-shared/libleveldb.* ../leveldb-mcpe
mv include ../leveldb-mcpe
cd ../leveldb-mcpe
echo "$LEVELDB_VERSION" > "./built_version"
cd ..
else
echo "Using cached build for LevelDB version $LEVELDB_VERSION"
fi
- git clone https://github.com/reeze/php-leveldb.git leveldb
- git clone https://github.com/pmmp/php-leveldb.git leveldb
- cd leveldb
- git checkout 9bcae79f71b81a5c3ea6f67e45ae9ae9fb2775a5
- git checkout bed651cf74e83139d97ebbcacc749fa7752b7782
- phpize
- ./configure --with-leveldb=../leveldb-mcpe && make && make install
- cd ..