Skip to content

Commit 9c962fb

Browse files
authored
Update compile.sh
1 parent 2f3280a commit 9c962fb

File tree

1 file changed

+49
-12
lines changed

1 file changed

+49
-12
lines changed

compile.sh

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
[ -z "$PHP_VERSION" ] && PHP_VERSION="8.2.17"
2+
[ -z "$PHP_VERSION" ] && PHP_VERSION="8.3.4"
33

44
ZLIB_VERSION="1.3.1"
55
GMP_VERSION="6.3.0"
@@ -16,6 +16,7 @@ LIBDEFLATE_VERSION="275aa5141db6eda3587214e0f1d3a134768f557d" #1.20
1616
LIBRDKAFKA_VER="2.1.1"
1717
LIBZSTD_VER="1.5.5"
1818
LIBGRPC_VER="1.58.1"
19+
LIBSNAPPY_VER="1.2.1"
1920
SASL2_VERSION="2.1.28"
2021

2122
EXT_PMMPTHREAD_VERSION="6.1.0"
@@ -25,17 +26,17 @@ EXT_CHUNKUTILS2_VERSION="0.3.5"
2526
EXT_XDEBUG_VERSION="3.3.1"
2627
EXT_IGBINARY_VERSION="3.2.15"
2728
EXT_CRYPTO_VERSION="abbe7cbf869f96e69f2ce897271a61d32f43c7c0"
29+
EXT_SNAPPY_VERSION="ab8b2b7375641f47deb21d8e8ba1a00ea5364cf6"
2830
EXT_RECURSIONGUARD_VERSION="0.1.0"
2931
EXT_LIBDEFLATE_VERSION="0.2.1"
3032
EXT_MORTON_VERSION="0.1.2"
3133
EXT_XXHASH_VERSION="0.2.0"
3234
EXT_ARRAYDEBUG_VERSION="0.2.0"
3335
EXT_ENCODING_VERSION="0.3.0"
3436
EXT_RDKAFKA_VERSION="6.0.3"
35-
EXT_ZSTD_VERSION="0.13.3"
37+
EXT_ZSTD_VERSION="0.13.0"
3638
EXT_GRPC_VERSION="1.57.3"
3739
EXT_VANILLAGENERATOR_VERSION="abd059fd2ca79888aab3b9c5070d83ceea55fada"
38-
EXT_SNAPPY_VERSION="0.2.2"
3940

4041
function write_out {
4142
echo "[$1] $2"
@@ -554,6 +555,46 @@ download_github_src "php/php-src" "php-$PHP_VERSION" "php" | tar -zx >> "$DIR/in
554555
mv php-src-php-$PHP_VERSION php
555556
write_done
556557

558+
function build_snappy {
559+
write_library snappy "$LIBSNAPPY_VER"
560+
local snappy_dir="./snappy-$LIBSNAPPY_VER"
561+
562+
if cant_use_cache "$snappy_dir"; then
563+
rm -rf "$snappy_dir"
564+
write_download
565+
git_download_file "https://github.com/google/snappy.git" "snappy" "$LIBSNAPPY_VER" $snappy_dir >> "$DIR/install.log" 2>&1
566+
echo -n " checking..."
567+
pushd $snappy_dir >> "$DIR/install.log" 2>&1
568+
if [ "$DO_STATIC" != "yes" ]; then
569+
local EXTRA_FLAGS="-DBUILD_SHARED_LIBS=ON"
570+
else
571+
local EXTRA_FLAGS=""
572+
fi
573+
mkdir -p cmake/build
574+
pushd cmake/build >> "$DIR/install.log" 2>&1
575+
cmake ../.. \
576+
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
577+
-DCMAKE_PREFIX_PATH="$INSTALL_DIR" \
578+
-DCMAKE_INSTALL_LIBDIR=lib \
579+
-DCMAKE_BUILD_TYPE=Release \
580+
$CMAKE_GLOBAL_EXTRA_FLAGS \
581+
$EXTRA_FLAGS \
582+
>> "$DIR/install.log" 2>&1
583+
write_compile
584+
make -j $THREADS >> "$DIR/install.log" 2>&1 && mark_cache
585+
else
586+
write_caching
587+
pushd "$grpc_dir/cmake/build"
588+
fi
589+
590+
write_install
591+
make install >> "$DIR/install.log" 2>&1
592+
popd >> "$DIR/install.log" 2>&1
593+
popd >> "$DIR/install.log" 2>&1
594+
595+
write_done
596+
}
597+
557598
function build_sasl2 {
558599
write_library sasl2 "$SASL2_VERSION"
559600
local sasl2_dir="./sasl2-$SASL2_VERSION"
@@ -1242,6 +1283,7 @@ function build_libdeflate {
12421283

12431284
cd "$LIB_BUILD_DIR"
12441285

1286+
build_snappy
12451287
build_zlib
12461288
build_gmp
12471289
build_openssl
@@ -1322,6 +1364,8 @@ git submodule update --init --recursive >> "$DIR/install.log" 2>&1
13221364
cd "$BUILD_DIR"
13231365
write_done
13241366

1367+
get_github_extension "snappy" "$EXT_SNAPPY_VERSION" "kjdev" "php-ext-snappy"
1368+
13251369
get_github_extension "leveldb" "$EXT_LEVELDB_VERSION" "pmmp" "php-leveldb"
13261370

13271371
get_github_extension "chunkutils2" "$EXT_CHUNKUTILS2_VERSION" "pmmp" "ext-chunkutils2"
@@ -1340,14 +1384,6 @@ get_github_extension "grpc" "$EXT_GRPC_VERSION" "larryTheCoder" "php-grpc"
13401384

13411385
get_github_extension "vanillagenerator" "$EXT_VANILLAGENERATOR_VERSION" "NetherGamesMC" "ext-vanillagenerator"
13421386

1343-
echo -n " snappy: downloading $EXT_SNAPPY_VERSION..."
1344-
git clone https://github.com/kjdev/php-ext-snappy.git "$BUILD_DIR/php/ext/snappy" >> "$DIR/install.log" 2>&1
1345-
cd "$BUILD_DIR/php/ext/snappy"
1346-
git checkout "$EXT_SNAPPY_VERSION" >> "$DIR/install.log" 2>&1
1347-
git submodule update --init --recursive >> "$DIR/install.log" 2>&1
1348-
cd "$BUILD_DIR"
1349-
write_done
1350-
13511387
get_github_extension "rdkafka" "$EXT_RDKAFKA_VERSION" "arnaud-lb" "php-rdkafka"
13521388

13531389
get_github_extension "zstd" "$EXT_ZSTD_VERSION" "kjdev" "php-ext-zstd"
@@ -1526,6 +1562,7 @@ $HAS_GD \
15261562
$HAS_FFI \
15271563
--with-rdkafka="$INSTALL_DIR" \
15281564
--with-leveldb="$INSTALL_DIR" \
1565+
--with-snappy-includedir="$INSTALL_DIR" \
15291566
--without-readline \
15301567
$HAS_DEBUG \
15311568
--enable-chunkutils2 \
@@ -1645,7 +1682,7 @@ echo "error_reporting=-1" >> "$INSTALL_DIR/bin/php.ini"
16451682
echo "display_errors=1" >> "$INSTALL_DIR/bin/php.ini"
16461683
echo "display_startup_errors=1" >> "$INSTALL_DIR/bin/php.ini"
16471684
echo "recursionguard.enabled=0 ;disabled due to minor performance impact, only enable this if you need it for debugging" >> "$INSTALL_DIR/bin/php.ini"
1648-
echo "extension_dir=./$INSTALL_DIR/lib/php/extensions/no-debug-zts-20220829" >> "$INSTALL_DIR/bin/php.ini"
1685+
echo "extension_dir=./$INSTALL_DIR/lib/php/extensions/no-debug-zts-20230831" >> "$INSTALL_DIR/bin/php.ini"
16491686

16501687
if [ "$HAVE_OPCACHE" == "yes" ]; then
16511688
echo "zend_extension=opcache.so" >> "$INSTALL_DIR/bin/php.ini"

0 commit comments

Comments
 (0)