-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
175 lines (168 loc) · 6.48 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
language: generic
sudo: false
cache:
apt: true
directories:
- /tmp/ffmpeg
- /tmp/freeimage
git:
submodules: false
env:
global:
- LIB_INSTALLDIR="$HOME"
- PATH="$LIB_INSTALLDIR/bin:$PATH"
- LD_LIBRARY_PATH="$LIB_INSTALLDIR/lib"
- FREEIMAGE_VERSION=3.17.0
matrix:
include:
- env: LANGUAGE=C++ CXX=g++-5 CC=gcc-5
addons:
apt:
packages:
- g++-5
- nasm
- unzip
sources: &sources
- r-packages-trusty
- llvm-toolchain-trusty
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-3.9
- llvm-toolchain-trusty-4.0
- llvm-toolchain-trusty-5.0
- env: LANGUAGE=C++ CXX=g++-6 CC=gcc-6 DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../pictura-mediocritas-$TRAVIS_TAG"
addons:
apt:
packages:
- g++-6
- nasm
- unzip
sources: *sources
- env: LANGUAGE=C++ CXX="clang++-3.9 -stdlib=libc++" CC=clang-3.9
addons:
apt:
packages:
- clang-3.9
- libc++-dev
- nasm
- unzip
sources: *sources
- env: LANGUAGE=C++ CXX="clang++-4.0 -stdlib=libc++" CC=clang-4.0
addons:
apt:
packages:
- clang-4.0
- libc++-dev
- nasm
- unzip
sources: *sources
- env: LANGUAGE=C++ CXX="clang++-5.0 -stdlib=libc++" CC=clang-5.0
addons:
apt:
packages:
- clang-5.0
- libc++-dev
- nasm
- unzip
sources: *sources
- env: LANGUAGE=Ruby DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../pictura-mediocritas-man-$TRAVIS_TAG.tbz2"
language: ruby
rvm: "2.2"
before_install:
- if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
openssl aes-256-cbc -K $encrypted_5d0d3df1866d_key -iv $encrypted_5d0d3df1866d_iv -in gh_rsa.enc -out gh_rsa -d;
fi
install:
- mkdir -p "$LIB_INSTALLDIR/include" "$LIB_INSTALLDIR/lib"
- if [ "$LANGUAGE" == "C++" ] && [ ! -f "/tmp/freeimage/$FREEIMAGE_VERSION/libfreeimage.a" ]; then
mkdir -p "$HOME"; pushd "$HOME";
curl -SL "https://downloads.sourceforge.net/project/freeimage/Source Distribution/$FREEIMAGE_VERSION/FreeImage$(echo $FREEIMAGE_VERSION | sed 's/\.//g').zip" -o "FreeImage.zip";
unzip "FreeImage.zip";
cd FreeImage;
sed -i 's/%\["#R"\]/%[" \#R "]/g' Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c;
sed -i 's/"#R"/" \#R "/g' Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c;
cp Source/LibRawLite/internal/dcraw_common.cpp Source/LibRawLite/internal/dcraw_common.cpp.old;
awk '
BEGIN {
replacing=0
};
/cp, terms/ {
replacing=1
};
/chood/ {
replacing=0
};
{
if(replacing)
$0 = gensub(/0x/, "(signed char)0x", "g");
print
}
' Source/LibRawLite/internal/dcraw_common.cpp.old > Source/LibRawLite/internal/dcraw_common.cpp;
DESTDIR="$LIB_INSTALLDIR" make all;
mkdir -p "/tmp/freeimage/$FREEIMAGE_VERSION/";
cp "Dist/FreeImage.h" "Dist/libfreeimage.a" "/tmp/freeimage/$FREEIMAGE_VERSION/";
popd;
fi
- if [ "$LANGUAGE" == "C++" ]; then
cp "/tmp/freeimage/$FREEIMAGE_VERSION/FreeImage.h" "$LIB_INSTALLDIR/include/";
cp "/tmp/freeimage/$FREEIMAGE_VERSION/libfreeimage.a" "$LIB_INSTALLDIR/lib/";
fi
- if [ "$LANGUAGE" == "C++" ]; then git submodule update --init --recursive; fi
- if [ "$LANGUAGE" == "Ruby" ]; then gem install ronn; fi
script:
- if [ "$LANGUAGE" == "C++" ] && [ -f "/tmp/ffmpeg/lib/libavcodec.a" ]; then
mkdir -p "out/build";
cp -r "/tmp/ffmpeg" "out/build/";
find "out/build/ffmpeg" -exec touch -c {} \; ;
fi
- if [ "$LANGUAGE" == "C++" ]; then make ADDITIONAL_INCLUDE_DIR="$LIB_INSTALLDIR/include" ADDITIONAL_LINK_DIR="$LIB_INSTALLDIR/lib"; fi
- if [ "$LANGUAGE" == "C++" ] && [ ! -L "out/build/ffmpeg" ]; then
mkdir -p "/tmp";
cp -r "out/build/ffmpeg" "/tmp/";
fi
-
- if [ "$LANGUAGE" == "Ruby" ]; then
mkdir man; pushd man;
cp ../pictura-mediocritas.md .;
ronn --organization="Lounge<C++>" pictura-mediocritas.md;
man -l pictura-mediocritas.1 | cat;
popd;
fi
after_success:
- if [ "$LANGUAGE" == "C++" ] && [ "$DEPLOY" ] && [ "$TRAVIS_TAG" ]; then
cp "out/pictura-mediocritas" "$DEPLOY_FILE";
strip --strip-all --remove-section=.comment --remove-section=.note "$DEPLOY_FILE";
fi
- if [ "$LANGUAGE" == "Ruby" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
(
echo "Update manual for commits $TRAVIS_COMMIT_RANGE";
echo;
git log $TRAVIS_COMMIT_RANGE --pretty=oneline;
) >> $TRAVIS_BUILD_DIR/../MAN_UPDATE_MSG;
mkdir -p ~/.ssh && cp gh_rsa ~/.ssh/id_rsa && chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa;
git clone -b man [email protected]:$TRAVIS_REPO_SLUG.git $TRAVIS_BUILD_DIR-man;
cp -f man/* "$TRAVIS_BUILD_DIR-man";
pushd "$TRAVIS_BUILD_DIR-man";
git config --global user.email "[email protected]";
git config --global user.name "Nabijaczleweli Autouploader Bot";
git config --global push.default simple;
git add *;
git commit -F $TRAVIS_BUILD_DIR/../MAN_UPDATE_MSG;
git push;
popd;
fi
- if [ "$LANGUAGE" == "Ruby" ] && [ "$TRAVIS_TAG" ]; then
cp -r man "$TRAVIS_BUILD_DIR/../pictura-mediocritas-man-$TRAVIS_TAG";
pushd "$TRAVIS_BUILD_DIR/..";
tar -caf "pictura-mediocritas-man-$TRAVIS_TAG.tbz2" "pictura-mediocritas-man-$TRAVIS_TAG";
rm -rf "pictura-mediocritas-man-$TRAVIS_TAG";
popd;
fi
deploy:
provider: releases
api-key:
secure: stxnyBJJBRCIL5CdzwQeCGwrZ9Bh1Z8jZA4ojKZ/1RzXyAV/h1g2tQnbbW7cUA7QT4AvITwRDN5CW6KzZfUAqUr2Kz0XoMuE7+zuyFUihVt6Vmilr//ZUpkTbektfJDUvfYA4P4kna9S2zUfE1sW3wGheq5lbi70UVN39Zc1d8aE2dO25DP4Hcqf2HH/sHRA+U7uyMtD75qPlGgcl4YPQaPVyuVfIthMaXYYr2Pt21qIOoMib2oMIKJWLc9ftkBQaIvs9Zt0sECMTmQhaO0li8N4ZpaxiUJsSyGxt/ZkydRjDoReJVkQQO+/p4Ed7jQp8TcaBlSmFivNyd18/L06CX2h0BiawftbtEIDC9U1Xi+7VqVWfk2kIK6MqjnY0AtdsAJmQvTq60e7O1lnHkDZTu3tvXR8v+6HQdofeUM6oU75CRXgmO+MTtxQkyB1v1tDqh7REfYHCO4Q6HKaPVGpJP5XOuY0qN9vragTP5UlVgVDYi0+jzX8zrL+gE0SKm55lYkYrfNqheCvTref1No4K92Lt5fjQbT2LSjp3b/NESvcLHiL42S7KrkhI3qFqJwEYPVXl/3eGyRp/EpGUaNdFh9eZECTBOAaGLVtHQlVgfUpoST+9fBiFuRHmSexlV19Ke3NPa2h229kuIBshFWxq3Dlk9ZJMpWXKzJII36/TAA=
file: "$DEPLOY_FILE"
skip_cleanup: true
on:
tags: true
condition: $DEPLOY = true