-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #451 from koreader/chrox-master
add CI build array for kindle, kobo and android
- Loading branch information
Showing
12 changed files
with
169 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
# install 32 bit libz package for NDK build | ||
sudo dpkg --add-architecture i386 | ||
sudo apt-get update | ||
sudo apt-get install zlib1g:i386 libc6-dev-i386 linux-libc-dev:i386 | ||
|
||
if [ "$NDKREV" = "r9c" ]; then | ||
curl -L http://dl.google.com/android/ndk/android-ndk-${NDKREV}-linux-x86_64.tar.bz2 -O | ||
echo "extracting android ndk" | ||
bzip2 -dc android-ndk-${NDKREV}-linux-x86_64.tar.bz2 | tar xf - | ||
fi | ||
|
||
if [ "$NDKREV" = "r11c" ]; then | ||
curl -L http://dl.google.com/android/repository/android-ndk-${NDKREV}-linux-x86_64.zip -O | ||
echo "extracting android ndk" | ||
unzip -q android-ndk-${NDKREV}-linux-x86_64.zip | ||
fi | ||
|
||
export NDK=`pwd`/android-ndk-${NDKREV} | ||
export PATH=$PATH:${NDK} | ||
make android-toolchain |
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,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# don't do this for clang | ||
if [ "$CXX" = "g++" ]; | ||
then export CXX="g++-4.8" CC="gcc-4.8"; | ||
fi | ||
# in case anything ignores the environment variables, override through PATH | ||
mkdir bin | ||
ln -s $(which gcc-4.8) bin/cc | ||
ln -s $(which gcc-4.8) bin/gcc | ||
ln -s $(which c++-4.8) bin/c++ | ||
ln -s $(which g++-4.8) bin/g++ | ||
export PATH=$PWD/bin:$PATH |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
source "${CI_DIR}/common.sh" | ||
|
||
travis_retry make fetchthirdparty | ||
make all |
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,59 @@ | ||
set -e | ||
set -o pipefail | ||
|
||
ANSI_RED="\033[31;1m" | ||
ANSI_GREEN="\033[32;1m" | ||
ANSI_RESET="\033[0m" | ||
ANSI_CLEAR="\033[0K" | ||
|
||
travis_retry() { | ||
local result=0 | ||
local count=1 | ||
set +e | ||
|
||
while [ $count -le 3 ]; do | ||
[ $result -ne 0 ] && { | ||
echo -e "\n${ANSI_RED}The command \"$@\" failed. Retrying, $count of 3.${ANSI_RESET}\n" >&2 | ||
} | ||
"$@" | ||
result=$? | ||
[ $result -eq 0 ] && break | ||
count=$(($count + 1)) | ||
sleep 1 | ||
done | ||
|
||
[ $count -gt 3 ] && { | ||
echo -e "\n${ANSI_RED}The command \"$@\" failed 3 times.${ANSI_RESET}\n" >&2 | ||
} | ||
|
||
set -e | ||
return $result | ||
} | ||
|
||
retry_cmd() { | ||
local result=0 | ||
local count=1 | ||
set +e | ||
|
||
retry_cnt=$1 | ||
shift 1 | ||
|
||
while [ $count -le ${retry_cnt} ]; do | ||
[ $result -ne 0 ] && { | ||
echo -e "\n${ANSI_RED}The command \"$@\" failed. Retrying, $count of ${retry_cnt}${ANSI_RESET}\n" >&2 | ||
} | ||
"$@" | ||
result=$? | ||
[ $result -eq 0 ] && break | ||
count=$(($count + 1)) | ||
sleep 1 | ||
done | ||
|
||
[ $count -gt ${retry_cnt} ] && { | ||
echo -e "\n${ANSI_RED}The command \"$@\" failed ${retry_cnt} times.${ANSI_RESET}\n" >&2 | ||
} | ||
|
||
set -e | ||
return $result | ||
} | ||
|
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,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
source "${CI_DIR}/common.sh" | ||
|
||
mkdir $HOME/.luarocks | ||
cp /etc/luarocks/config.lua $HOME/.luarocks/config.lua | ||
echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua | ||
# recent versions of busted may cause some weird segmentation faults | ||
# - git clone https://github.com/Olivine-Labs/busted/ | ||
# - cd busted && git checkout v1.10.0 && luarocks --local make busted-1.10.0-0.rockspec && cd .. | ||
travis_retry luarocks --local install busted 2.0.rc12-1 | ||
# for verbose_print module | ||
travis_retry luarocks --local install ansicolors | ||
eval $(luarocks path --bin) | ||
export PATH=$PATH:$HOME/.luarocks/bin | ||
|
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
sudo dpkg --add-architecture i386 | ||
sudo apt-get update | ||
sudo apt-get install libc6-dev-i386 linux-libc-dev:i386 | ||
|
||
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
sudo dpkg --add-architecture i386 | ||
sudo apt-get update | ||
sudo apt-get install libc6-dev-i386 linux-libc-dev:i386 | ||
|
||
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf |
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,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
source "${CI_DIR}/common.sh" | ||
|
||
cp build/*/luajit $HOME/.luarocks/bin | ||
# install tesseract trained language data for testing OCR functionality | ||
travis_retry wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz | ||
tar zxf tesseract-ocr-3.02.eng.tar.gz | ||
cd build/* && export TESSDATA_PREFIX=`pwd`/data && mkdir -p data/tessdata | ||
mv ../../tesseract-ocr/tessdata/* data/tessdata/ && cd ../../ | ||
# fetch font for base test | ||
travis_retry wget https://github.com/koreader/koreader/raw/master/resources/fonts/droid/DroidSansMono.ttf | ||
export OUTPUT_DIR=`ls -d ./build/x86_64-*linux-gnu` | ||
mkdir -p ${OUTPUT_DIR}/fonts/droid/ | ||
cp DroidSansMono.ttf ${OUTPUT_DIR}/fonts/droid/DroidSansMono.ttf | ||
# finally make test | ||
travis_retry make test |
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
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