From 6afbd1f55c4af9758291e53cddba3e094bea1144 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 14 Dec 2020 21:58:58 +0000 Subject: [PATCH] Squashed commit of the following: commit 1f42169f0f929958f7d68a68f194c6f3492b7eb4 Author: Dylan K. Taylor Date: Mon Dec 14 21:23:44 2020 +0000 ... install it in the right fucking place commit d2a88abeda5fa937d3f508c4e0300a949af97846 Author: Dylan K. Taylor Date: Mon Dec 14 21:14:21 2020 +0000 Build PHP using system libraries to reduce rebuild time --- .github/workflows/main.yml | 6 ++--- tests/gh-actions/build.sh | 54 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 4 deletions(-) create mode 100755 tests/gh-actions/build.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fef4346f8..0a26c8a80 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,13 +24,11 @@ jobs: uses: actions/cache@v2 with: path: "./bin" - key: "php-build-generic-${{ hashFiles('./build/php/compile.sh') }}" + key: "php-build-generic-${{ hashFiles('./tests/gh-actions/build.sh') }}" - name: Compile PHP if: steps.php-build-cache.outputs.cache-hit != 'true' - run: | - sudo apt update && sudo apt install -y re2c libtool libtool-bin - march=x86-64 ./build/php/compile.sh -j8 + run: ./tests/gh-actions/build.sh - name: Prefix PHP to PATH run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH diff --git a/tests/gh-actions/build.sh b/tests/gh-actions/build.sh new file mode 100755 index 000000000..a00afb0e2 --- /dev/null +++ b/tests/gh-actions/build.sh @@ -0,0 +1,54 @@ +VERSION=7.4.13 +sudo apt update && sudo apt install -y \ + re2c \ + libtool \ + libtool-bin \ + zlib1g-dev \ + libcurl4-openssl-dev \ + libxml2-dev \ + libyaml-dev \ + libgmp-dev \ + libzip-dev \ + libssl-dev + +curl -sSL https://www.php.net/distributions/php-$VERSION.tar.gz | tar -xz + +INSTALL_DIR="$(pwd)/bin/php7" +cd php-$VERSION +cd ext/ +curl -sSL https://github.com/pmmp/pthreads/archive/2bcd8b8c10395d58b8a9bc013e3a5328080c867f.tar.gz | tar -xz +curl -sSL https://github.com/php/pecl-file_formats-yaml/archive/2.2.0.tar.gz | tar -xz +cd .. + +CFLAGS="$CFLAGS -march=x86-64" +CXXFLAGS="CXXFLAGS -march=x86-64" + +./buildconf --force +./configure \ + --prefix="$INSTALL_DIR" \ + --exec-prefix="$INSTALL_DIR" \ + --enable-maintainer-zts \ + --enable-cli \ + --disable-cgi \ + --disable-phpdbg \ + --disable-session \ + --without-pear \ + --without-sqlite3 \ + --disable-pdo \ + --enable-pthreads \ + --with-yaml \ + --with-libxml \ + --enable-xml \ + --enable-simplexml \ + --enable-xmlreader \ + --enable-xmlwriter \ + --enable-mbstring \ + --disable-mbregex \ + --enable-sockets \ + --with-curl \ + --with-zlib \ + --with-zip \ + --with-gmp \ + --with-openssl + +make -j8 install