3 # Copyright (C) 2015 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
4 # Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # Version compare functions
22 if [[ "$1" == "$2" ]]; then
26 local i ver1
=($1) ver2
=($2)
27 # fill empty fields in ver1 with zeros
28 for ((i
=${#ver1[@]}; i
<${#ver2[@]}; i
++)); do
31 for ((i
=0; i
<${#ver1[@]}; i
++)); do
32 if [[ -z ${ver2[i]} ]]; then
33 # fill empty fields in ver2 with zeros
36 if ((10#${ver1[i]} > 10#${ver2[i]})); then
39 if ((10#${ver1[i]} < 10#${ver2[i]})); then
48 vercomp
"$1" "$2"; local res
="$?"
49 [ "$res" -eq "0" ] ||
[ "$res" -eq "2" ]
53 vercomp
"$1" "$2"; local res
="$?"
58 vercomp
"$1" "$2"; local res
="$?"
59 [ "$res" -eq "0" ] ||
[ "$res" -eq "1" ]
63 vercomp
"$1" "$2"; local res
="$?"
68 vercomp
"$1" "$2"; local res
="$?"
73 WORKSPACE
=${WORKSPACE:-}
81 SRCDIR
="$WORKSPACE/src/librseq"
82 TMPDIR
="$WORKSPACE/tmp"
85 # Create tmp directory
90 export CFLAGS
="-g -O2"
92 # Add the convenience headers in extra to the
94 export CPPFLAGS
="-I$SRCDIR/extra"
96 # Set compiler variables
128 export CXX
=clang
++-3.9
132 export CXX
=clang
++-4.0
136 export CXX
=clang
++-5.0
140 export CXX
=clang
++-6.0
147 if [ "x$cc" != "x" ]; then
153 if [ "x${CC:-}" != "x" ]; then
154 echo "Selected compiler:"
158 # Set platform variables
164 export PYTHON
="python3"
165 export PYTHON_CONFIG
="python3-config"
169 # Enter the source directory
172 # Run bootstrap in the source directory prior to configure
175 # Get source version from configure script
176 eval "$(grep '^PACKAGE_VERSION=' ./configure)"
177 PACKAGE_VERSION
=${PACKAGE_VERSION//\-pre*/}
180 # Set configure options and environment variables for each build
182 CONF_OPTS
=("--prefix=$PREFIX")
185 echo "Static lib only configuration"
187 CONF_OPTS
+=("--enable-static" "--disable-shared")
191 echo "Standard configuration"
196 # oot : out-of-tree build
197 # dist : build via make dist
198 # oot-dist: build via make dist out-of-tree
199 # * : normal tree build
201 # Make sure to move to the build directory and run configure
205 echo "Out of tree build"
207 # Create and enter a temporary build directory
208 builddir
=$
(mktemp
-d)
211 "$SRCDIR/configure" "${CONF_OPTS[@]}"
215 echo "Distribution in-tree build"
217 # Run configure and generate the tar file
218 # in the source directory
222 # Create and enter a temporary build directory
223 builddir
=$
(mktemp
-d)
226 # Extract the distribution tar in the build directory,
227 # ignore the first directory level
228 $TAR xvf
"$SRCDIR"/*.
tar.
* --strip 1
230 # Build in extracted source tree
231 .
/configure
"${CONF_OPTS[@]}"
235 echo "Distribution out of tree build"
237 # Create and enter a temporary build directory
238 builddir
=$
(mktemp
-d)
241 # Run configure out of tree and generate the tar file
245 dist_srcdir
="$(mktemp -d)"
248 # Extract the distribution tar in the new source directory,
249 # ignore the first directory level
250 $TAR xvf
"$builddir"/*.
tar.
* --strip 1
252 # Create and enter a second temporary build directory
253 builddir
="$(mktemp -d)"
256 # Run configure from the extracted distribution tar,
257 # out of the source tree
258 "$dist_srcdir/configure" "${CONF_OPTS[@]}"
262 echo "Standard in-tree build"
263 .
/configure
"${CONF_OPTS[@]}"
267 # We are now inside a configured build directory
270 $MAKE -j "$($NPROC)" V
=1
272 # Install in the workspace
273 $MAKE install DESTDIR
="$WORKSPACE"
275 # Run tests, don't fail now, we want to run the archiving steps
277 $MAKE --keep-going check
281 # Copy tap logs for the jenkins tap parser before cleaning the build dir
282 rsync
-a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests
/ "$WORKSPACE/tap"
284 # Clean the build directory
287 # Cleanup rpath in executables and shared libraries
288 #find "$WORKSPACE/$PREFIX/bin" -type f -perm -0500 -exec chrpath --delete {} \;
289 find "$WORKSPACE/$PREFIX/lib" -name "*.so" -exec chrpath
--delete {} \
;
291 # Remove libtool .la files
292 find "$WORKSPACE/$PREFIX/lib" -name "*.la" -exec rm -f {} \
;
294 # Exit with the return code of the test suite
This page took 0.037888 seconds and 4 git commands to generate.