| 1 |
#!/bin/bash -eu |
| 2 |
# |
| 3 |
# Copyright (c) 2023 Cedalo GmbH |
| 4 |
# |
| 5 |
# All rights reserved. This program and the accompanying materials |
| 6 |
# are made available under the terms of the Eclipse Public License 2.0 |
| 7 |
# and Eclipse Distribution License v1.0 which accompany this distribution. |
| 8 |
# |
| 9 |
# The Eclipse Public License is available at |
| 10 |
# https://www.eclipse.org/legal/epl-2.0/ |
| 11 |
# and the Eclipse Distribution License is available at |
| 12 |
# http://www.eclipse.org/org/documents/edl-v10.php. |
| 13 |
# |
| 14 |
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause |
| 15 |
# |
| 16 |
# Contributors: |
| 17 |
# Roger Light - initial implementation and documentation. |
| 18 |
|
| 19 |
set -e |
| 20 |
|
| 21 |
# Note that sqlite3 is required as a build dep of a plugin which is not |
| 22 |
# currently part of fuzz testing. Once it is part of fuzz testing, sqlite will |
| 23 |
# need to be built statically. |
| 24 |
apt-get update && apt-get install -y \ |
| 25 |
cmake \ |
| 26 |
libargon2-dev \ |
| 27 |
libedit-dev \ |
| 28 |
liblzma-dev \ |
| 29 |
libmicrohttpd-dev \ |
| 30 |
libsqlite3-dev \ |
| 31 |
libtool-bin \ |
| 32 |
libz-dev \ |
| 33 |
make \ |
| 34 |
ninja-build \ |
| 35 |
pkg-config |
| 36 |
git clone https://github.com/ralight/cJSON ${SRC}/cJSON |
| 37 |
|
| 38 |
# If building outside of oss-fuzz, we need LPM |
| 39 |
if [ ! -d ${SRC}/LPM ]; then |
| 40 |
git clone https://github.com/google/libprotobuf-mutator ${SRC}/libprotobuf-mutator |
| 41 |
|
| 42 |
mkdir ${SRC}/LPM \ |
| 43 |
&& cd ${SRC}/LPM \ |
| 44 |
&& cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release \ |
| 45 |
&& ninja |
| 46 |
fi |