Skip to content

Commit

Permalink
Updates blah blah.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed May 30, 2017
1 parent 65b1463 commit a6242bb
Show file tree
Hide file tree
Showing 34 changed files with 568 additions and 269 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -3,6 +3,9 @@
[568vq].out

# Compiled Object files, Static and Dynamic libs (Shared Objects)
/_build
*.pro.user*
libs
*.o
*.a
*.so
Expand Down
102 changes: 54 additions & 48 deletions .travis.yml
@@ -1,7 +1,46 @@
sudo: required
dist: trusty
language: cpp
cache: ccache
dist: trusty
sudo: required

addons:
apt:
sources:
- sourceline: 'ppa:mc3man/trusty-media'
- sourceline: 'ppa:chris-lea/libsodium'
packages:
- ffmpeg
- libasound-dev
- libass-dev
- libfdk-aac-dev
- libgtk2.0-dev
- libmp3lame-dev
- libogg-dev
- libopenal-dev
- libopencore-amrnb-dev
- libopencore-amrwb-dev
- libopus-dev
- libqrencode-dev
- libqt5opengl5-dev
- libqt5svg5-dev
- libsdl1.2-dev
- libsdl2-dev
- libsodium-dev
- libsoxr-dev
- libspeex-dev
- libsqlcipher-dev
- libswscale-dev
- libva-dev
- libvdpau-dev
- libvidstab-dev
- libvorbis-dev
- libvpx-dev
- libwavpack-dev
- libx264-dev
- libx265-dev
- libxv-dev
- libxvidcore-dev
- qttools5-dev
- qttools5-dev-tools

# regex is for release tags
branches:
Expand All @@ -10,55 +49,22 @@ branches:
- /^v(\d+\.){2}\d+$/

matrix:
fast_finish: true
include:
- os: linux
env: JOB=verify-commit-format
env: JOB=test ENV=linux
- os: linux
env: JOB=build-docs DOXYGEN_CONFIG_FILE=doxygen.conf
env: JOB=deploy ENV=linux
- os: linux
env: JOB=build-gitstats GITSTATS_DIR=gitstats
addons:
apt:
packages:
- gitstats
# the actual compilin'
env: JOB=deploy ENV=windows ARCH=i686 LIBTYPE=shared
services:
- docker
- os: linux
env: JOB=build-ubuntu-14-04
env: JOB=deploy ENV=windows ARCH=x86_64 LIBTYPE=shared
services:
- docker
- os: osx
osx_image: xcode7.3
env: JOB=build-osx

script: "./.travis/$JOB.sh"

deploy:
# osx binary
- provider: releases
api_key:
secure: "BRbzTWRvadALRQSTihMKruOj64ydxusMUS9FQR//qFlS345ZYfYta43W//4LcWWDKtj6IvA6DRqNdabgWnpbpxpnm9gVftGUdOKlU3niPZhwsMkB2M12QHUnAP6DVOfGPvdciBV+6mu73SSxniEcrYjZ1CrRX7mknmehPpVKxNk="
file: "./qTox.dmg"
on:
condition: $TRAVIS_OS_NAME == osx
repo: qTox/qTox
tags: true
skip_cleanup: true

# branch for windows jenkins build
- provider: script
script: .travis/deploy-jenkins-branch.sh
on:
tags: true
skip_cleanup: true

env: JOB=deploy ENV=osx

after_success:
- >
test $TRAVIS_PULL_REQUEST == "false"
&& test $TRAVIS_BRANCH == "master"
&& test $JOB == "build-docs"
&& bash ./.travis/deploy-docs.sh
- >
test $TRAVIS_PULL_REQUEST == "false"
&& test $TRAVIS_BRANCH == "master"
&& test $JOB == "build-gitstats"
&& bash ./.travis/deploy-gitstats.sh
install: .travis/phase $JOB $ENV install
script: .travis/phase $JOB $ENV script
after_script: .travis/phase $JOB $ENV after_script
4 changes: 4 additions & 0 deletions .travis/build-script
@@ -0,0 +1,4 @@
#!/bin/sh

RUN $CMAKE -B$BUILD_DIR -H. -DCMAKE_INSTALL_PREFIX:PATH=$CURDIR/_install
RUN $MAKE -C $BUILD_DIR -j$NPROC -k install
8 changes: 8 additions & 0 deletions .travis/deploy-install
@@ -0,0 +1,8 @@
#!/bin/sh

git clone --depth=1 https://github.com/TokTok/c-toxcore

RUN $CMAKE -Bc-toxcore/$BUILD_DIR -Hc-toxcore -DBOOTSTRAP_DAEMON=OFF -DDEBUG=ON -DSTRICT_ABI=ON -DWARNINGS=OFF -DCMAKE_INSTALL_PREFIX:PATH=$CURDIR/libs
RUN $MAKE -C c-toxcore/$BUILD_DIR -j$NPROC -k install

rm -rf c-toxcore
4 changes: 4 additions & 0 deletions .travis/deploy-script
@@ -0,0 +1,4 @@
#!/bin/sh

. $THIS_DIR/build-script
#$THIS_DIR/git-deploy
12 changes: 12 additions & 0 deletions .travis/env-linux.sh
@@ -0,0 +1,12 @@
#!/bin/sh

RUN() {
"$@"
}
export CMAKE=cmake
export MAKE=make
export NPROC=`nproc`
export CURDIR=$PWD

export PKG_CONFIG_PATH=/opt/ffmpeg/lib/pkgconfig
export LD_LIBRARY_PATH=$CURDIR/libs/lib
11 changes: 11 additions & 0 deletions .travis/env-osx.sh
@@ -0,0 +1,11 @@
#!/bin/sh

RUN() {
"$@"
}
export CMAKE=cmake
export MAKE=make
export NPROC=`sysctl -n hw.ncpu`
export CURDIR=$PWD

export CMAKE_PREFIX_PATH=`brew --prefix qt5`
9 changes: 9 additions & 0 deletions .travis/env-windows.sh
@@ -0,0 +1,9 @@
#!/bin/sh

RUN() {
./dockcross "$@"
}
export CMAKE=$ARCH-w64-mingw32.$LIBTYPE-cmake
export MAKE=make
export NPROC=`nproc`
export CURDIR=/work
6 changes: 6 additions & 0 deletions .travis/env.sh
@@ -0,0 +1,6 @@
#!/bin/sh

export CFLAGS="-O3"
export CXXFLAGS="-O3"

BUILD_DIR=_build
70 changes: 70 additions & 0 deletions .travis/git-deploy
@@ -0,0 +1,70 @@
#!/bin/sh

if [ -z "$GIT_TOKEN" ]; then
exit 0
fi

# Don't display the commands executed.
set -eu +x

DEPLOY_DIR=toktok.github.io/client/$ENV

git config --global push.default simple
git config --global user.email "deploy@travis-ci.org"
git config --global user.name "Travis Deployer"

git clone https://iphydf:$GIT_TOKEN@github.com/TokTok/toktok.github.io
rm -rf $DEPLOY_DIR
mkdir -p $DEPLOY_DIR

case $ENV in
linux)
# Linux: package all libraries and write a startup script.
ALL_LIBS=`ldd _install/bin/qtox`
echo "Full list of dependent libraries:"
echo "$ALL_LIBS"

LIB_REGEX='(^/usr/lib/x86_64-linux-gnu/[^/]*\.so)'
LIB_REGEX=$LIB_REGEX'|(/lib/libtox\w\.so)'
LIB_REGEX=$LIB_REGEX'|(^/lib/x86_64-linux-gnu/libgcrypt\.so)'
echo "Filtering with regex '$LIB_REGEX'"

LIBS=`echo "$ALL_LIBS" | awk '{print $3}' | egrep $LIB_REGEX`
echo "Packaged libraries:"
echo "$LIBS"

PKG_DIR=qtox-1.5.1
mkdir -p $PKG_DIR/bin
mkdir -p $PKG_DIR/lib

cp _install/bin/qtox $PKG_DIR/bin/
cp $LIBS $PKG_DIR/lib/

echo '#!/bin/bash' > $PKG_DIR/qtox
echo 'THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"' >> $PKG_DIR/qtox
echo 'export LD_LIBRARY_PATH="$THIS_DIR/lib"' >> $PKG_DIR/qtox
echo 'chmod +x "$THIS_DIR/bin/qtox"' >> $PKG_DIR/qtox
echo 'exec "$THIS_DIR/bin/qtox" "$@"' >> $PKG_DIR/qtox
chmod +x $PKG_DIR/qtox
tar zcf $DEPLOY_DIR/$PKG_DIR.tar.gz $PKG_DIR
gzip < $PKG_DIR/bin/qtox > $DEPLOY_DIR/qtox.gz
;;
osx)
# OSX: deploy the dmg image.
cp _build/qtox.dmg $DEPLOY_DIR
;;
windows)
# Windows: make a zip archive.
mv _install/bin/qtox.exe .
zip $DEPLOY_DIR/qtox-$ARCH.zip qtox.exe
;;
*)
echo "Unknown ENV: '$ENV'"
exit 1
;;
esac

cd toktok.github.io
git add .
git commit -a -m"Upload new $ENV binaries." --amend
git push --force
43 changes: 43 additions & 0 deletions .travis/linux-install
@@ -0,0 +1,43 @@
#!/bin/sh

set -e -x

#sudo add-apt-repository -y ppa:mc3man/trusty-media
#sudo add-apt-repository -y ppa:chris-lea/libsodium
#
#sudo apt-get update -qq
#
#sudo apt-get install -y --force-yes \
# ffmpeg \
# libgtk2.0-dev \
# libopenal-dev \
# libopus-dev \
# libqrencode-dev \
# libqt5svg5-dev \
# libsodium-dev \
# libsqlcipher-dev \
# libswscale-dev \
# libvpx-dev \
# qttools5-dev \
# qttools5-dev-tools \
# \
# libasound-dev \
# libass-dev \
# libfdk-aac-dev \
# libmp3lame-dev \
# libogg-dev \
# libopencore-amrnb-dev \
# libopencore-amrwb-dev \
# libsdl1.2-dev \
# libsdl2-dev \
# libsoxr-dev \
# libspeex-dev \
# libva-dev \
# libvdpau-dev \
# libvidstab-dev \
# libvorbis-dev \
# libx264-dev \
# libx265-dev \
# libxv-dev \
# libxvidcore-dev \
# libwavpack-dev
6 changes: 6 additions & 0 deletions .travis/osx-install
@@ -0,0 +1,6 @@
#!/bin/sh

set -e -x

brew update > /dev/null
brew install libvpx opus libsodium ffmpeg qrencode qt5 sqlcipher gtk gdk-pixbuf
24 changes: 24 additions & 0 deletions .travis/phase
@@ -0,0 +1,24 @@
#!/bin/sh

set -eux

JOB="$1"
ENV="$2"
PHASE="$3"

THIS_DIR=`dirname \`which $0\``

. "$THIS_DIR/env.sh"
. "$THIS_DIR/env-$ENV.sh"

try_source() {
SCRIPT="$THIS_DIR/$1"
if [ -f "$SCRIPT" ]; then
. "$SCRIPT"
fi
}

try_source "$PHASE"
try_source "$ENV-$PHASE"
try_source "$JOB-$PHASE"
try_source "$JOB-$ENV-$PHASE"
9 changes: 9 additions & 0 deletions .travis/test-after_script
@@ -0,0 +1,9 @@
#!/bin/sh

GENERATED='.*/_build/.*'

coveralls \
--exclude test \
--exclude updater \
--exclude-pattern "$GENERATED" \
--gcov-options '\-lp'
6 changes: 6 additions & 0 deletions .travis/test-install
@@ -0,0 +1,6 @@
#!/bin/sh

# Install cpp-coveralls to upload test coverage results.
pip install --user cpp-coveralls

. $THIS_DIR/deploy-install
13 changes: 13 additions & 0 deletions .travis/test-script
@@ -0,0 +1,13 @@
#!/bin/sh

export CFLAGS="-fprofile-arcs -ftest-coverage"
export CXXFLAGS="-fprofile-arcs -ftest-coverage"
export LDFLAGS="-lgcov --coverage"

export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start

. $THIS_DIR/build-script

export CTEST_OUTPUT_ON_FAILURE=1
RUN $MAKE -C $BUILD_DIR -j$NPROC -k test
7 changes: 7 additions & 0 deletions .travis/windows-install
@@ -0,0 +1,7 @@
#!/bin/sh

DOCKER_IMAGE=toktoknet/windows-qt5:latest.$ARCH-shared

docker pull $DOCKER_IMAGE
docker run --rm $DOCKER_IMAGE > dockcross
chmod +x dockcross

0 comments on commit a6242bb

Please sign in to comment.