From db622f2e26deeebf5d761529a086ef1b3a9fe97d Mon Sep 17 00:00:00 2001 From: Max Moroz Date: Fri, 5 Mar 2021 21:19:50 -0800 Subject: [PATCH] [freeimage] Use the SVN repo instead of the latest source archive. (#3414) * [freeimage] Use the SVN repo instead of the latest source archive. Requested in https://github.com/google/oss-fuzz/pull/2606#issuecomment-588533038 * fix the path * fix path again * more fixes * should work now! * test locally --- projects/freeimage/Dockerfile | 7 ++----- projects/freeimage/build.sh | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/projects/freeimage/Dockerfile b/projects/freeimage/Dockerfile index 86ab661ac..3133e71a3 100644 --- a/projects/freeimage/Dockerfile +++ b/projects/freeimage/Dockerfile @@ -16,10 +16,7 @@ FROM gcr.io/oss-fuzz-base/base-builder RUN apt-get update && apt-get install -y make autoconf automake libtool wget -# This downloads the latest version at the time of writing. There does not -# appear to be a head version of FreeImage. -RUN wget https://downloads.sourceforge.net/freeimage/FreeImage3180.zip -RUN unzip FreeImage3180.zip -WORKDIR $SRC +RUN svn checkout https://svn.code.sf.net/p/freeimage/svn/ freeimage-svn +WORKDIR $SRC/freeimage-svn/FreeImage/trunk/ COPY build.sh $SRC/ COPY load_from_memory_fuzzer.cc $SRC/ diff --git a/projects/freeimage/build.sh b/projects/freeimage/build.sh index a418bd0a3..707440eb2 100755 --- a/projects/freeimage/build.sh +++ b/projects/freeimage/build.sh @@ -15,15 +15,13 @@ # ################################################################################ -pushd FreeImage - # b44ExpLogTable.cpp only contains a definition of main(). sed -i 's/Source\/OpenEXR\/IlmImf\/b44ExpLogTable.cpp//' Makefile.srcs make LIBRARIES=-lc++ -j$(nproc) -popd +INSTALL_DIR="$PWD/Dist" -INSTALL_DIR=$SRC/FreeImage/Dist +cd $SRC $CXX $CXXFLAGS -I${INSTALL_DIR}/ $LIB_FUZZING_ENGINE \ load_from_memory_fuzzer.cc ${INSTALL_DIR}/libfreeimage.a \