Debian Codegraph @

src/libsass/script/ci-build-libsass

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 set -e
4
5 script/bootstrap
6
7 echoscip-shell system . . echo. Building LibSass $MAKE_OPTS
8
9 # export this path right here (was in script/spec before)
10 export SASS_LIBSASS_PATH="$( cd "$( dirnamescip-shell system . . dirname. "${BASH_SOURCE[0]}" )"/../ && pwdscip-shell system . . pwd. )"
11
12 # use some defaults if not running under travis ci
13 if [scip-shell system . . `[`. "x$CONTINUOUS_INTEGRATION" == "x" ]; then export CONTINUOUS_INTEGRATION=true; fi
14 if [scip-shell system . . `[`. "x$TRAVIS_BUILD_DIR" == "x" ]; then export TRAVIS_BUILD_DIR=$(pwdscip-shell system . . pwd.); fi
15 if [scip-shell system . . `[`. "x$SASS_SASSC_PATH" == "x" ]; then export SASS_SASSC_PATH=$(pwdscip-shell system . . pwd.)/sassc; fi
16 if [scip-shell system . . `[`. "x$SASS_SPEC_PATH" == "x" ]; then export SASS_SPEC_PATH=$(pwdscip-shell system . . pwd.)/sass-spec; fi
17
18 # try to get the os name from uname (and filter via perl - probably not the most portable way?)
19 if [scip-shell system . . `[`. "x$TRAVIS_OS_NAME" == "x" ]; then export TRAVIS_OS_NAME=`unamescip-shell system . . uname. -s | perlscip-shell system . . perl. -ne 'print lc \$1 if\(/^([a-zA-Z]+)/'\)`; fi
20
21 if [scip-shell system . . `[`. "x$COVERAGE" == "xyes" ]; then
22 COVERAGE_OPT="--enable-coverage"
23 export EXTRA_CFLAGS="-fprofile-arcs -ftest-coverage"
24 export EXTRA_CXXFLAGS="-fprofile-arcs -ftest-coverage"
25 if [scip-shell system . . `[`. "$TRAVIS_OS_NAME" == "osx" ]; then
26 # osx doesn't seem to know gcov lib?
27 export EXTRA_LDFLAGS="--coverage"
28 else
29 export EXTRA_LDFLAGS="-lgcov --coverage"
30 fi
31 else
32 COVERAGE_OPT="--disable-coverage"
33 fi
34
35 if [scip-shell system . . `[`. "x$BUILD" == "xstatic" ]; then
36 SHARED_OPT="--disable-shared --enable-static"
37 MAKE_TARGET="static"
38 else
39 # Makefile of sassc wants to link to static
40 SHARED_OPT="--enable-shared --enable-static"
41 MAKE_TARGET="shared"
42 fi
43
44 if [scip-shell system . . `[`. "$(exprscip-shell system . . expr. substr $(unamescip-shell system . . uname. -s) 1 10)" == "MINGW32_NT" ]; then
45 MAKE_OPTS="$MAKE_OPTS -j1 V=1"
46 else
47 MAKE_OPTS="$MAKE_OPTS -j5 V=1"
48 fi
49
50 if [scip-shell system . . `[`. "x$PREFIX" == "x" ]; then
51 if [scip-shell system . . `[`. "x$TRAVIS_BUILD_DIR" == "x" ]; then
52 PREFIX=$SASS_LIBSASS_PATH/build
53 else
54 PREFIX=$TRAVIS_BUILD_DIR/build
55 fi
56 fi
57
58 # enable address sanitation
59 # https://en.wikipedia.org/wiki/AddressSanitizer
60 if [scip-shell system . . `[`. "x$CC" == "xclang" ]; then
61 if [scip-shell system . . `[`. "x$COVERAGE" != "xyes" ]; then
62 if [scip-shell system . . `[`. "$TRAVIS_OS_NAME" == "linux" ]; then
63 export EXTRA_CFLAGS="$EXTRA_CFLAGS -fsanitize=address"
64 export EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -fsanitize=address"
65 export EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fsanitize=address"
66 fi
67 fi
68 fi
69
70 echoscip-shell system . . echo. SASS_LIBSASS_PATH: $SASS_LIBSASS_PATH
71 echoscip-shell system . . echo. TRAVIS_BUILD_DIR: $TRAVIS_BUILD_DIR
72 echoscip-shell system . . echo. SASS_SASSC_PATH: $SASS_SASSC_PATH
73 echoscip-shell system . . echo. SASS_SPEC_PATH: $SASS_SPEC_PATH
74 echoscip-shell system . . echo. INSTALL_LOCATION: $PREFIX
75
76 if [scip-shell system . . `[`. "x$AUTOTOOLS" == "xyes" ]; then
77
78 echoscip-shell system . . echo. -en 'travis_fold:start:configure\r'
79 autoreconfscip-shell system . . autoreconf. --force --install
80 ./configure --enable-tests $COVERAGE_OPT \
81 --disable-silent-rules \
82 --with-sassc-dir=$SASS_SASSC_PATH \
83 --with-sass-spec-dir=$SASS_SPEC_PATH \
84 --prefix=$PREFIX \
85 ${SHARED_OPT}
86 echoscip-shell system . . echo. -en 'travis_fold:end:configure\r'
87
88 makescip-shell system . . make. $MAKE_OPTS clean
89
90 else
91
92 makescip-shell system . . make. $MAKE_OPTS clean
93
94 # Run C++ unit tests
95 makescip-shell system . . make. $MAKE_OPTS -C test clean
96 makescip-shell system . . make. $MAKE_OPTS -C test test
97
98 fi
99
100 # install to prefix directory
101 PREFIX="$PREFIX" makescip-shell system . . make. $MAKE_OPTS install
102
103 lsscip-shell system . . ls. -la $PREFIX/*
104
105 echoscip-shell system . . echo. successfully compiled libsass
106 echoscip-shell system . . echo. AUTOTOOLS=$AUTOTOOLS COVERAGE=$COVERAGE BUILD=$BUILD
107
108 if [scip-shell system . . `[`. "$CONTINUOUS_INTEGRATION" == "true" ] && [scip-shell system . . `[`. "$TRAVIS_PULL_REQUEST" != "false" ] && [scip-shell system . . `[`. "x$TRAVIS_PULL_REQUEST" != "x" ] &&
109 ([scip-shell system . . `[`. "$TRAVIS_OS_NAME" == "linux" ] || [scip-shell system . . `[`. "$TRAVIS_OS_NAME" == "osx" ] || [scip-shell system . . `[`. "$TRAVIS_OS_NAME" == "cygwin" ]);
110 then
111
112 echoscip-shell system . . echo. "Fetching PR $TRAVIS_PULL_REQUEST"
113
114 JSON=$(curlscip-shell system . . curl. -L -sS https://api.github.com/repos/sass/libsass/pulls/$TRAVIS_PULL_REQUEST)
115
116 if [[ $JSON =~ "API rate limit exceeded" ]];
117 then
118 echoscip-shell system . . echo. "Travis rate limit on github exceeded"
119 echoscip-shell system . . echo. "Retrying via 'special purpose proxy'"
120 JSON=$(curlscip-shell system . . curl. -L -sS https://github-api-reverse-proxy.herokuapp.com/repos/sass/libsass/pulls/$TRAVIS_PULL_REQUEST)
121 fi
122
123 RE_SPEC_PR="sass\/sass-spec(#|\/pull\/)([0-9]+)"
124
125 if [[ $JSON =~ $RE_SPEC_PR ]];
126 then
127 SPEC_PR="${BASH_REMATCH[2]}"
128 echoscip-shell system . . echo. "Fetching Sass Spec PR $SPEC_PR"
129 gitscip-shell system . . git. -C sass-spec fetch -u origin pull/$SPEC_PR/head:ci-spec-pr-$SPEC_PR
130 gitscip-shell system . . git. -C sass-spec checkout --force ci-spec-pr-$SPEC_PR
131 makescip-shell system . . make. $MAKE_OPTS test_probe
132 else
133 makescip-shell system . . make. $MAKE_OPTS test_probe
134 fi
135 else
136 makescip-shell system . . make. $MAKE_OPTS test_probe
137 fi