forked from php-build/php-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-dependencies.sh
executable file
·146 lines (141 loc) · 3.13 KB
/
install-dependencies.sh
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/bin/sh
set -eu
if [ -f /etc/os-release ]; then
. /etc/os-release
fi
if [ -f /etc/debian_version ]; then
DISTRO=debian
elif [ -f /etc/redhat-release ]; then
DISTRO=rhel
elif [ "$(uname -s)" = "Darwin" ]; then
DISTRO=darwin
else
echo "Unsupported operating system"
exit 1
fi
if command -v sudo; then
SUDO=sudo
else
SUDO=
fi
# NOTES:
# * --with-libedit can be used to replace libreadline-dev with libedit-dev
# * libcurl4-openssl-dev may be used with PHP 5.6 or higher, but it will conflict
# with custom openssl 1.0.2 builds required for PHP 5.5 and lower.
case $DISTRO in
debian)
export DEBIAN_FRONTEND=nointeractive
$SUDO apt-get update -q
$SUDO apt-get install -q -y --no-install-recommends \
autoconf2.13 \
autoconf2.64 \
autoconf \
bash \
bison \
build-essential \
ca-certificates \
curl \
findutils \
git \
libbz2-dev \
libcurl4-gnutls-dev \
libicu-dev \
libjpeg-dev \
libmcrypt-dev \
libonig-dev \
libpng-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libtidy-dev \
libxml2-dev \
libxslt1-dev \
libzip-dev \
pkg-config \
re2c \
zlib1g-dev
;;
rhel)
$SUDO yum install -y yum-utils epel-release
if [[ "$VERSION_ID" =~ ^7 ]]; then
$SUDO yum-config-manager --enable PowerTools
# Install gcc v10 and enable it
$SUDO yum install -y centos-release-scl
$SUDO yum install -y devtoolset-10-gcc-c++
# Countermeasures for the message on the right: "MANPATH: unbound variable"
MANPATH=""
# Enable devtoolset-10 for gcc v10
source /opt/rh/devtoolset-10/enable
$SUDO yum install -y autoconf autoconf213
elif [[ "$VERSION_ID" =~ ^8 ]]; then
$SUDO yum install -y dnf-plugins-core
$SUDO yum config-manager --set-enabled powertools
$SUDO yum install -y autoconf autoconf213
else
$SUDO yum install -y dnf-plugins-core
$SUDO yum config-manager --set-enabled crb
$SUDO dnf -y swap curl-minimal curl
$SUDO yum install -y autoconf
fi
$SUDO yum install -y \
bash \
bison \
bzip2 \
bzip2-devel \
curl \
diffutils \
findutils \
gcc \
gcc-c++ \
git \
libarchive \
libcurl-devel \
libicu-devel \
libjpeg-turbo-devel \
libmcrypt-devel \
libpng-devel \
libtidy-devel \
libxml2-devel \
libxslt-devel \
make \
oniguruma-devel \
openssl-devel \
patch \
pkgconf \
readline-devel \
sqlite-devel \
zlib-devel \
cmake3
$SUDO curl https://github.com/nih-at/libzip/releases/download/v1.7.3/libzip-1.7.3.tar.gz -L -o libzip-1.7.3.tar.gz && \
tar -zxvf libzip-1.7.3.tar.gz && \
cd libzip-1.7.3 && \
cmake3 . -DCMAKE_INSTALL_PREFIX=/usr && \
make && \
make install
;;
darwin)
# brew install will fail if a package is already installed
# using brew bundle seems to be the recommended alternative
# https://github.com/Homebrew/brew/issues/2491
brew bundle --file=- <<-EOS
brew "autoconf"
brew "[email protected]"
brew "bzip2"
brew "icu4c"
brew "libedit"
brew "libiconv"
brew "libjpeg"
brew "libmcrypt"
brew "libxml2"
brew "libzip"
brew "oniguruma"
brew "openssl"
brew "pkg-config"
brew "python"
brew "re2c"
brew "tidy-html5"
brew "zlib"
EOS
;;
*)
esac