From 31ec20c0398e8d1e8cb9ae7cde314fac1f06e521 Mon Sep 17 00:00:00 2001 From: Rendy Date: Sun, 22 Sep 2024 17:06:45 +0700 Subject: [PATCH 1/5] feat(ext): enable opcache,gmp,sodium,xsl ext - enable opcache extension by default with min php ver > 5.5.0 - enable gmp and sodium extensions if those libs exists in linux machine - enable xsl extension by default --- bin/install | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/bin/install b/bin/install index c40be12..d277fb1 100755 --- a/bin/install +++ b/bin/install @@ -15,7 +15,7 @@ install_php() { echo "Determining configuration options..." local source_path=$(get_download_file_path $install_type $version $tmp_download_dir) - local configure_options="$(construct_configure_options $install_path)" + local configure_options="$(construct_configure_options $install_path $version)" local make_flags="-j$ASDF_CONCURRENCY" local operating_system=$(uname -a) @@ -111,6 +111,7 @@ install_composer() { construct_configure_options() { local install_path=$1 + local version=$2 # many options included below are not applicable to newer PHP versions # including these will trigger a build warning, but will not b @@ -149,6 +150,7 @@ construct_configure_options() { --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-xmlrpc \ + --with-xsl \ --with-zip \ --with-zlib \ --without-snmp" @@ -191,6 +193,12 @@ construct_configure_options() { configure_options="$configure_options --without-pcre-jit" fi + version_builtin_opcache="5.5.0" + + if [ $(echo "$version,$version_builtin_opcache" | tr "," "\n" | sort -V -r | head -1) = "$version" ]; then + configure_options="$configure_options --with-opcache" + fi + echo "$configure_options" } @@ -342,6 +350,8 @@ os_based_configure_options() { else local jpeg_path=$(locate libjpeg.so | awk '{ print length(), $0 | "sort -n" }' | cut -d" " -f2- | head -n 1) local libpng_path=$(locate libpng.so | awk '{ print length(), $0 | "sort -n" }' | cut -d" " -f2- | head -n 1) + local libgmp_path=$(dirname $(locate libgmp.so | awk '{ print length(), $0 | "sort -n" }' | cut -d" " -f2- | head -n 1)) + local libsodium_path=$(dirname $(locate libsodium.so | awk '{ print length(), $0 | "sort -n" }' | cut -d" " -f2- | head -n 1)) configure_options="--with-openssl --with-curl --with-zlib --with-readline --with-gettext" if [ "$jpeg_path" = "" ]; then @@ -355,6 +365,18 @@ os_based_configure_options() { else configure_options="$configure_options --with-png-dir=$libpng_path --with-png" fi + + if [ "$libgmp_path" = "" ]; then + export ASDF_PKG_MISSING="$ASDF_PKG_MISSING gmp" + else + configure_options="$configure_options --with-gmp" + fi + + if [ "$libsodium_path" = "" ]; then + export ASDF_PKG_MISSING="$ASDF_PKG_MISSING sodium" + else + configure_options="$configure_options --with-sodium" + fi fi echo $configure_options From b156200f63a2a3cbcdb462573310b3a717ca454f Mon Sep 17 00:00:00 2001 From: Rendy Ananta Date: Sun, 22 Sep 2024 18:06:31 +0700 Subject: [PATCH 2/5] feat(version): exclude unstable versions (#2) --- bin/list-all | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/list-all b/bin/list-all index 3c5c3e0..935241c 100755 --- a/bin/list-all +++ b/bin/list-all @@ -12,6 +12,7 @@ versions=$( grep 'php-' | awk '!/({})/ {print $2}' | sed 's/refs\/tags\/php-//' | + grep -E -v -i "rc|alpha|beta|dev|pre" | sort_versions | xargs ) From 530799c5c8ce9a7130c7e3b45134497310768b5a Mon Sep 17 00:00:00 2001 From: Rendy Date: Sun, 22 Sep 2024 20:06:35 +0700 Subject: [PATCH 3/5] feat: simplify versioning --- bin/list-all | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/bin/list-all b/bin/list-all index 935241c..5e8b4b0 100755 --- a/bin/list-all +++ b/bin/list-all @@ -2,18 +2,14 @@ set -eo pipefail -sort_versions() { - sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\1/; s/$/.z/; G; s/\n/ /' | - LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}' -} - versions=$( git ls-remote --tags https://github.com/php/php-src.git | grep 'php-' | - awk '!/({})/ {print $2}' | + grep -E -v '\^\{\}' | + cut -f2 | sed 's/refs\/tags\/php-//' | grep -E -v -i "rc|alpha|beta|dev|pre" | - sort_versions | + sort -V | xargs ) From 86974c046b392dc5f32f836f406c71dd68173af8 Mon Sep 17 00:00:00 2001 From: Rendy Date: Sun, 1 Dec 2024 10:35:32 +0700 Subject: [PATCH 4/5] feat: install dependencies on osx --- bin/install | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/install b/bin/install index d277fb1..663096a 100755 --- a/bin/install +++ b/bin/install @@ -214,11 +214,15 @@ homebrew_package_path() { exit_if_homebrew_not_installed() { if [ "$(brew --version 2>/dev/null)" = "" ]; then - echo "ERROR: Please install homebrew for OSX" - exit 1 + echo "homebrew is not intalled, installing..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" fi } +install_dependencies_osx() { + brew install bison icu4c krb5 libedit libxml2 libpq bzip2 freetype gettext libiconv jpeg libpng libzip readline webp zlib gmp libsodium libiconv gmp imagemagick autoconf re2c pkg-config gd openssl@1.1 +} + os_based_configure_options() { local operating_system=$(uname -a) local configure_options="" @@ -227,6 +231,10 @@ os_based_configure_options() { exit_if_homebrew_not_installed + echo "gathering compile dependencies..." + + install_dependencies_osx + local bison_path=$(homebrew_package_path bison) local bzip2_path=$(homebrew_package_path bzip2) local freetype_path=$(homebrew_package_path freetype) From e30e8334a7d1410da5323525cc8def6e0e3fa08a Mon Sep 17 00:00:00 2001 From: Rendy Ananta Date: Sun, 1 Dec 2024 10:47:39 +0700 Subject: [PATCH 5/5] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e043afd..266902b 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ _Original version of this plugin created by [@Stratus3D](https://github.com/Stratus3D)_ +### This repository forked from [asdf-php community](https://github.com/asdf-community/asdf-php) repository due to unmaintained plugin. + ## Build History [![Build history](https://buildstats.info/github/chart/asdf-community/asdf-php?branch=master)](https://github.com/asdf-community/asdf-php/actions)