• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-rust
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      vim \
44      zip
45RUN apt-get clean
46RUN cd /tmp && git clone https://github.com/ndevilla/iniparser.git && \
47      cd iniparser && \
48      make && \
49      cp libiniparser.* /usr/local/lib && \
50      cp src/dictionary.h src/iniparser.h /usr/local/include && \
51      chmod 644 /usr/local/include/dictionary.h /usr/local/include/iniparser.h && \
52      chmod 644 /usr/local/lib/libiniparser.a && \
53      chmod 755 /usr/local/lib/libiniparser.so.*
54
55RUN cd /tmp && git clone https://github.com/google/googletest.git -b v1.8.x && \
56      cd googletest && \
57      mkdir build && cd build && \
58      cmake .. -DBUILD_SHARED_LIBS=ON \
59         -DINSTALL_GTEST=ON \
60         -DCMAKE_INSTALL_PREFIX:PATH=/usr && \
61      make && make install
62
63# Need to build and install alsa so there is a static lib.
64RUN mkdir -p /tmp/alsa-build && cd /tmp/alsa-build && \
65      wget ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.1.4.1.tar.bz2 && \
66      bzip2 -f -d alsa-lib-* && \
67      tar xf alsa-lib-* && \
68      cd alsa-lib-* && \
69      ./configure --enable-static --disable-shared && \
70      make clean && \
71      make -j$(nproc) all && \
72      make install
73
74
75RUN cd $SRC && git clone https://chromium.googlesource.com/chromiumos/third_party/adhd
76WORKDIR adhd/cras
77COPY build.sh $SRC/
78