Skip to content

Commit

Permalink
remove statics since they don't seem to matter and for some reason th…
Browse files Browse the repository at this point in the history
…e linker errors I'd had are gone now... guess I got the right combination of dev files in the container
  • Loading branch information
kaoudis committed Nov 14, 2023
1 parent 5ade99c commit a58e8fe
Showing 1 changed file with 6 additions and 49 deletions.
55 changes: 6 additions & 49 deletions examples/Dockerfile-imagemagick-dcm.demo
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,22 @@ ENV DEBIAN_FRONTEND=noninteractive
LABEL org.opencontainers.image.authors="[email protected]"
WORKDIR /polytracker/the_klondike

# based on https://github.com/ImageMagick/ImageMagick/blob/main/.devcontainer/security/Dockerfile

RUN apt-get update && \
apt-get install -y autoconf autopoint binutils clang cmake fontconfig fonts-dejavu g++ gettext git ghostscript gperf libc++-dev libc++abi-dev libcairo2-dev libde265-dev libfreetype-dev libfontconfig-dev libjpeg-turbo8-dev libheif-dev libhwy-dev libopenjp2-7-dev libpango-1.0-0 libraqm0 libtiff-dev libtool libbz2-dev locales make nasm pkg-config po4a unzip zip && \
apt-get install -y autoconf autopoint binutils clang cmake fontconfig fonts-dejavu g++ gettext git ghostscript gperf libc++-dev libc++abi-dev libcairo2-dev libde265-dev libfreetype-dev libfontconfig-dev libjpeg-turbo8-dev libheif-dev libhwy-dev libopenjp2-7-dev libpango-1.0-0 libpng-dev libpng16-16 libraqm0 libtiff-dev libtool libbz2-dev locales make nasm pkg-config po4a unzip zip zlib1g-dev && \
locale-gen en_US.UTF-8

RUN git clone https://github.com/ImageMagick/ImageMagick.git && \
mkdir -p /polytracker/the_klondike/ImageMagick/dependencies

ENV WORK=/polytracker/the_klondike/ImageMagick
ENV DEPS="$WORK/dependencies"

WORKDIR "$DEPS"
RUN git clone --depth 1 https://github.com/madler/zlib
RUN git clone --depth 1 https://github.com/pnggroup/libpng
RUN git clone https://github.com/ImageMagick/ImageMagick.git

ENV PATH=$PATH:/ImageMagick/bin
ENV CXX=clang++
ENV CC=clang
# ENV LLVM_COMPILER=clang

WORKDIR "$DEPS/zlib"
RUN \
CFLAGS="-fPIC -static -Wl,-undefined,error" \
CXXFLAGS="-std=c++17 -fPIC -static -stdlib=libc++ -Wl,-undefined,error" \
./configure \
--static \
--prefix="$WORK" \
--includedir="$WORK/include" \
--libdir="$WORK/lib" && \
make -j$((`nproc`+1)) \
CFLAGS="-fPIC -static -Wl,-undefined,error" \
CXXFLAGS="-std=c++17 -fPIC -static -stdlib=libc++ -Wl,-undefined,error" && \
make install

WORKDIR "$DEPS/libpng"
RUN cmake . \
-DCMAKE_INSTALL_PREFIX=$WORK \
-DPNG_STATIC=ON \
-DPNG_SHARED=OFF \
-DPNG_TESTS=OFF \
-DPNG_TOOLS=OFF && \
make -j$((`nproc`+1)) \
LIBS=" -L$WORK/lib -l:zlib.a -lm" \
CFLAGS="-I$WORK/include -fPIC -static -Wl,-undefined,error" \
CXXFLAGS="-I$WORK/include -std=c++17 -fPIC -static -stdlib=libc++ -Wl,-undefined,error" && \
make install

WORKDIR "$WORK"
# build imagemagick c.f. https://github.com/ImageMagick/ImageMagick/blob/main/Install-unix.txt, https://github.com/ImageMagick/ImageMagick/blob/main/QuickStart.txt
# https://github.com/ImageMagick/ImageMagick/blob/main/configure
WORKDIR /polytracker/the_klondike/ImageMagick
RUN autoreconf -fiv
RUN ./configure \
--prefix="$WORK" \
--disable-shared \
--prefix="/polytracker/the_klondike/ImageMagick" \
--disable-docs \
--without-magick-plus-plus \
--without-perl \
LIBS=" -L$WORK/lib -lz -lpng -lpng16"
--without-perl

RUN polytracker build make -j$((`nproc`+1))
# RUN polytracker instrument-targets --taint --ftrace magick
RUN polytracker instrument-targets --taint --ftrace magick

0 comments on commit a58e8fe

Please sign in to comment.