Skip to content

Commit

Permalink
Merge pull request #126 from yangweijie/patch-2
Browse files Browse the repository at this point in the history
添加 mac 安装xlswriter扩展脚本
  • Loading branch information
xianyunleo authored Nov 20, 2024
2 parents 59a0dbf + 128beb5 commit 26eae85
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions extra/darwin/Core/script/php/xlswriter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
dlDir=$1
phpDir=$2
extVersion=$3

cd $dlDir
echo 'Downloading...'
curl -C - -O -s https://pecl.php.net/get/xlswriter-$extVersion.tgz
echo 'Downloaded'
if [ -d "xlswriter-$extVersion" ]; then
rm -rf "xlswriter-$extVersion"
fi
if [ -f "xlswriter-$extVersion.tgz" ]; then
tar -zxf xlswriter-$extVersion.tgz
else
exit 1
fi

export HOMEBREW_NO_AUTO_UPDATE=1
brew install pkg-config autoconf automake libtool

x86_64_brewPath=/usr/local/homebrew/bin/brew

prefix=$(arch -x86_64 $x86_64_brewPath --prefix)
export CFLAGS=-I$prefix/include

cd "xlswriter-$extVersion"
$phpDir/bin/phpize
./configure --with-php-config=$phpDir/bin/php-config --enable-reader --with-zlib-dir=/Applications/EServer/Library/zlib
arch -x86_64 make -j4
make install

0 comments on commit 26eae85

Please sign in to comment.