Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions php-83/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,42 @@ RUN make -j1 install_sw install_ssldirs
RUN mkdir -p ${INSTALL_DIR}/bref/ssl && curl -Lk -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE}


###############################################################################
# ICU
# We need to compile ICU from source because Amazon Linux 2 only has ICU 50.2
# which is cripplingly old and we want to support newer Unicode standards
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know which minimum version we want or precisely which features (which will give us the version)?

I'm asking for #122

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The very latest version has the very latest unicode standard. We're not really looking for new "features", more so the implementation of the characters from the latest standard.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://cldr.unicode.org/downloads/cldr-47 is the standard implemented by 77.1.

# https://github.com/unicode-org/icu/releases
# Uses:
# - None
# Needed by:
# - libxml2
# - php intl extension
ENV VERSION_ICU=77.1
ENV ICU_BUILD_DIR=${BUILD_DIR}/icu
RUN set -xe; \
mkdir -p ${ICU_BUILD_DIR}; \
curl -Ls https://github.com/unicode-org/icu/releases/download/release-${VERSION_ICU//./-}/icu4c-${VERSION_ICU//./_}-src.tgz \
| tar xzC ${ICU_BUILD_DIR} --strip-components=1
WORKDIR ${ICU_BUILD_DIR}/source
RUN CFLAGS="" \
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-rpath,${INSTALL_DIR}/lib" \
./configure \
--prefix=${INSTALL_DIR} \
--enable-shared \
--disable-static \
--disable-samples \
--disable-tests \
--disable-extras \
--disable-layoutex
RUN make && make install


###############################################################################
# LIBXML2
# https://gitlab.gnome.org/GNOME/libxml2/-/releases
# Uses:
# - icu
# - zlib
# Needed by:
# - php
Expand All @@ -151,6 +183,9 @@ WORKDIR ${XML2_BUILD_DIR}/
RUN CFLAGS="" \
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \
PATH="${INSTALL_DIR}/bin:${PATH}" \
ICU_CFLAGS="-I${INSTALL_DIR}/include" \
ICU_LIBS="-L${INSTALL_DIR}/lib -licui18n -licuuc -licudata" \
./configure \
--prefix=${INSTALL_DIR} \
--with-sysroot=${INSTALL_DIR} \
Expand Down Expand Up @@ -399,10 +434,9 @@ RUN make && make install
# Install some dev files for using old libraries already on the system
# readline-devel : needed for the readline extension
# gettext-devel : needed for the --with-gettext flag
# libicu-devel : needed for intl
# libxslt-devel : needed for the XSL extension
# libffi-devel : needed for the FFI extension
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel libffi-devel
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libxslt-devel libffi-devel


# Note: this variable is used when building extra/custom extensions, do not remove
Expand Down Expand Up @@ -442,6 +476,7 @@ RUN ./buildconf --force
RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
CPPFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-O1 -Wl,--strip-all -Wl,--hash-style=both -pie" \
PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig:${INSTALL_DIR}/lib64/pkgconfig" \
./configure \
--prefix=${INSTALL_DIR} \
--enable-option-checking=fatal \
Expand Down
39 changes: 37 additions & 2 deletions php-84/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,42 @@ RUN make -j1 install_sw install_ssldirs
RUN mkdir -p ${INSTALL_DIR}/bref/ssl && curl -Lk -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE}


###############################################################################
# ICU
# We need to compile ICU from source because Amazon Linux 2 only has ICU 50.2
# which is cripplingly old and we want to support newer Unicode standards
# https://github.com/unicode-org/icu/releases
# Uses:
# - None
# Needed by:
# - libxml2
# - php intl extension
ENV VERSION_ICU=77.1
ENV ICU_BUILD_DIR=${BUILD_DIR}/icu
RUN set -xe; \
mkdir -p ${ICU_BUILD_DIR}; \
curl -Ls https://github.com/unicode-org/icu/releases/download/release-${VERSION_ICU//./-}/icu4c-${VERSION_ICU//./_}-src.tgz \
| tar xzC ${ICU_BUILD_DIR} --strip-components=1
WORKDIR ${ICU_BUILD_DIR}/source
RUN CFLAGS="" \
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-rpath,${INSTALL_DIR}/lib" \
./configure \
--prefix=${INSTALL_DIR} \
--enable-shared \
--disable-static \
--disable-samples \
--disable-tests \
--disable-extras \
--disable-layoutex
RUN make && make install


###############################################################################
# LIBXML2
# https://gitlab.gnome.org/GNOME/libxml2/-/releases
# Uses:
# - icu
# - zlib
# Needed by:
# - php
Expand All @@ -151,6 +183,9 @@ WORKDIR ${XML2_BUILD_DIR}/
RUN CFLAGS="" \
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \
PATH="${INSTALL_DIR}/bin:${PATH}" \
ICU_CFLAGS="-I${INSTALL_DIR}/include" \
ICU_LIBS="-L${INSTALL_DIR}/lib -licui18n -licuuc -licudata" \
./configure \
--prefix=${INSTALL_DIR} \
--with-sysroot=${INSTALL_DIR} \
Expand Down Expand Up @@ -402,10 +437,9 @@ RUN make && make install
# Install some dev files for using old libraries already on the system
# readline-devel : needed for the readline extension
# gettext-devel : needed for the --with-gettext flag
# libicu-devel : needed for intl
# libxslt-devel : needed for the XSL extension
# libffi-devel : needed for the FFI extension
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel libffi-devel
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libxslt-devel libffi-devel


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