forked from irungentoo/toxcore
-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have one script per build. This means more duplication between the scripts, but it's much easier to understand and to run locally.
- Loading branch information
Showing
35 changed files
with
489 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/sh | ||
|
||
ACTION="$1" | ||
|
||
set -eu | ||
|
||
CACHEDIR="$HOME/cache" | ||
NPROC=`nproc` | ||
|
||
travis_install() { | ||
# Install vanilla NaCl only. | ||
[ -f "$CACHEDIR/lib/amd64/libnacl.a" ] || { | ||
curl https://hyperelliptic.org/nacl/nacl-20110221.tar.bz2 | tar jx | ||
cd nacl-20110221 # pushd | ||
"./do" | ||
# "make install" | ||
mkdir -p "$CACHEDIR/include"; mv build/*/include/* "$CACHEDIR/include" | ||
mkdir -p "$CACHEDIR/lib" ; mv build/*/lib/* "$CACHEDIR/lib" | ||
cd - # popd | ||
} | ||
} | ||
|
||
travis_script() { | ||
. ".travis/flags-$CC.sh" | ||
|
||
add_ld_flag -Wl,-z,defs | ||
|
||
# Make compilation error on a warning | ||
add_flag -Werror | ||
|
||
add_config_flag --with-nacl-libs="$CACHEDIR/lib/amd64" | ||
add_config_flag --with-nacl-headers="$CACHEDIR/include/amd64" | ||
add_config_flag --disable-ipv6 | ||
add_config_flag --enable-nacl | ||
add_config_flag --enable-daemon | ||
add_config_flag --enable-logging | ||
add_config_flag --with-log-level=TRACE | ||
|
||
autoreconf -fi | ||
mkdir -p _build | ||
cd _build # pushd | ||
../configure $CONFIG_FLAGS || (cat config.log && false) | ||
make "-j$NPROC" -k CFLAGS="$C_FLAGS" LDFLAGS="$LD_FLAGS" | ||
make "-j$NPROC" -k distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIG_FLAGS" | ||
cd - # popd | ||
} | ||
|
||
if [ "-z" "$ACTION" ]; then | ||
"travis_script" | ||
else | ||
"travis_$ACTION" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
ACTION="$1" | ||
|
||
set -eu | ||
|
||
. other/travis/env.sh | ||
. other/travis/env-freebsd.sh | ||
|
||
travis_install() { | ||
. other/travis/freebsd-install | ||
. other/travis/freebsd-install-stage1 | ||
} | ||
|
||
travis_script() { | ||
echo "Nothing to do here. Building happens in stage 2." | ||
} | ||
|
||
if [ "-z" "$ACTION" ]; then | ||
"travis_script" | ||
else | ||
"travis_$ACTION" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
ACTION="$1" | ||
|
||
set -eu | ||
|
||
. other/travis/env.sh | ||
. other/travis/env-freebsd.sh | ||
|
||
travis_install() { | ||
. other/travis/freebsd-install | ||
. other/travis/freebsd-install-stage2 | ||
} | ||
|
||
travis_script() { | ||
. other/travis/toxcore-script | ||
} | ||
|
||
if [ "-z" "$ACTION" ]; then | ||
"travis_script" | ||
else | ||
"travis_$ACTION" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/bin/sh | ||
|
||
ACTION="$1" | ||
|
||
set -eu | ||
|
||
CACHEDIR="$HOME/cache" | ||
NPROC=`nproc` | ||
ASTYLE="$CACHEDIR/astyle/build/gcc/bin/astyle" | ||
|
||
travis_install() { | ||
which coveralls || { | ||
# Install cpp-coveralls to upload test coverage results. | ||
pip install --user ndg-httpsclient urllib3[secure] cpp-coveralls | ||
|
||
# Work around https://github.com/eddyxu/cpp-coveralls/issues/108 by manually | ||
# installing the pyOpenSSL module and injecting it into urllib3 as per | ||
# https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2 | ||
sed -i -e '/^import sys$/a import urllib3.contrib.pyopenssl\nurllib3.contrib.pyopenssl.inject_into_urllib3()' `which coveralls` | ||
} | ||
|
||
# Install astyle (version in ubuntu-precise too old). | ||
[ -f "$ASTYLE" ] || { | ||
wget -O ../astyle.tar.gz https://deb.debian.org/debian/pool/main/a/astyle/astyle_2.06.orig.tar.gz | ||
tar -xf ../astyle.tar.gz -C "$CACHEDIR" | ||
make -C "$CACHEDIR/astyle/build/gcc" "-j$NPROC" | ||
} | ||
|
||
# Install libsodium (not in ubuntu-precise). | ||
[ -f "$CACHEDIR/lib/libsodium.a" ] || { | ||
git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium ../libsodium | ||
cd ../libsodium # pushd | ||
./autogen.sh | ||
./configure --prefix="$CACHEDIR" | ||
make install "-j$NPROC" | ||
cd - # popd | ||
} | ||
} | ||
|
||
travis_script() { | ||
. ".travis/flags-$CC.sh" | ||
|
||
add_ld_flag -Wl,-z,defs | ||
|
||
# Make compilation error on a warning | ||
add_flag -Werror | ||
|
||
# Coverage flags. | ||
add_flag -fprofile-arcs -ftest-coverage | ||
|
||
cmake -B_build -H. \ | ||
-DCMAKE_C_FLAGS="$C_FLAGS" \ | ||
-DCMAKE_CXX_FLAGS="$CXX_FLAGS" \ | ||
-DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \ | ||
-DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \ | ||
-DCMAKE_INSTALL_PREFIX:PATH="$PWD/_install" \ | ||
-DTRACE=ON \ | ||
-DMUST_BUILD_TOXAV=ON \ | ||
-DSTRICT_ABI=ON \ | ||
-DTEST_TIMEOUT_SECONDS=120 \ | ||
-DUSE_IPV6=OFF | ||
|
||
cd _build # pushd | ||
make "-j$NPROC" -k install | ||
make "-j$NPROC" test ARGS="-j50" CTEST_OUTPUT_ON_FAILURE=1 | ||
cd - # popd | ||
|
||
other/astyle/format-source . "$ASTYLE" | ||
} | ||
|
||
if [ "-z" "$ACTION" ]; then | ||
"travis_script" | ||
else | ||
"travis_$ACTION" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
ACTION="$1" | ||
|
||
set -eu | ||
|
||
CACHEDIR="$HOME/cache" | ||
NPROC=`sysctl -n hw.physicalcpu` | ||
|
||
travis_install() { | ||
# Workaround for bug in Homebrew where it only finds an old Ruby version. | ||
brew update | ||
|
||
brew install libsodium libvpx opus libconfig | ||
} | ||
|
||
travis_script() { | ||
. ".travis/flags-$CC.sh" | ||
|
||
add_ld_flag -undefined error | ||
|
||
# Make compilation error on a warning | ||
add_flag -Werror | ||
|
||
cmake -B_build -H. \ | ||
-DCMAKE_C_FLAGS="$C_FLAGS" \ | ||
-DCMAKE_CXX_FLAGS="$CXX_FLAGS" \ | ||
-DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \ | ||
-DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \ | ||
-DCMAKE_INSTALL_PREFIX:PATH="$PWD/_install" \ | ||
-DTRACE=ON \ | ||
-DMUST_BUILD_TOXAV=ON \ | ||
-DTEST_TIMEOUT_SECONDS=120 \ | ||
-DUSE_IPV6=OFF | ||
|
||
cd _build # pushd | ||
make "-j$NPROC" -k install | ||
make "-j$NPROC" test ARGS="-j50" CTEST_OUTPUT_ON_FAILURE=1 | ||
cd - # popd | ||
} | ||
|
||
if [ "-z" "$ACTION" ]; then | ||
"travis_script" | ||
else | ||
"travis_$ACTION" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
i686=true | ||
x86_64=false | ||
WINDOWS_ARCH=win32 | ||
|
||
. .travis/cmake-windows.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
i686=false | ||
x86_64=true | ||
WINDOWS_ARCH=win64 | ||
|
||
. .travis/cmake-windows.sh |
Oops, something went wrong.