42
42
# build: pnpm build --target aarch64-apple-darwin
43
43
build : pnpm build
44
44
setup : |
45
- brew install autoconf automake libtool re2c bison libiconv
45
+ brew install autoconf automake libtool re2c bison libiconv \
46
+ argon2 libzip
46
47
47
48
# TODO: Do we need to care about x86_64 macOS?
48
49
# NOTE: Unable to force link bison on macOS 13, which php-src requires.
51
52
# build: pnpm build --target x86_64-apple-darwin
52
53
build : pnpm build
53
54
setup : |
54
- brew install autoconf automake libtool re2c bison libiconv
55
+ brew install autoconf automake libtool re2c bison libiconv \
56
+ argon2 libzip
55
57
56
58
#
57
59
# Linux
@@ -64,10 +66,12 @@ jobs:
64
66
# build: pnpm build --target x86_64-unknown-linux-gnu
65
67
build : pnpm build
66
68
setup : |
67
- sudo apt-get update
68
- sudo apt-get install -y libssl-dev pkg-config build-essential \
69
+ apt-get update
70
+ apt-get install -y curl libssl-dev pkg-config build-essential \
69
71
libcurl4-openssl-dev autoconf libxml2-dev libsqlite3-dev \
70
- bison re2c libonig-dev patchelf
72
+ bison re2c libonig-dev patchelf zlib1g-dev openssh-client git \
73
+ libclang-dev libreadline-dev libpng-dev libjpeg-dev libzip-dev \
74
+ libsodium-dev libargon2-dev
71
75
72
76
# TODO: Can't use the musl container, need to build with ssh-agent access.
73
77
# TODO: Fails because missing x86_64-linux-musl-gcc
@@ -152,17 +156,42 @@ jobs:
152
156
if : ${{ !matrix.settings.docker }}
153
157
shell : bash
154
158
run : |
159
+ set -x
155
160
${{ matrix.settings.setup }}
156
161
157
162
# Use brew bison and libiconv manually. Force linking does not work on macOS 13
158
163
if [[ "$(uname)" == "Darwin" ]]; then
159
- export PATH="$(brew --prefix bison)/bin:$(brew --prefix libiconv)/bin:$PATH"
160
- export LDFLAGS="$LDFLAGS -L$(brew --prefix bison)/lib -L$(brew --prefix libiconv)/lib"
164
+ # Expose bison to compiler
165
+ export PATH="$(brew --prefix bison)/bin:$PATH"
166
+ export LDFLAGS="$LDFLAGS -L$(brew --prefix bison)/lib"
167
+ export CPPFLAGS="$CPPFLAGS -I$(brew --prefix bison)/include"
161
168
fi
162
169
163
170
cd php-src
164
171
./buildconf
165
- ./configure --enable-shared --enable-embed=shared --enable-zts --without-iconv --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-curl --enable-mbstring
172
+
173
+ # TODO: Figure out why macOS can't find libiconv
174
+ ./configure \
175
+ --enable-shared --enable-embed=shared \
176
+ --with-config-file-path=/usr/local/etc/php \
177
+ --with-config-file-scan-dir=/usr/local/etc/php/conf.d \
178
+ --enable-option-checking=fatal \
179
+ --with-pic \
180
+ --enable-zts \
181
+ --enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
182
+ --with-pdo-sqlite=/usr --with-sqlite3=/usr \
183
+ --with-openssl --with-password-argon2 --with-sodium=shared \
184
+ --with-curl \
185
+ --enable-mbstring --with-mhash \
186
+ --enable-exif `#--enable-gd` \
187
+ --with-zip --with-zlib \
188
+ --without-iconv \
189
+ --without-readline \
190
+ --disable-phpdbg \
191
+ --with-pear \
192
+ --enable-fileinfo \
193
+ --disable-cgi
194
+
166
195
make -j$([[ "$(uname)" == "Darwin" ]] && sysctl -n hw.physicalcpu || nproc)
167
196
sudo make install
168
197
cd ..
@@ -178,12 +207,8 @@ jobs:
178
207
options : ' --user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build'
179
208
shell : bash
180
209
run : |
181
- # Can't use the setup script because docker lacks sudo
182
- apt-get update
183
- apt-get install -y curl libssl-dev pkg-config build-essential \
184
- libcurl4-openssl-dev autoconf libxml2-dev libsqlite3-dev \
185
- bison re2c libonig-dev patchelf zlib1g-dev openssh-client git \
186
- libclang-dev
210
+ set -x
211
+ ${{ matrix.settings.setup }}
187
212
188
213
# Install rust toolchain
189
214
curl https://sh.rustup.rs -sSf | bash -s -- -y -t ${{ matrix.settings.target }}
@@ -206,8 +231,30 @@ jobs:
206
231
207
232
# Build PHP
208
233
cd php-src
209
- ./buildconf
210
- ./configure --enable-shared --enable-embed=shared --enable-zts --without-iconv --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-curl --enable-mbstring
234
+ ./buildconf --force
235
+
236
+ ./configure \
237
+ --prefix=/usr \
238
+ --enable-shared --enable-embed=shared \
239
+ --with-config-file-path=/usr/local/etc/php \
240
+ --with-config-file-scan-dir=/usr/local/etc/php/conf.d \
241
+ --enable-option-checking=fatal \
242
+ --with-pic \
243
+ --enable-zts \
244
+ --enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
245
+ --with-pdo-sqlite=/usr --with-sqlite3=/usr \
246
+ --with-openssl --with-password-argon2 --with-sodium=shared \
247
+ --with-curl \
248
+ --enable-mbstring --with-mhash \
249
+ --enable-exif --enable-gd \
250
+ --with-zip --with-zlib \
251
+ --without-iconv \
252
+ --with-readline \
253
+ --disable-phpdbg \
254
+ --with-pear \
255
+ --enable-fileinfo \
256
+ --disable-cgi
257
+
211
258
make -j$([[ "$(uname)" == "Darwin" ]] && sysctl -n hw.physicalcpu || nproc)
212
259
make install
213
260
cd ..
0 commit comments