66# received a copy of the license along with this program; if you did not,
77# you can find it at https://www.php.net/license/3_01.txt
88
9- set -e
9+ set -xe
10+ . helper.sh
11+
1012install_deps () {
1113 arch=$( arch)
1214 # Do basic configuration of the system, and install build tools
@@ -22,59 +24,22 @@ install_deps() {
2224
2325 apk add curl git autoconf bison re2c pkgconf zlib-dev zstd-dev openssl-libs-static openssl-dev zlib-static zlib-dev
2426
25- # Build curl
26- test -d curl-8.0.0 && rm -f $_
27- curl -sSL https://github.com/curl/curl/releases/download/curl-8_0_0/curl-8.0.0.tar.gz | tar -xzf -
28- cd curl-8.0.0
29- ./configure --disable-shared --with-ssl --without-libidn2
30- make -j8
31- make install
32- cd ..
27+ install_curl
3328
34- test -d libzip-1.9.2 && rm -f $_
35- curl -sSL https://github.com/nih-at/libzip/releases/download/v1.9.2/libzip-1.9.2.tar.gz | tar -xzf -
36- cd libzip-1.9.2 && mkdir -p build && cd build
37- cmake -DBUILD_SHARED_LIBS=OFF -DENABLE_LZMA=OFF -DENABLE_BZIP2=OFF ..
38- make -j4 && make install
39- cd ../..
40- rm -fr libzip-1.9.2
29+ install_libzip
4130}
4231
4332install_dev_deps () {
4433 apk add gmp-dev judy-dev bsd-compat-headers m4
4534
46- test -d libxml2-2.10.3 && rm -f libxml2-2.10.3
47- curl -sSL https://github.com/GNOME/libxml2/archive/refs/tags/v2.10.3.tar.gz | tar -xzf -
48- cd libxml2-2.10.3 && mkdir -p build && cd build
49- cmake -DBUILD_SHARED_LIBS=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_ICONV=OFF -DCMAKE_BUILD_TYPE=Release ..
50- make -j4 && make install
51- cd ../..
52- rm -fr libxml2-2.10.3
35+ install_libxml2
5336}
5437
5538export -f install_deps install_dev_deps
5639. build-bash-base.sh " $@ "
5740
5841if [ " $BUILD_DEV " -eq 1 ]; then
59- cd ext
60-
61- git clone https://github.com/donhardman/php-memory-profiler.git memprof && cd " $_ "
62- git checkout 68eb143bd5700a6fe041826118aeb9a13a3fcef3
63- cd ..
64-
65- git clone https://github.com/tideways/php-xhprof-extension.git tideways_xhprof && cd " $_ "
66- git checkout 6ee298f910a3661960f454bd6a787686657c7570
67- cd ..
68-
69- # Still not working due to zend
70- # git clone https://github.com/donhardman/xdebug.git xdebug && cd "$_"
71- # git checkout xdebug_3_2
72- # cd ..
73-
74- cd ..
75-
76- # We need to rebuild because we modify extensions in PHP core code
77- ./buildconf --force
42+ build_dev_conf
7843fi
7944
8045MAKE_LDFLAGS=-ldl
@@ -94,9 +59,7 @@ ENABLE_STATIC=yes
9459 --enable-mbstring \
9560 " ${BUILD_EXTRA[@]} "
9661
97- sed -ie ' s/PHP_INI_ENTRY("openssl.cafile", NULL, PHP_INI_PERDIR, NULL)/PHP_INI_ENTRY("openssl.cafile", "\/etc\/ssl\/cert.pem", PHP_INI_PERDIR, NULL)/g' ext/openssl/openssl.c
98- sed -ie ' s/-export-dynamic//g' Makefile
99- sed -ie ' s/-o $(SAPI_CLI_PATH)/-all-static -o $(SAPI_CLI_PATH)/g' Makefile
62+ fix_static_linking
10063
10164make LDFLAGS=$MAKE_LDFLAGS -j8
10265make install-cli
0 commit comments