3 # This script executes the abi-check step when running under travis-ci (in run step)
5 # Set-up some bash options
6 set -o nounset ## set -u : exit the script if you try to use an uninitialised variable
7 set -o errexit ## set -e : exit the script if any statement returns a non-true return value
8 set -o pipefail ## Fail on error in pipe
9 set -o xtrace ## set -x : Print a trace of simple commands and their arguments after they are expanded and before they are executed.
11 # Exit if not ABI check
12 if [ "${OPJ_CI_ABI_CHECK:-}" != "1" ]; then
16 OPJ_UPLOAD_ABI_REPORT=0
17 OPJ_LIMIT_ABI_BUILDS="-limit 2"
18 if [ "${TRAVIS_REPO_SLUG:-}" != "" ]; then
19 if [ "$(echo "${TRAVIS_REPO_SLUG}" | sed 's/\(^.*\)\/.*/\1/')" == "uclouvain" ] && [ "${TRAVIS_PULL_REQUEST:-}" == "false" ]; then
21 OPJ_UPLOAD_ABI_REPORT=1
27 OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd)
30 mkdir ${HOME}/abi-check
32 # Let's get tools not available with apt
34 # Travis doesn't allow package wdiff...
35 wget -qO - http://mirrors.kernel.org/gnu/wdiff/wdiff-latest.tar.gz | tar -xz
37 ./configure --prefix=${HOME}/abi-check/tools/wdiff &> /dev/null
39 make check &> /dev/null
40 make install &> /dev/null
42 export PATH=${PWD}/tools/wdiff/bin:$PATH
44 wget -qO - https://tools.ietf.org/tools/rfcdiff/rfcdiff-1.42.tgz | tar -xz
45 mv rfcdiff-1.42 ${PWD}/tools/rfcdiff
46 export PATH=${PWD}/tools/rfcdiff:$PATH
47 wget -qO - https://github.com/lvc/installer/archive/0.4.tar.gz | tar -xz
48 mkdir ${PWD}/tools/abi-tracker
49 make -C installer-0.4 install prefix=${PWD}/tools/abi-tracker target=abi-tracker
50 export PATH=${PWD}/tools/abi-tracker/bin:$PATH
55 # Let's create all we need
56 grep -v Git ${OPJ_SOURCE_DIR}/tools/abi-tracker/openjpeg.json > ./openjpeg.json
57 abi-monitor ${OPJ_LIMIT_ABI_BUILDS} -get openjpeg.json
58 if [ "${OPJ_LIMIT_ABI_BUILDS}" != "" ]; then
59 cp -f ${OPJ_SOURCE_DIR}/tools/abi-tracker/openjpeg.json ./openjpeg.json
61 # Old versions of openjpeg don't like -fvisibility=hidden...
62 grep -v Configure ${OPJ_SOURCE_DIR}/tools/abi-tracker/openjpeg.json > ./openjpeg.json
64 cp -rf ${OPJ_SOURCE_DIR} src/openjpeg/current
65 abi-monitor ${OPJ_LIMIT_ABI_BUILDS} -build openjpeg.json
66 abi-tracker -build openjpeg.json
71 abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/2.1 -name '*.dump') -new $(find ./abi_dump/openjpeg/current -name '*.dump') -header openjpeg.h -api -s || EXIT_CODE=1
74 if [ "${OPJ_LIMIT_ABI_BUILDS}" != "" ]; then
75 abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/2.1 -name '*.dump') -new $(find ./abi_dump/openjpeg/current -name '*.dump') -header openjpeg.h -abi -s || EXIT_CODE=1
77 echo "Disable ABI check for now, problems with symbol visibility..."
82 if [ ${OPJ_UPLOAD_ABI_REPORT} -eq 1 ]; then
83 echo "TODO: Where to upload the report"