Skip to content

Commit

Permalink
Merge pull request #508 from aran112000/php83-imagick
Browse files Browse the repository at this point in the history
Imagick support for PHP 8.3
  • Loading branch information
mnapoli authored Dec 6, 2023
2 parents aba7990 + c3d91d7 commit a94231d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
20 changes: 11 additions & 9 deletions layers/imagick/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,30 @@ RUN LD_LIBRARY_PATH= yum -y install libpng-devel libjpeg-devel lcms2-devel Image

# Compile libwebp since AL2 ships with v0.3, and v0.4 or higher is required to builder the other libs
WORKDIR ${IMAGICK_BUILD_DIR}
RUN curl -Ls -o libwebp.tar.gz https://github.com/webmproject/libwebp/archive/refs/tags/v1.3.1.tar.gz
RUN curl -Ls -o libwebp.tar.gz https://github.com/webmproject/libwebp/archive/refs/tags/v1.3.2.tar.gz
RUN tar xzf libwebp.tar.gz
WORKDIR ${IMAGICK_BUILD_DIR}/libwebp-1.3.1
WORKDIR ${IMAGICK_BUILD_DIR}/libwebp-1.3.2
RUN autoreconf -i && automake && autoconf
RUN ./configure --prefix ${INSTALL_DIR} --exec-prefix ${INSTALL_DIR}
RUN make -j $(nproc)
RUN make install

# Compile libde265 (libheif dependency)
WORKDIR ${IMAGICK_BUILD_DIR}
RUN curl -Ls -o libde265.tar.gz https://github.com/strukturag/libde265/releases/download/v1.0.12/libde265-1.0.12.tar.gz
RUN curl -Ls -o libde265.tar.gz https://github.com/strukturag/libde265/releases/download/v1.0.14/libde265-1.0.14.tar.gz
RUN tar xzf libde265.tar.gz
WORKDIR ${IMAGICK_BUILD_DIR}/libde265-1.0.12
WORKDIR ${IMAGICK_BUILD_DIR}/libde265-1.0.14
RUN ./configure --prefix ${INSTALL_DIR} --exec-prefix ${INSTALL_DIR}
RUN make -j $(nproc)
RUN make install

# Compile libheif
WORKDIR ${IMAGICK_BUILD_DIR}
RUN curl -Ls -o libheif.tar.gz https://github.com/strukturag/libheif/releases/download/v1.13.0/libheif-1.13.0.tar.gz
RUN curl -Ls -o libheif.tar.gz https://github.com/strukturag/libheif/releases/download/v1.17.5/libheif-1.17.5.tar.gz
RUN tar xzf libheif.tar.gz
WORKDIR ${IMAGICK_BUILD_DIR}/libheif-1.13.0
RUN ./configure --prefix ${INSTALL_DIR} --exec-prefix ${INSTALL_DIR}
RUN mkdir ${IMAGICK_BUILD_DIR}/libheif-1.17.5/build
WORKDIR ${IMAGICK_BUILD_DIR}/libheif-1.17.5/build
RUN cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
RUN make -j $(nproc)
RUN make install

Expand All @@ -47,9 +48,9 @@ RUN cp bin/gs /tmp/gs

# Compile the ImageMagick library
WORKDIR ${IMAGICK_BUILD_DIR}
RUN curl -Ls -o ImageMagick.tar.gz https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.1-15.tar.gz
RUN curl -Ls -o ImageMagick.tar.gz https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.1-22.tar.gz
RUN tar xzf ImageMagick.tar.gz
WORKDIR ${IMAGICK_BUILD_DIR}/ImageMagick-7.1.1-15
WORKDIR ${IMAGICK_BUILD_DIR}/ImageMagick-7.1.1-22
RUN ./configure --prefix ${INSTALL_DIR} --exec-prefix ${INSTALL_DIR} --with-webp --with-heic --disable-static --with-freetype=yes
RUN make -j $(nproc)
RUN make install
Expand All @@ -61,6 +62,7 @@ RUN convert -list configure
WORKDIR ${IMAGICK_BUILD_DIR}
RUN git clone https://github.com/Imagick/imagick
WORKDIR ${IMAGICK_BUILD_DIR}/imagick
# TODO; update the commit hash once this PR has been merged with PHP 8.3 support: https://github.com/Imagick/imagick/pull/641
RUN git reset --hard 28f27044e435a2b203e32675e942eb8de620ee58
RUN phpize
RUN ./configure --with-imagick=${INSTALL_DIR}
Expand Down
3 changes: 2 additions & 1 deletion layers/imagick/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"php": [
"80",
"81",
"82"
"82",
"83"
]
}

0 comments on commit a94231d

Please sign in to comment.