1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#!/bin/sh
#
# SPDX-FileCopyrightText: 2025 Sébastien Helleu <flashcode@flashtux.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
# This script is meant to be run by OSS-Fuzz, see:
# https://github.com/google/oss-fuzz/blob/master/projects/weechat/Dockerfile
set -o errexit
src_dir="${SRC}"/weechat
build_dir="${WORK}"/build
cd "${src_dir}"
# apply patch for Ubuntu Focal (needed because CMake version is too old)
git apply tools/debian/patches/weechat_ubuntu_focal.patch
mkdir -p "${build_dir}"
cd "${build_dir}"
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_CJSON=OFF \
-DENABLE_COVERAGE=ON \
-DENABLE_FUZZ=ON \
"${src_dir}"
make -j "$(nproc)"
cp tests/fuzz/weechat_*_fuzzer "${OUT}"/
cp "${src_dir}"/tests/fuzz/core/*.dict "${OUT}"/
|