diff options
author | 2019-03-06 15:28:00 +0100 | |
---|---|---|
committer | 2019-03-06 06:28:00 -0800 | |
commit | 27b37d514a8ff66890311cbe31f0244712f41934 (patch) | |
tree | fe142c95173c51c9262b736f42c86b826ec46eee /projects | |
parent | 80634bf24d432b9466f1eba348ccfc29d5c15132 (diff) |
[libheif] Add libheif (#2213)
Diffstat (limited to 'projects')
-rw-r--r-- | projects/libheif/Dockerfile | 51 | ||||
-rwxr-xr-x | projects/libheif/build.sh | 67 | ||||
-rw-r--r-- | projects/libheif/project.yaml | 4 |
3 files changed, 122 insertions, 0 deletions
diff --git a/projects/libheif/Dockerfile b/projects/libheif/Dockerfile new file mode 100644 index 00000000..a89584d6 --- /dev/null +++ b/projects/libheif/Dockerfile @@ -0,0 +1,51 @@ +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder + +MAINTAINER mail@joachim-bauch.de + +RUN apt-get update && apt-get install -y \ + autoconf \ + automake \ + build-essential \ + cmake \ + libtool \ + make \ + mercurial \ + pkg-config \ + yasm + +RUN git clone \ + --depth 1 \ + --branch master \ + https://github.com/strukturag/libde265.git \ + libde265 + +RUN hg clone \ + --branch stable \ + http://hg.videolan.org/x265 \ + x265 + +RUN git clone \ + --depth 1 \ + --branch master \ + https://github.com/strukturag/libheif.git \ + libheif + +WORKDIR libheif + +COPY build.sh $SRC/ diff --git a/projects/libheif/build.sh b/projects/libheif/build.sh new file mode 100755 index 00000000..2f19bc88 --- /dev/null +++ b/projects/libheif/build.sh @@ -0,0 +1,67 @@ +#!/bin/bash -eu +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +# Build dependencies. +export DEPS_PATH=$SRC/deps +mkdir -p $DEPS_PATH + +cd $SRC/x265/build/linux +cmake -G "Unix Makefiles" \ + -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \ + -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DCMAKE_INSTALL_PREFIX="$DEPS_PATH" \ + -DENABLE_SHARED:bool=off \ + ../../source +make clean +make -j$(nproc) x265-static +make install + +cd $SRC/libde265 +./autogen.sh +./configure \ + --prefix="$DEPS_PATH" \ + --disable-shared \ + --enable-static \ + --disable-dec265 \ + --disable-sherlock265 \ + --disable-hdrcopy \ + --disable-enc265 \ + --disable-acceleration_speed +make clean +make -j$(nproc) +make install + +# Remove shared libraries to avoid accidental linking against them. +rm -f $DEPS_PATH/lib/*.so +rm -f $DEPS_PATH/lib/*.so.* + +cd $SRC/libheif +./autogen.sh +PKG_CONFIG="pkg-config --static" PKG_CONFIG_PATH="$DEPS_PATH/lib/pkgconfig" ./configure \ + --disable-shared \ + --enable-static \ + --disable-examples \ + --disable-go \ + --enable-libfuzzer +make clean +make -j$(nproc) + +cp libheif/*-fuzzer $OUT +cp fuzzing/dictionary.txt $OUT/box-fuzzer.dict +cp fuzzing/dictionary.txt $OUT/file-fuzzer.dict + +zip -r $OUT/file-fuzzer_seed_corpus.zip fuzzing/corpus/*.heic diff --git a/projects/libheif/project.yaml b/projects/libheif/project.yaml new file mode 100644 index 00000000..896b1fa0 --- /dev/null +++ b/projects/libheif/project.yaml @@ -0,0 +1,4 @@ +homepage: "https://github.com/strukturag/libheif" +primary_contact: "dirk.farin@gmail.com" +auto_ccs: + - "mail@joachim-bauch.de" |