1#! /bin/bash 2# __ __ _ 3# ___\ \/ /_ __ __ _| |_ 4# / _ \\ /| '_ \ / _` | __| 5# | __// \| |_) | (_| | |_ 6# \___/_/\_\ .__/ \__,_|\__| 7# |_| XML parser 8# 9# Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org> 10# Copyright (c) 2017 Rolf Eike Beer <eike@sf-mail.de> 11# Copyright (c) 2019 Mohammed Khajapasha <mohammed.khajapasha@intel.com> 12# Copyright (c) 2019 Manish, Kumar <manish3.kumar@intel.com> 13# Copyright (c) 2019 Philippe Antoine <contact@catenacyber.fr> 14# Copyright (c) 2024 Dag-Erling Smørgrav <des@des.dev> 15# Licensed under the MIT license: 16# 17# Permission is hereby granted, free of charge, to any person obtaining 18# a copy of this software and associated documentation files (the 19# "Software"), to deal in the Software without restriction, including 20# without limitation the rights to use, copy, modify, merge, publish, 21# distribute, sublicense, and/or sell copies of the Software, and to permit 22# persons to whom the Software is furnished to do so, subject to the 23# following conditions: 24# 25# The above copyright notice and this permission notice shall be included 26# in all copies or substantial portions of the Software. 27# 28# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 29# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 30# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 31# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 32# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 33# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 34# USE OR OTHER DEALINGS IN THE SOFTWARE. 35 36set -e 37 38if [[ ${RUNNER_OS} = macOS ]]; then 39 latest_brew_python3_bin="$(ls -1d /usr/local/Cellar/python/3.*/bin | sort -n | tail -n1)" 40 export PATH="${latest_brew_python3_bin}${PATH:+:}${PATH}" 41elif [[ ${RUNNER_OS} = Linux ]]; then 42 export PATH="/usr/lib/llvm-19/bin:${PATH}" 43else 44 echo "Unsupported RUNNER_OS \"${RUNNER_OS}\"." >&2 45 exit 1 46fi 47 48echo "New \${PATH}:" 49tr : '\n' <<<"${PATH}" | sed 's,^,- ,' 50echo 51 52PS4='# ' 53set -x 54 55cd expat 56./buildconf.sh 57 58if [[ ${MODE} = distcheck ]]; then 59 ./configure ${CONFIGURE_ARGS} 60 make distcheck 61elif [[ ${MODE} = cmake-oos ]]; then 62 mkdir build 63 cd build 64 cmake ${CMAKE_ARGS} .. 65 make VERBOSE=1 CTEST_OUTPUT_ON_FAILURE=1 all test 66 make DESTDIR="${PWD}"/ROOT install 67 find ROOT | cut -c 6- | sort 68elif [[ ${MODE} = coverage-sh ]]; then 69 ./coverage.sh 70else 71 ./qa.sh ${CMAKE_ARGS} 72fi 73