Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
navidemad committed Aug 1, 2024
1 parent c755e60 commit fa7b9c5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
3 changes: 2 additions & 1 deletion bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ function indent() {
esac
}

ls -lahR /app/vendor/imagemagick | indent
ls -lahR /usr/local/lib | indent
ls -lahR /app/vendor/imagemagick/lib | indent

magick -list configure | indent
# magick -resize 100 fixtures/test.avif fixtures/test-resize.avif | indent
Expand Down
4 changes: 2 additions & 2 deletions build/configurations/heroku-24.config.log
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Path: /usr/local/lib/ImageMagick-7.1.1//config-Q16HDRI/configure.xml
Name Value
-------------------------------------------------------------------------------
CC gcc
CFLAGS -I/usr/include/libxml2 -I/usr/local/include -I/usr/local/include/webp -I/usr/local/include -I/usr/local/include/webp -I/usr/local/include -I/usr/local/include/webp -I/usr/include/libpng16 -I/usr/include/lqr-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/openjpeg-2.5 -I/usr/local/include -I/usr/local/include/webp -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -pthread -fopenmp -Wall -g -O2 -mtune=westmere -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32
CFLAGS -I/usr/include/libxml2 -I/usr/local/include -I/usr/local/include/webp -I/usr/local/include -I/usr/local/include/webp -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/usr/local/include/webp -I/usr/include/libpng16 -I/usr/include/lqr-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/openjpeg-2.5 -I/usr/local/include -I/usr/local/include/webp -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -pthread -fopenmp -Wall -g -O2 -mtune=westmere -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32
CHANNEL_MASK_DEPTH 32
CODER_PATH /usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/coders
CONFIGURE ./configure '--prefix=/usr/local' '--disable-docs' '--with-avif=yes' '--with-heic=yes' '--with-webp=yes' '--with-tiff=yes' '--with-x=no' '--with-zip=no' '--with-gvc=no' '--with-openexr=no' 'PKG_CONFIG_PATH=/usr/local/lib/pkgconfig'
Expand All @@ -29,7 +29,7 @@ LDFLAGS -L/usr/local/lib
LIB_VERSION 0x711
LIB_VERSION_NUMBER 7,1,1,36
LIBRARY_PATH /usr/local/lib/ImageMagick-7.1.1
LIBS -ljbig -llcms2 -L/usr/local/lib -ltiff -lfreetype -ljpeg -llqr-1 -lglib-2.0 -lpng16 -ldjvulibre -lfontconfig -lfreetype -L/usr/local/lib -lheif -L/usr/local/lib -lwebpmux -lwebpdemux -L/usr/local/lib -lwebp -llzma -lbz2 -lopenjp2 -lxml2 -lz -lm -lpthread -lgomp
LIBS -ljbig -llcms2 -ltiff -lfreetype -ljpeg -llqr-1 -lglib-2.0 -lpng16 -ldjvulibre -lfontconfig -lfreetype -L/usr/local/lib -lheif -L/usr/local/lib -lwebpmux -lwebpdemux -L/usr/local/lib -lwebp -llzma -lbz2 -lopenjp2 -lxml2 -lz -lm -lpthread -lgomp
NAME ImageMagick
PCFLAGS -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32
PREFIX /usr/local
Expand Down
Binary file modified build/heroku-24.tar.bz2
Binary file not shown.
35 changes: 19 additions & 16 deletions container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,20 @@ RUN set -ex \
pkg-config \
ninja-build \
yasm \
liblerc-dev \
libtiff-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/*

# Build and install libtiff
RUN set -ex \
&& mkdir -p libtiff \
&& cd libtiff \
&& curl --retry-connrefused --retry 3 -ksSL "https://gitlab.com/faxguy/libtiff-tools/-/archive/$COMPILE_VERSION_LIBTIFF/libtiff-tools-$COMPILE_VERSION_LIBTIFF.tar.gz" | tar zx --strip-components=1 \
&& ./autogen.sh \
&& ./configure --prefix=$PREFIX \
&& make V=0 --jobs=$(nproc) \
&& make install --jobs=$(nproc)
# # Build and install libtiff
# RUN set -ex \
# && mkdir -p libtiff \
# && cd libtiff \
# && curl --retry-connrefused --retry 3 -ksSL "https://gitlab.com/faxguy/libtiff-tools/-/archive/$COMPILE_VERSION_LIBTIFF/libtiff-tools-$COMPILE_VERSION_LIBTIFF.tar.gz" | tar zx --strip-components=1 \
# && ./autogen.sh \
# && ./configure --prefix=$PREFIX \
# && make V=0 --jobs=3 \
# && make install --jobs=3

# Build and install libwebp
RUN set -ex \
Expand All @@ -50,8 +52,8 @@ RUN set -ex \
&& curl --retry-connrefused --retry 3 -ksSL "https://api.github.com/repos/webmproject/libwebp/tarball/refs/tags/v${COMPILE_VERSION_LIBWEBP}" | tar zx --strip-components=1 \
&& ./autogen.sh \
&& ./configure --prefix=$PREFIX --enable-shared --enable-static=no --enable-libwebpdecoder --enable-libwebpdemux --enable-libwebpmux \
&& make V=0 --jobs=$(nproc) \
&& make install --jobs=$(nproc)
&& make V=0 --jobs=3 \
&& make install --jobs=3

# Build and install libheif
RUN set -ex \
Expand All @@ -66,22 +68,23 @@ RUN set -ex \
&& mkdir build \
&& cd build \
&& cmake --preset=release-noplugins -DCMAKE_INSTALL_PREFIX=$PREFIX -DWITH_EXAMPLES=OFF .. \
&& make V=0 --jobs=$(nproc) \
&& make install --jobs=$(nproc)
&& make V=0 --jobs=3 \
&& make install --jobs=3

# Build and install ImageMagick
RUN set -ex \
&& mkdir -p imagemagick \
&& cd imagemagick \
&& curl --retry-connrefused --retry 3 -ksSL "https://api.github.com/repos/ImageMagick/ImageMagick/tarball/${COMPILE_VERSION_IMAGEMAGICK}" | tar zx --strip-components=1 \
&& ./configure --prefix=$PREFIX --disable-docs --with-avif=yes --with-heic=yes --with-webp=yes --with-tiff=yes --with-openexr=no --with-x=no --with-zip=no --with-gvc=no --with-openexr=no \
&& make V=0 --jobs=$(nproc) \
&& make install --jobs=$(nproc)
&& make V=0 --jobs=3 \
&& make install --jobs=3

# Clean and package
RUN set -ex \
&& cd $PREFIX \
&& rm -rf src/libtiff src/libwebp src/libheif src/imagemagick share/gtk-doc share/man share/thumbnailer \
&& rm -rf src/libwebp src/libheif src/imagemagick share/gtk-doc share/man share/thumbnailer \
# && rm -rf src/libtiff src/libwebp src/libheif src/imagemagick share/gtk-doc share/man share/thumbnailer \
&& strip lib/*.a lib/lib*.so* \
&& rm -rf build \
&& mkdir -p build \
Expand Down

0 comments on commit fa7b9c5

Please sign in to comment.