Skip to content

Commit

Permalink
libvips: add libjxl (JPEG-XL) as a dependency (google#5673)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell authored Apr 27, 2021
1 parent d1f2191 commit 4295227
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions projects/libvips/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ RUN git clone --depth 1 https://chromium.googlesource.com/webm/libwebp
RUN git clone --depth 1 https://gitlab.com/libtiff/libtiff
RUN git clone --depth 1 https://aomedia.googlesource.com/aom
RUN git clone --depth 1 https://github.com/strukturag/libheif
RUN git clone --depth 1 --recursive https://gitlab.com/wg1/jpeg-xl.git

WORKDIR libvips
COPY build.sh $SRC/
30 changes: 30 additions & 0 deletions projects/libvips/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,34 @@ make -j$(nproc)
make install
popd

# jpeg-xl (libjxl)
pushd $SRC/jpeg-xl
sed -i'.bak' "/add_subdirectory(tools)/d" CMakeLists.txt
cmake -G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS" \
-DCMAKE_MODULE_LINKER_FLAGS="$LDFLAGS" \
-DCMAKE_INSTALL_PREFIX="$WORK" \
-DCMAKE_THREAD_LIBS_INIT="-lpthread" \
-DCMAKE_USE_PTHREADS_INIT=1 \
-DBUILD_SHARED_LIBS=0 \
-DBUILD_TESTING=0 \
-DJPEGXL_ENABLE_FUZZERS=0 \
-DJPEGXL_ENABLE_MANPAGES=0 \
-DJPEGXL_ENABLE_BENCHMARK=0 \
-DJPEGXL_ENABLE_EXAMPLES=0 \
.
make -j$(nproc)
make install
# libbrotli-dev package is too old in Ubuntu 16.04, use jpeg-xl version
cp -r third_party/brotli/c/include/brotli $WORK/include
cp third_party/brotli/*.a $WORK/lib
popd

# libvips
./autogen.sh \
--disable-shared \
Expand Down Expand Up @@ -160,6 +188,8 @@ for fuzzer in fuzz/*_fuzzer.cc; do
$WORK/lib/libtiff.a \
$WORK/lib/libheif.a \
$WORK/lib/libaom.a \
$WORK/lib/libjxl.a \
$WORK/lib/libjxl_threads.a \
$LIB_FUZZING_ENGINE \
-Wl,-Bstatic \
-lfftw3 -lgmodule-2.0 -lgio-2.0 -lgobject-2.0 -lffi -lglib-2.0 -lpcre -lexpat \
Expand Down

0 comments on commit 4295227

Please sign in to comment.