Skip to content

Commit

Permalink
Merge pull request #717 from jingjingxyk/experiment_v4.8.x
Browse files Browse the repository at this point in the history
Experiment v4.8.x
  • Loading branch information
jingjingxyk committed Jul 31, 2024
2 parents b5dc348 + 58aea1a commit 2749b1d
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 86 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/macos-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,8 @@ jobs:
echo "X_IPV6=${IPV6}" >> $GITHUB_ENV
echo "X_IPV4=${IPV4}" >> $GITHUB_ENV
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export PATH="/opt/homebrew/opt/flex/bin:$PATH"
export PATH="/opt/homebrew/opt/bison/bin:$PATH"
export PATH="/opt/homebrew/opt/libtool/bin:$PATH"
ln -sf /opt/homebrew/opt/libtool/bin/glibtool /opt/homebrew/opt/libtool/bin/libtool
ln -sf /opt/homebrew/opt/libtool/bin/glibtoolize /opt/homebrew/opt/libtool/bin/libtoolize
ls -lha /opt/homebrew/opt/libtool/bin/
libtoolize --version
libtool --help-all
Expand Down Expand Up @@ -123,10 +118,6 @@ jobs:
- name: Build
run: |
export PATH=${{ github.workspace }}/bin/runtime:$PATH
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export PATH="/opt/homebrew/opt/flex/bin:$PATH"
export PATH="/opt/homebrew/opt/bison/bin:$PATH"
export PATH="/opt/homebrew/opt/libtool/bin:$PATH"
bash make-install-deps.sh
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,8 @@ jobs:
echo "X_IPV6=${IPV6}" >> $GITHUB_ENV
echo "X_IPV4=${IPV4}" >> $GITHUB_ENV
export PATH=/usr/local/opt/llvm/bin:$PATH
export PATH=/usr/local/opt/flex/bin:$PATH
export PATH=/usr/local/opt/bison/bin:$PATH
export PATH=/usr/local/opt/libtool/bin:$PATH
ln -sf /usr/local/opt/libtool/bin/glibtool /usr/local/opt/libtool/bin/libtool
ln -sf /usr/local/opt/libtool/bin/glibtoolize /usr/local/opt/libtool/bin/libtoolize
ls -lha /usr/local/opt/libtool/bin/
libtoolize --version
Expand Down Expand Up @@ -122,10 +117,6 @@ jobs:
- name: Build
run: |
export PATH=${{ github.workspace }}/bin/runtime:$PATH
export PATH=/usr/local/opt/llvm/bin:$PATH
export PATH=/usr/local/opt/flex/bin:$PATH
export PATH=/usr/local/opt/bison/bin:$PATH
export PATH=/usr/local/opt/libtool/bin:$PATH
bash make-install-deps.sh
Expand Down
3 changes: 2 additions & 1 deletion build-release-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ if [ ${WITH_PHP_COMPOSER} -eq 1 ]; then
# composer dump-autoload

# composer update --optimize-autoloader
composer install --no-interaction --no-autoloader --no-scripts --profile # --no-dev
# composer install --no-interaction --no-autoloader --no-scripts --profile # --no-dev
composer install --no-interaction --no-autoloader --no-scripts --prefer-dist -vv --profile # --no-dev
composer dump-autoload --optimize --profile

composer config -g --unset repos.packagist
Expand Down
20 changes: 17 additions & 3 deletions prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,23 @@
if ($p->isMacos()) {
$p->setExtraLdflags('-undefined dynamic_lookup');
if (is_file('/usr/local/opt/llvm/bin/ld64.lld')) {
$p->withBinPath('/usr/local/opt/llvm/bin')->setLinker('ld64.lld');
} elseif (is_file('/opt/homebrew/opt/llvm/bin/ld64.lld')) { //兼容 github action
$p->withBinPath('/opt/homebrew/opt/llvm/bin/')->setLinker('ld64.lld');
$p->withBinPath('/usr/local/opt/llvm/bin')
->withBinPath('/usr/local/opt/flex/bin')
->withBinPath('/usr/local/opt/bison/bin')
->withBinPath('/usr/local/opt/libtool/bin')
->withBinPath('/usr/local/opt/m4/bin')
->withBinPath('/usr/local/opt/automake/bin/')
->withBinPath('/usr/local/opt/autoconf/bin/')
->setLinker('ld64.lld');
} elseif (is_file('/opt/homebrew/opt/llvm/bin/ld64.lld')) {
$p->withBinPath('/opt/homebrew/opt/llvm/bin/')
->withBinPath('/opt/homebrew/opt/flex/bin')
->withBinPath('/opt/homebrew/opt/bison/bin')
->withBinPath('/opt/homebrew/opt/libtool/bin')
->withBinPath('/opt/homebrew/opt/m4/bin')
->withBinPath('/opt/homebrew/opt/automake/bin/')
->withBinPath('/opt/homebrew/opt/autoconf/bin/')
->setLinker('ld64.lld');
} else {
$p->setLinker('lld');
}
Expand Down
105 changes: 44 additions & 61 deletions sapi/quickstart/macos/macos-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,43 +29,42 @@ while [ $# -gt 0 ]; do
shift $(($# > 0 ? 1 : 0))
done


case "$MIRROR" in
china|ustc)
export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"
china | ustc)
export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"

export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
export PIPENV_PYPI_MIRROR="https://pypi.tuna.tsinghua.edu.cn/simple"
export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
export PIPENV_PYPI_MIRROR="https://pypi.tuna.tsinghua.edu.cn/simple"

# pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# pip3 config set global.index-url https://pypi.python.org/simple
# pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# pip3 config set global.index-url https://pypi.python.org/simple

# 参考文档: https://help.mirrors.cernet.edu.cn/homebrew/
;;
# 参考文档: https://help.mirrors.cernet.edu.cn/homebrew/
;;

esac

export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_INSTALL_FROM_API=1

if [ ${WITH_UPDATE} -eq 1 ] ; then
if [ ${WITH_UPDATE} -eq 1 ]; then
case "$MIRROR" in
china|ustc)
brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.ustc.edu.cn/homebrew-cask.git
brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.ustc.edu.cn/homebrew-cask-versions.git
brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.ustc.edu.cn/homebrew-services.git

# 参考文档: https://help.mirrors.cernet.edu.cn/homebrew/
# reset
# brew tap --custom-remote --force-auto-update homebrew/cask https://github.com/Homebrew/homebrew-cask
# brew tap --custom-remote --force-auto-update homebrew/cask-versions https://github.com/Homebrew/homebrew-cask-versions
# brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.ustc.edu.cn/homebrew-services.git
;;
china | ustc)
brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.ustc.edu.cn/homebrew-cask.git
brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.ustc.edu.cn/homebrew-cask-versions.git
brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.ustc.edu.cn/homebrew-services.git

# 参考文档: https://help.mirrors.cernet.edu.cn/homebrew/
# reset
# brew tap --custom-remote --force-auto-update homebrew/cask https://github.com/Homebrew/homebrew-cask
# brew tap --custom-remote --force-auto-update homebrew/cask-versions https://github.com/Homebrew/homebrew-cask-versions
# brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.ustc.edu.cn/homebrew-services.git
;;
esac

brew update
Expand All @@ -74,47 +73,37 @@ if [ ${WITH_UPDATE} -eq 1 ] ; then

fi



# brew install wget curl libtool automake re2c llvm flex bison
# brew install libtool gettext coreutils libunistring pkg-config cmake
brew install wget curl libtool automake re2c llvm flex bison m4 autoconf
brew install libtool gettext coreutils libunistring pkg-config cmake
# macos 环境下 Homebrew packages : coreutils binutils 不兼容
# 详见: https://github.com/pyenv/pyenv/wiki/Common-build-problems#keg-only-homebrew-packages-are-forcibly-linked--added-to-path

# 已安装的包 跳过安装
PACKAGES_1=(wget curl libtool automake re2c llvm flex bison)
PACKAGES_2=(libtool gettext coreutils libunistring pkg-config cmake)

PACKAGES=("${PACKAGES_1[@]}" "${PACKAGES_2[@]}")
for PACKAGE in "${PACKAGES[@]}"; do
brew list "$PACKAGE" &>/dev/null || brew install "$PACKAGE"
done
# PACKAGES_1=(wget curl libtool automake re2c llvm flex bison m4 autoconf)
# PACKAGES_2=(libtool gettext coreutils libunistring pkg-config cmake)

# PACKAGES=("${PACKAGES_1[@]}" "${PACKAGES_2[@]}")
# for PACKAGE in "${PACKAGES[@]}"; do
# brew list "$PACKAGE" &>/dev/null || brew install "$PACKAGE"
# done

which glibtool


# maocs intel
# HOMEBREW_PREFIX: /usr/local
if [ -d /usr/local/opt/libtool/bin/ ] ; then
if [ -d /usr/local/opt/libtool/bin/ ]; then
ln -sf /usr/local/opt/libtool/bin/glibtool /usr/local/opt/libtool/bin/libtool
ln -sf /usr/local/opt/libtool/bin/glibtoolize /usr/local/opt/libtool/bin/libtoolize
export PATH=/usr/local/opt/libtool/bin/:$PATH
ln -sf /usr/local/bin/glibtool /usr/local/bin/libtool
ln -sf /usr/local/bin/glibtoolize /usr/local/bin/libtoolize

fi

# macos M1
# HOMEBREW_PREFIX=/opt/homebrew
# HOMEBREW_REPOSITORY=/opt/homebrew
if [ -d /opt/homebrew/opt/libtool/bin ] ; then
ln -sf /opt/homebrew/opt/libtool/bin/glibtool /opt/homebrew/opt/libtool/bin/libtool
ln -sf /opt/homebrew/opt/libtool/bin/glibtoolize /opt/homebrew/opt/libtool/bin/libtoolize
export PATH=/opt/homebrew/opt/libtool/bin/:$PATH
ln -sf /opt/homebrew/opt/libtool/bin/glibtool /usr/local/bin/libtool
ln -sf /opt/homebrew/opt/libtool/bin/glibtoolize /usr/local/bin/libtoolize

if [ -d /opt/homebrew/opt/libtool/bin ]; then
ln -sf /opt/homebrew/opt/libtool/bin/glibtool /opt/homebrew/opt/libtool/bin/libtool
ln -sf /opt/homebrew/opt/libtool/bin/glibtoolize /opt/homebrew/opt/libtool/bin/libtoolize
export PATH=/opt/homebrew/opt/libtool/bin/:$PATH
fi

libtoolize --version
Expand All @@ -126,18 +115,14 @@ which libtool
brew uninstall --ignore-dependencies --force snappy
brew uninstall --ignore-dependencies --force capstone

brew install xz zip unzip gzip bzip2 7zip p7zip
brew install git ca-certificates



brew install xz zip unzip gzip bzip2 7zip p7zip
brew install git ca-certificates

brew install yasm nasm
brew install ninja python3
brew install diffutils
brew install netcat socat
brew install mercurial

brew install yasm nasm
brew install ninja python3
brew install diffutils
brew install netcat socat
brew install mercurial

case "$MIRROR" in
china | tuna | ustc)
Expand All @@ -147,12 +132,10 @@ china | tuna | ustc)
tencentyun | huaweicloud)
test "$MIRROR" = "tencentyun" && pip3 config set global.index-url https://mirrors.tencentyun.com/pypi/simple/
test "$MIRROR" = "huaweicloud" && pip3 config set global.index-url https://repo.huaweicloud.com/pypi/simple/
;;
esac

pip3 install meson


brew uninstall --ignore-dependencies --force snappy
brew uninstall --ignore-dependencies --force capstone


3 changes: 1 addition & 2 deletions sapi/src/builder/extension/pdo_odbc.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
(new Extension('pdo_odbc'))
->withHomePage('https://www.php.net/manual/zh/ref.pdo-odbc.php')
->withLicense('https://github.com/php/php-src/blob/master/LICENSE', Extension::LICENSE_PHP)
->withUrl('https://github.com/php/php-src.git ')
->withFile('pdo_odbc-' . $php_version . '.tgz')
->withDownloadScript(
'pdo_odbc',
Expand All @@ -20,7 +19,7 @@
EOF
)
->withOptions('--with-pdo-odbc=unixODBC,' . $unixODBC_prefix)
->withDependentLibraries('unixODBC')
->withDependentLibraries('unix_odbc')
->withDependentExtensions('pdo')
);
};
5 changes: 4 additions & 1 deletion sapi/src/builder/library/unix_odbc.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
)
->withconfigure(
<<<EOF
autoreconf -ivf
aclocal
autoconf
autoheader
automake --add-missing
./configure --help
PACKAGES_NAMES="readline"
Expand Down
3 changes: 3 additions & 0 deletions sapi/src/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@
define("LIBFFI_PREFIX", $p->getGlobalPrefix() . '/libffi');
define("EXAMPLE_PREFIX", $p->getGlobalPrefix() . '/example');




0 comments on commit 2749b1d

Please sign in to comment.