Skip to content

Commit 29791ef

Browse files
Use ICU 77.1 on currently supported PHP versions
1 parent 6a1aa70 commit 29791ef

File tree

2 files changed

+74
-4
lines changed

2 files changed

+74
-4
lines changed

php-83/Dockerfile

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,42 @@ RUN make -j1 install_sw install_ssldirs
133133
RUN mkdir -p ${INSTALL_DIR}/bref/ssl && curl -Lk -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE}
134134

135135

136+
###############################################################################
137+
# ICU
138+
# We need to compile ICU from source because Amazon Linux 2 only has ICU 50.2
139+
# which is cripplingly old and we want to support newer Unicode standards
140+
# https://github.com/unicode-org/icu/releases
141+
# Uses:
142+
# - None
143+
# Needed by:
144+
# - libxml2
145+
# - php intl extension
146+
ENV VERSION_ICU=77.1
147+
ENV ICU_BUILD_DIR=${BUILD_DIR}/icu
148+
RUN set -xe; \
149+
mkdir -p ${ICU_BUILD_DIR}; \
150+
curl -Ls https://github.com/unicode-org/icu/releases/download/release-${VERSION_ICU//./-}/icu4c-${VERSION_ICU//./_}-src.tgz \
151+
| tar xzC ${ICU_BUILD_DIR} --strip-components=1
152+
WORKDIR ${ICU_BUILD_DIR}/source
153+
RUN CFLAGS="" \
154+
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
155+
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-rpath,${INSTALL_DIR}/lib" \
156+
./configure \
157+
--prefix=${INSTALL_DIR} \
158+
--enable-shared \
159+
--disable-static \
160+
--disable-samples \
161+
--disable-tests \
162+
--disable-extras \
163+
--disable-layoutex
164+
RUN make && make install
165+
166+
136167
###############################################################################
137168
# LIBXML2
138169
# https://gitlab.gnome.org/GNOME/libxml2/-/releases
139170
# Uses:
171+
# - icu
140172
# - zlib
141173
# Needed by:
142174
# - php
@@ -151,6 +183,9 @@ WORKDIR ${XML2_BUILD_DIR}/
151183
RUN CFLAGS="" \
152184
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
153185
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \
186+
PATH="${INSTALL_DIR}/bin:${PATH}" \
187+
ICU_CFLAGS="-I${INSTALL_DIR}/include" \
188+
ICU_LIBS="-L${INSTALL_DIR}/lib -licui18n -licuuc -licudata" \
154189
./configure \
155190
--prefix=${INSTALL_DIR} \
156191
--with-sysroot=${INSTALL_DIR} \
@@ -399,10 +434,9 @@ RUN make && make install
399434
# Install some dev files for using old libraries already on the system
400435
# readline-devel : needed for the readline extension
401436
# gettext-devel : needed for the --with-gettext flag
402-
# libicu-devel : needed for intl
403437
# libxslt-devel : needed for the XSL extension
404438
# libffi-devel : needed for the FFI extension
405-
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel libffi-devel
439+
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libxslt-devel libffi-devel
406440

407441

408442
# Note: this variable is used when building extra/custom extensions, do not remove
@@ -442,6 +476,7 @@ RUN ./buildconf --force
442476
RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
443477
CPPFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
444478
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-O1 -Wl,--strip-all -Wl,--hash-style=both -pie" \
479+
PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig:${INSTALL_DIR}/lib64/pkgconfig" \
445480
./configure \
446481
--prefix=${INSTALL_DIR} \
447482
--enable-option-checking=fatal \

php-84/Dockerfile

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,42 @@ RUN make -j1 install_sw install_ssldirs
133133
RUN mkdir -p ${INSTALL_DIR}/bref/ssl && curl -Lk -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE}
134134

135135

136+
###############################################################################
137+
# ICU
138+
# We need to compile ICU from source because Amazon Linux 2 only has ICU 50.2
139+
# which is cripplingly old and we want to support newer Unicode standards
140+
# https://github.com/unicode-org/icu/releases
141+
# Uses:
142+
# - None
143+
# Needed by:
144+
# - libxml2
145+
# - php intl extension
146+
ENV VERSION_ICU=77.1
147+
ENV ICU_BUILD_DIR=${BUILD_DIR}/icu
148+
RUN set -xe; \
149+
mkdir -p ${ICU_BUILD_DIR}; \
150+
curl -Ls https://github.com/unicode-org/icu/releases/download/release-${VERSION_ICU//./-}/icu4c-${VERSION_ICU//./_}-src.tgz \
151+
| tar xzC ${ICU_BUILD_DIR} --strip-components=1
152+
WORKDIR ${ICU_BUILD_DIR}/source
153+
RUN CFLAGS="" \
154+
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
155+
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-rpath,${INSTALL_DIR}/lib" \
156+
./configure \
157+
--prefix=${INSTALL_DIR} \
158+
--enable-shared \
159+
--disable-static \
160+
--disable-samples \
161+
--disable-tests \
162+
--disable-extras \
163+
--disable-layoutex
164+
RUN make && make install
165+
166+
136167
###############################################################################
137168
# LIBXML2
138169
# https://gitlab.gnome.org/GNOME/libxml2/-/releases
139170
# Uses:
171+
# - icu
140172
# - zlib
141173
# Needed by:
142174
# - php
@@ -151,6 +183,9 @@ WORKDIR ${XML2_BUILD_DIR}/
151183
RUN CFLAGS="" \
152184
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
153185
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \
186+
PATH="${INSTALL_DIR}/bin:${PATH}" \
187+
ICU_CFLAGS="-I${INSTALL_DIR}/include" \
188+
ICU_LIBS="-L${INSTALL_DIR}/lib -licui18n -licuuc -licudata" \
154189
./configure \
155190
--prefix=${INSTALL_DIR} \
156191
--with-sysroot=${INSTALL_DIR} \
@@ -402,10 +437,9 @@ RUN make && make install
402437
# Install some dev files for using old libraries already on the system
403438
# readline-devel : needed for the readline extension
404439
# gettext-devel : needed for the --with-gettext flag
405-
# libicu-devel : needed for intl
406440
# libxslt-devel : needed for the XSL extension
407441
# libffi-devel : needed for the FFI extension
408-
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel libffi-devel
442+
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libxslt-devel libffi-devel
409443

410444

411445
# Note: this variable is used when building extra/custom extensions, do not remove
@@ -444,6 +478,7 @@ RUN ./buildconf --force
444478
RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
445479
CPPFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
446480
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-O1 -Wl,--strip-all -Wl,--hash-style=both -pie" \
481+
PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig:${INSTALL_DIR}/lib64/pkgconfig" \
447482
./configure \
448483
--prefix=${INSTALL_DIR} \
449484
--enable-option-checking=fatal \

0 commit comments

Comments
 (0)