1# Copyright 2017 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4# 5# Copyright 2018 Google Inc. 6# 7# Licensed under the Apache License, Version 2.0 (the "License"); 8# you may not use this file except in compliance with the License. 9# You may obtain a copy of the License at 10# 11# http://www.apache.org/licenses/LICENSE-2.0 12# 13# Unless required by applicable law or agreed to in writing, software 14# distributed under the License is distributed on an "AS IS" BASIS, 15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16# See the License for the specific language governing permissions and 17# limitations under the License. 18# 19################################################################################ 20# Defines a docker image that can build cras fuzzers. 21# 22FROM gcr.io/oss-fuzz-base/base-builder 23 24RUN apt-get -y update && \ 25 apt-get install -y \ 26 automake \ 27 build-essential \ 28 cmake \ 29 g++ \ 30 git \ 31 ladspa-sdk \ 32 libasound-dev \ 33 libdbus-1-dev \ 34 libgtest-dev \ 35 libncurses5-dev \ 36 libsbc-dev \ 37 libsndfile-dev \ 38 libspeexdsp-dev \ 39 libsystemd-dev \ 40 libtool \ 41 libudev-dev \ 42 wget \ 43 zip 44RUN apt-get clean 45RUN cd /tmp && git clone https://github.com/ndevilla/iniparser.git && \ 46 cd iniparser && \ 47 make && \ 48 cp libiniparser.* /usr/local/lib && \ 49 cp src/dictionary.h src/iniparser.h /usr/local/include && \ 50 chmod 644 /usr/local/include/dictionary.h /usr/local/include/iniparser.h && \ 51 chmod 644 /usr/local/lib/libiniparser.a && \ 52 chmod 755 /usr/local/lib/libiniparser.so.* 53 54RUN cd /tmp && git clone https://github.com/google/googletest.git -b v1.8.x && \ 55 cd googletest && \ 56 mkdir build && cd build && \ 57 cmake .. -DBUILD_SHARED_LIBS=ON \ 58 -DINSTALL_GTEST=ON \ 59 -DCMAKE_INSTALL_PREFIX:PATH=/usr && \ 60 make && make install 61 62# Need to build and install alsa so there is a static lib. 63RUN mkdir -p /tmp/alsa-build && cd /tmp/alsa-build && \ 64 wget ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.1.4.1.tar.bz2 && \ 65 bzip2 -f -d alsa-lib-* && \ 66 tar xf alsa-lib-* && \ 67 cd alsa-lib-* && \ 68 ./configure --enable-static --disable-shared && \ 69 make clean && \ 70 make -j$(nproc) all && \ 71 make install 72 73 74RUN cd $SRC && git clone https://chromium.googlesource.com/chromiumos/third_party/adhd 75WORKDIR adhd/cras 76COPY build.sh $SRC/ 77