-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
110 lines (101 loc) · 5 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
language: generic
sudo: required
dist: focal
os:
- linux
env:
global:
- WINEPREFIX=~/.winelaz
- DISPLAY=:99.0
matrix:
include:
- env: LAZ_VER=2.0.12 android=false
- env: LAZ_VER=2.0.12 LAZ_ENV=wine LAZ_OPT="--os=win32 --cpu=i386" android=false
- env: LAZ_VER=2.0.12 android=true FPC_VER=3.0.4
install:
- git clone https://github.com/benibela/travis-lazarus travis-lazarus
- travis-lazarus/.travis.install.py
- |
if [[ "$LAZ_ENV" = wine ]]; then
find $WINEPREFIX -iname '*fpc.cfg' | head -1 | xargs -i{} ln {} ~/.fpc.cfg;
cat /usr/bin/lazbuild;
fi
- if [[ ! -e ~/.fpc.cfg ]]; then echo '#INCLUDE /etc/fpc.cfg' > ~/.fpc.cfg; fi
- cd ..
#get dependencies from sourceforge
- (hg clone http://hg.code.sf.net/p/videlibri/code sf) || (sleep $( echo $$ | head -c 2); hg clone http://hg.code.sf.net/p/videlibri/code sf) || (sleep 60; hg clone http://hg.code.sf.net/p/videlibri/code sf) || (sleep 60; hg clone http://hg.code.sf.net/p/videlibri/code sf)
- |
cd sf
hg pull && hg update default
rm -rf programs/internet/VideLibri; mv ../videlibri programs/internet/VideLibri
mkdir import; git clone https://github.com/benibela/flre.git import/flre;
echo -Fu$PWD/import/flre/src/ >> ~/.fpc.cfg
mkdir -p import/pasdblstrutils/src && curl https://raw.githubusercontent.com/BeRo1985/pasdblstrutils/master/src/PasDblStrUtils.pas > import/pasdblstrutils/src/PasDblStrUtils.pas
echo -Fu$PWD/import/pasdblstrutils/src/ >> ~/.fpc.cfg
echo -Fi$PWD/components/pascal/ >> ~/.fpc.cfg
echo -Fi$PWD/components/pascal/data >> ~/.fpc.cfg
echo -Fu$PWD/components/pascal/data >> ~/.fpc.cfg
ln -s $PWD/import/flre components/pascal/import/flre > /dev/null
- |
if [[ $android = true ]]; then
set -v
if [[ -z "$JAVA_HOME" ]]; then export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64; ls $JAVA_HOME; fi
ANDROID_SDK_TOOLS=commandlinetools-linux-6200805_latest.zip
wget -nv https://dl.google.com/android/repository/$ANDROID_SDK_TOOLS
unzip -q $ANDROID_SDK_TOOLS -d $HOME/sdk
export ANDROID_HOME=$HOME/sdk
export PATH=$PATH:$ANDROID_HOME/tools/bin
mkdir -p $HOME/.android && touch $HOME/.android/repositories.cfg
yes | sdkmanager --sdk_root="$ANDROID_HOME" --licenses
yes | sdkmanager --sdk_root="$ANDROID_HOME" "tools" "build-tools;28.0.3" "platforms;android-28" "ndk;20.0.5594570";
sudo apt-get install -y gcc-arm-linux-androideabi libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386;
oldpath=$PWD;
cd ..
git clone https://gitlab.com/freepascal.org/fpc/source.git --depth 1 --single-branch fpc
cd fpc
sudo -E $oldpath/programs/internet/VideLibri/android/manage.sh setupbinutils /usr/bin
sudo -E $oldpath/programs/internet/VideLibri/android/manage.sh setupfpccrosscompile
cd $oldpath;
$oldpath/programs/internet/VideLibri/android/manage.sh setupfpccrosscfg >> ~/.fpc.cfg
$oldpath/programs/internet/VideLibri/android/manage.sh fakesignature
fi
- |
if [[ $LAZ_ENV = wine ]]; then
sudo apt-get install -y dos2unix;
tee programs/internet/xidel/xidel <<<$'#!/bin/bash
winargs=()
for arg in "$@"; do
winargs+=(${arg/\/home\/travis/Z:\\\\home\\\\travis})
done
wine ../../../xidel/xidel.exe --extract-exclude line-ending -e \'line-ending:=x:cps(10)\' "${winargs[@]}" | dos2unix | perl -pne \' s!(file://Z:[^"]+)! {my $temp = $1; $temp =~ s%(Z:)?\\\\{1,2}%/%g; $temp}!ge\'
';
chmod +x programs/internet/xidel/xidel;
fi
- if [[ -z "$LAZ_ENV" ]] && [[ $android = false ]]; then
sudo apt-get install fakeroot lintian;
fi
- cat ~/.fpc.cfg
# svn checkout -r 37480 https://svn.freepascal.org/svn/fpc/trunk fpc-trunk
# cd fpc-trunk
script:
- ls -l
- umask 0022
- lazbuild $LAZ_OPT --add-package components/pascal/data/searchbarpackage.lpk
- lazbuild $LAZ_OPT --add-package components/pascal/data/treelistviewpackage.lpk
- lazbuild $LAZ_OPT --add-package components/pascal/internettools.lpk
- touch programs/internet/xidel/xidelbuilddata.inc; lazbuild $LAZ_OPT programs/internet/xidel/xidel.lpi
- lazbuild $LAZ_OPT programs/internet/VideLibri/_meta/assetversiontests.lpi
- basepath=$PWD
- if [[ $android = false ]]; then lazbuild $LAZ_OPT programs/internet/VideLibri/bookWatch.lpi; fi
- if [[ $android = true ]]; then cd programs/internet/VideLibri/android; ./manage.sh build; fi
- export PATH=$PATH:$PWD/programs/internet/xidel/
- cd $basepath; $LAZ_ENV programs/internet/VideLibri/_meta/assetversiontests
- if [[ -z "$LAZ_ENV" ]] && [[ $android = false ]]; then
cd $basepath/programs/internet/VideLibri && ./_meta/build.deb.sh && lintian *.deb;
lazbuild $LAZ_OPT $basepath/programs/internet/VideLibri/commoninterfacetests.lpi;
$basepath/programs/internet/VideLibri/commoninterfacetests;
fi
- cd $basepath/programs/internet/VideLibri/_meta/tests; ./unittests.sh
notifications:
email:
on_failure: change