-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-osx
executable file
·103 lines (90 loc) · 2.25 KB
/
install-osx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/env bash
VERSION="DEFAULT"
CONFIG_PATH="DEFAULT"
PREFIX_ROOT="/usr/local/greathouse-php"
SCRIPT_DIR=`pwd`
UNPACK_SCRIPT="$SCRIPT_DIR/unpack"
while [[ $# -gt 1 ]]
do
key="$1"
case ${key} in
-v|--version)
VERSION="$2"
shift
;;
-p|--prefix-root)
PREFIX_ROOT="$2"
shift
;;
-c|--config-path)
CONFIG_PATH="$2"
shift
;;
esac
shift # past argument or value
done
if [ "$VERSION" == "DEFAULT" ]; then
echo "No version specified, using version 7.1.2"
VERSION="7.1.2"
fi
if [ "$CONFIG_PATH" == "DEFAULT" ]; then
CONFIG_PATH="$PREFIX_ROOT/etc"
fi
WORKDIR="$SCRIPT_DIR/php-$VERSION"
rm -rf ${WORKDIR}
if [ ! -d "$WORKDIR" ]; then
${UNPACK_SCRIPT} -v ${VERSION}
if [ ! -d "$WORKDIR" ]; then
echo "Unable to install version: $VERSION. Exiting."
exit
fi
fi
#install dependencies
brew tap homebrew/dupes
brew tap homebrew/versions
brew install curl --with-libssh2 --with-openssl
brew install autoconf automake gmp homebrew/versions/bison27 gd freetype t1lib gettext zlib mcrypt
if [ ! -d "$PREFIX_ROOT" ]; then
mkdir "$PREFIX_ROOT"
fi
if [ -d "$PREFIX_ROOT/$VERSION" ]; then
rm -rf "$PREFIX_ROOT/$VERSION"
fi
cd ${WORKDIR}
./buildconf
env YACC=`brew --prefix bison27`/bin/bison ./configure \
--prefix="$PREFIX_ROOT/$VERSION" \
--with-config-file-path="$CONFIG_PATH" \
--enable-mbstring \
--enable-zip \
--enable-bcmath \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-curl=`brew --prefix curl` \
--with-iconv \
--with-gmp \
--with-gd \
--with-jpeg-dir=`brew --prefix gd` \
--with-png-dir=`brew --prefix gd` \
--with-freetype-dir=`brew --prefix freetype` \
--with-t1lib=`brew --prefix t1lib` \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-openssl=`brew --prefix openssl` \
--enable-mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/tmp/mysql.sock \
--with-gettext=`brew --prefix gettext` \
--with-zlib=`brew --prefix zlib` \
--with-bz2 \
--with-mcrypt=`brew --prefix mcrypt`
make -j `sysctl -n hw.logicalcpu_max`
make install
rm -rf ${WORKDIR}