Skip to content

Commit

Permalink
add scripts for travis-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Jun 30, 2014
1 parent 9838304 commit 63cd9df
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: cpp
compiler:
- clang
install: true
before_script:
- sudo apt-get update -qq
- sudo apt-get install -qq -y portaudio19-dev libopenal-dev libva-dev
script:
- ./tools/ci/travis_build.sh
notifications:
recipients:
- [email protected]
email:
on_success: change
on_failure: always
env:
- LANG="en_US.UTF-8"
os:
- linux
62 changes: 62 additions & 0 deletions tools/ci/travis_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash

# http://docs.travis-ci.com/user/installing-dependencies/
# http://docs.travis-ci.com/user/customizing-the-build/
# http://docs.travis-ci.com/user/build-configuration/
# - sudo add-apt-repository ppa:wsnipex/vaapi
set -ev

cat /proc/cpuinfo
uname -a

echo "QtAV build script for travis-ci"

WORK_DIR=$PWD
echo "WORK_DIR=$WORK_DIR"
mkdir -p build
cd build


QT_PKG=Qt5.3.0-Linux64
FFMPEG_PKG=ffmpeg-2.2.2-linux-x86+x64

test -d ${QT_PKG} || {
test -f ${QT_PKG}.tar.xz || wget http://sourceforge.net/projects/buildqt/files/release/5.3.0/${QT_PKG}.tar.xz/download -O ${QT_PKG}.tar.xz
tar Jxvf ${QT_PKG}.tar.xz
}

test -d ${FFMPEG_PKG} || {
test -f ${FFMPEG_PKG}.tar.xz || wget http://sourceforge.net/projects/qtav/files/depends/FFmpeg/linux/${FFMPEG_PKG}.tar.xz/download -O ${FFMPEG_PKG}.tar.xz
tar Jxvf ${FFMPEG_PKG}.tar.xz
}

export PATH=$PWD/${QT_PKG}/bin:$PATH
export CPATH=$PWD/${FFMPEG_PKG}/include
export LIBRARY_PATH=$PWD/${FFMPEG_PKG}/lib/x64
export LD_LIBRARY_PATH=$LIBRARY_PATH

echo "PATH=$PATH"
echo "CPATH=$CPATH"
echo "LIBRARY_PATH=$LIBRARY_PATH"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"


function build_spec() {
local spec=$1
echo "building with qmake spec $spec ..."
local cpu_cores=`cat /proc/cpuinfo |grep 'cpu cores' |wc -l`
local jobs=$(($cpu_cores * 2))
mkdir -p $spec
cd $spec

qmake -r $WORK_DIR -spec $spec
time make -j${jobs}
cd $WORK_DIR/build
}

MKSPEC=(linux-g++ linux-clang)
for spec in ${MKSPEC[@]}; do
build_spec $spec
done


0 comments on commit 63cd9df

Please sign in to comment.