aboutsummaryrefslogtreecommitdiff
path: root/travis
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-12-16 18:00:29 -0500
committerMike Frysinger <vapier@gentoo.org>2015-12-16 18:00:29 -0500
commitedfd404ac6079b16b144fde5165e2e0dccd35ced (patch)
tree614827c30aa6e19429f17d0d36da1e46a0e3f241 /travis
parentscanelf: improve string table check a bit (diff)
downloadpax-utils-edfd404ac6079b16b144fde5165e2e0dccd35ced.tar.gz
pax-utils-edfd404ac6079b16b144fde5165e2e0dccd35ced.tar.bz2
pax-utils-edfd404ac6079b16b144fde5165e2e0dccd35ced.zip
enable travis build support
Diffstat (limited to 'travis')
-rw-r--r--travis/autotools.tar.xzbin0 -> 9208 bytes
-rw-r--r--travis/lib.sh38
-rwxr-xr-xtravis/main.sh48
3 files changed, 86 insertions, 0 deletions
diff --git a/travis/autotools.tar.xz b/travis/autotools.tar.xz
new file mode 100644
index 0000000..1c0c854
--- /dev/null
+++ b/travis/autotools.tar.xz
Binary files differ
diff --git a/travis/lib.sh b/travis/lib.sh
new file mode 100644
index 0000000..687ed41
--- /dev/null
+++ b/travis/lib.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+# Common funcs for working w/Travis.
+
+travis_fold() {
+ if [[ -n ${TRAVIS_OS_NAME} ]] ; then
+ printf 'travis_fold:%s:%s\r\n' "$@" | sed 's: :_:g'
+ fi
+}
+
+if [[ -n ${TRAVIS_OS_NAME} ]] ; then
+ whitebg=$(tput setab 7)
+ blackfg=$(tput setaf 0)
+ normal=$(tput sgr0)
+else
+ whitebg=
+ blackbg=
+ normal=
+fi
+v() {
+ local fold=""
+ case $1 in
+ --fold=*) fold=${1:7}; shift;;
+ esac
+ if [[ -n ${fold} ]] ; then
+ travis_fold start "${fold}"
+ echo "\$ $*"
+ "$@"
+ travis_fold end "${fold}"
+ else
+ echo "${whitebg}${blackfg}\$ $*${normal}"
+ "$@"
+ fi
+}
+
+ncpus=$(getconf _NPROCESSORS_ONLN)
+m() {
+ v make -j${ncpus} "$@"
+}
diff --git a/travis/main.sh b/travis/main.sh
new file mode 100755
index 0000000..58b4ddf
--- /dev/null
+++ b/travis/main.sh
@@ -0,0 +1,48 @@
+#!/bin/bash -e
+
+. "${0%/*}"/lib.sh
+
+main() {
+ if [[ ${TRAVIS_OS_NAME} == "osx" ]] ; then
+ # Note: Linux deps are maintained in .travis.yml.
+ v --fold="brew_update" brew update
+ v --fold="brew_install" brew install xmlto xz
+ fi
+
+ # See if we have to bootstrap gnulib. This is the case on OS X, and on
+ # Linux until they whitelist the package:
+ # https://github.com/travis-ci/apt-package-whitelist/issues/727
+ if ! gnulib-tool --version >&/dev/null ; then
+ if [[ ! -d ../gnulib ]] ; then
+ v --fold="git_clone_gnulib" \
+ git clone --depth=1 https://github.com/coreutils/gnulib.git ../gnulib
+ else
+ pushd ../gnulib
+ v --fold="git_pull_gnulib" git pull
+ popd
+ fi
+ export PATH="${PATH}:${PWD}/../gnulib"
+ fi
+
+ if [[ ${TRAVIS_OS_NAME} == "linux" ]] ; then
+ # Standard optimized build.
+ m
+ m check
+
+ # Debug build w/ASAN and such enabled.
+ m debug
+ m check
+ fi
+
+ # Autotools based build.
+ v ./autogen.sh
+ if [[ ${TRAVIS_OS_NAME} == "linux" ]] ; then
+ v --fold="configure" ./configure
+ m V=1 distcheck
+ else
+ # ELF checks don't work on OS X -- no ELFs!
+ v ./configure
+ m V=1
+ fi
+}
+main "$@"