Skip to content

Commit 26eae85

Browse files
authored
Merge pull request #126 from yangweijie/patch-2
添加 mac 安装xlswriter扩展脚本
2 parents 59a0dbf + 128beb5 commit 26eae85

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
dlDir=$1
3+
phpDir=$2
4+
extVersion=$3
5+
6+
cd $dlDir
7+
echo 'Downloading...'
8+
curl -C - -O -s https://pecl.php.net/get/xlswriter-$extVersion.tgz
9+
echo 'Downloaded'
10+
if [ -d "xlswriter-$extVersion" ]; then
11+
rm -rf "xlswriter-$extVersion"
12+
fi
13+
if [ -f "xlswriter-$extVersion.tgz" ]; then
14+
tar -zxf xlswriter-$extVersion.tgz
15+
else
16+
exit 1
17+
fi
18+
19+
export HOMEBREW_NO_AUTO_UPDATE=1
20+
brew install pkg-config autoconf automake libtool
21+
22+
x86_64_brewPath=/usr/local/homebrew/bin/brew
23+
24+
prefix=$(arch -x86_64 $x86_64_brewPath --prefix)
25+
export CFLAGS=-I$prefix/include
26+
27+
cd "xlswriter-$extVersion"
28+
$phpDir/bin/phpize
29+
./configure --with-php-config=$phpDir/bin/php-config --enable-reader --with-zlib-dir=/Applications/EServer/Library/zlib
30+
arch -x86_64 make -j4
31+
make install

0 commit comments

Comments
 (0)