xLua - Lua C++ API

Check-in [3e4a71f080]
Login
Overview
Comment:Add 32-bit builds to Travis CI
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:3e4a71f0808f25e3ef4f31c185a0534a9b7529e594dbaa11170cdb7e7f24271b
User & Date: julio@meroh.net 2016-07-18 20:02:30
Context
2018-07-04
01:55
xLua check-in: bb690c0ec0 user: xjail tags: master, trunk
01:47
Create new branch named "lutok" Leaf check-in: 66788f6d0c user: xjail tags: lutok
2016-07-18
20:02
Add 32-bit builds to Travis CI check-in: 3e4a71f080 user: julio@meroh.net tags: master, trunk
20:02
Preserve PATH when invoking sudo The new Travis CI Precise infrastructure seems to enforce env_reset in the sudo configuration and does not allow using the -E flag to bypass it. Instead, explicitly pass the PATH to the 'make distcheck' sudo invocation so that it can find the right tools. This fixes the AS_ROOT=yes builds after we were silently switched to the new infrastructure. Same as jmmv/kyua@abe209b58ba7f49d190ec809be99676430b5d5ec. check-in: e4f6c764cb user: julio@meroh.net tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to .travis.yml.

4
5
6
7
8
9
10
11
12






13
14
15
16
17
18
19
    - gcc
    - clang

before_install:
    - ./admin/travis-install-deps.sh

env:
    - AS_ROOT=no
    - AS_ROOT=yes







script:
    - ./admin/travis-build.sh

notifications:
    email:
        - lutok-log@googlegroups.com







|
|
>
>
>
>
>
>







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    - gcc
    - clang

before_install:
    - ./admin/travis-install-deps.sh

env:
    - ARCH=amd64 AS_ROOT=no
    - ARCH=amd64 AS_ROOT=yes
    - ARCH=i386 AS_ROOT=no

matrix:
    exclude:
        - compiler: clang
          env: ARCH=i386 AS_ROOT=no

script:
    - ./admin/travis-build.sh

notifications:
    email:
        - lutok-log@googlegroups.com

Changes to Makefile.am.

111
112
113
114
115
116
117

118
119
120
121
122
123
124
debug_test_LDADD = $(LUTOK_LIBS) $(ATF_CXX_LIBS)

tests_SCRIPTS = examples_test
CLEANFILES += examples_test
EXTRA_DIST += examples_test.sh
examples_test: $(srcdir)/examples_test.sh
	$(AM_V_GEN)sed -e 's,__ATF_SH__,$(ATF_SH),g' \

	    -e 's,__EXAMPLESDIR__,$(examplesdir),g' \
	    -e 's,__LIBDIR__,$(libdir),g' \
	    <$(srcdir)/examples_test.sh >examples_test.tmp; \
	chmod +x examples_test.tmp; \
	rm -f examples_test; \
	mv examples_test.tmp examples_test








>







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
debug_test_LDADD = $(LUTOK_LIBS) $(ATF_CXX_LIBS)

tests_SCRIPTS = examples_test
CLEANFILES += examples_test
EXTRA_DIST += examples_test.sh
examples_test: $(srcdir)/examples_test.sh
	$(AM_V_GEN)sed -e 's,__ATF_SH__,$(ATF_SH),g' \
	    -e 's,__CXX__,$(CXX),g' \
	    -e 's,__EXAMPLESDIR__,$(examplesdir),g' \
	    -e 's,__LIBDIR__,$(libdir),g' \
	    <$(srcdir)/examples_test.sh >examples_test.tmp; \
	chmod +x examples_test.tmp; \
	rm -f examples_test; \
	mv examples_test.tmp examples_test

Changes to admin/travis-build.sh.

32
33
34
35
36
37
38



39
40

41
42
43
44
45
46
47
if [ -d /usr/local/share/aclocal ]; then
    autoreconf -isv -I/usr/local/share/aclocal
else
    autoreconf -isv
fi
./configure




f=
f="${f} CPPFLAGS='-I/usr/local/include'"

f="${f} LDFLAGS='-L/usr/local/lib -Wl,-R/usr/local/lib'"
f="${f} PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'"
if [ "${AS_ROOT:-no}" = yes ]; then
    sudo -H PATH="${PATH}" make distcheck DISTCHECK_CONFIGURE_FLAGS="${f}"
else
    make distcheck DISTCHECK_CONFIGURE_FLAGS="${f}"
fi







>
>
>


>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
if [ -d /usr/local/share/aclocal ]; then
    autoreconf -isv -I/usr/local/share/aclocal
else
    autoreconf -isv
fi
./configure

archflags=
[ "${ARCH?}" != i386 ] || archflags=-m32

f=
f="${f} CPPFLAGS='-I/usr/local/include'"
f="${f} CXX='${CXX} ${archflags}'"
f="${f} LDFLAGS='-L/usr/local/lib -Wl,-R/usr/local/lib'"
f="${f} PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'"
if [ "${AS_ROOT:-no}" = yes ]; then
    sudo -H PATH="${PATH}" make distcheck DISTCHECK_CONFIGURE_FLAGS="${f}"
else
    make distcheck DISTCHECK_CONFIGURE_FLAGS="${f}"
fi

Changes to admin/travis-install-deps.sh.

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
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

set -e -x


sudo apt-get update -qq
















sudo apt-get install -y doxygen liblua5.2-0 liblua5.2-dev \
    libsqlite3-0 libsqlite3-dev pkg-config sqlite3


install_from_github() {
    local project="${1}"; shift
    local name="${1}"; shift
    local release="${1}"; shift

    local distname="${name}-${release}"

    local baseurl="https://github.com/jmmv/${project}"
    wget --no-check-certificate \
        "${baseurl}/releases/download/${distname}/${distname}.tar.gz"
    tar -xzvf "${distname}.tar.gz"




    cd "${distname}"
    ./configure \
        --disable-developer \
        --without-atf \
        --without-doxygen \

        CPPFLAGS="-I/usr/local/include" \

        LDFLAGS="-L/usr/local/lib -Wl,-R/usr/local/lib" \
        PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
    make
    sudo make install
    cd -

    rm -rf "${distname}" "${distname}.tar.gz"
}

install_from_bintray() {


    local name="20140803-usr-local-kyua-ubuntu-12-04-amd64-${CC:-gcc}.tar.gz"









    wget "http://dl.bintray.com/jmmv/kyua/${name}" || return 1
    sudo tar -xzvp -C / -f "${name}"
    rm -f "${name}"
}


if ! install_from_bintray; then
    install_from_github atf atf 0.20
    install_from_github lutok lutok 0.4
    install_from_github kyua kyua-testers 0.2
    install_from_github kyua kyua-cli 0.8
fi







>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
<
>













>
>
>





>

>










>
>
|
>
>
>
>
>
>
>
>
>





>






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
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

set -e -x

install_deps() {
    sudo apt-get update -qq

    local pkgsuffix=
    local packages=
    if [ "${ARCH?}" = i386 ]; then
         pkgsuffix=:i386
         packages="${packages} gcc-multilib"
         packages="${packages} g++-multilib"
    fi
    packages="${packages} doxygen"
    packages="${packages} gdb"
    packages="${packages} liblua5.2-0${pkgsuffix}"
    packages="${packages} liblua5.2-dev${pkgsuffix}"
    packages="${packages} libsqlite3-0${pkgsuffix}"
    packages="${packages} libsqlite3-dev${pkgsuffix}"
    packages="${packages} pkg-config${pkgsuffix}"
    packages="${packages} sqlite3"
    sudo apt-get install -y ${packages}

}

install_from_github() {
    local project="${1}"; shift
    local name="${1}"; shift
    local release="${1}"; shift

    local distname="${name}-${release}"

    local baseurl="https://github.com/jmmv/${project}"
    wget --no-check-certificate \
        "${baseurl}/releases/download/${distname}/${distname}.tar.gz"
    tar -xzvf "${distname}.tar.gz"

    local archflags=
    [ "${ARCH?}" != i386 ] || archflags=-m32

    cd "${distname}"
    ./configure \
        --disable-developer \
        --without-atf \
        --without-doxygen \
        CFLAGS="${archflags}" \
        CPPFLAGS="-I/usr/local/include" \
        CXXFLAGS="${archflags}" \
        LDFLAGS="-L/usr/local/lib -Wl,-R/usr/local/lib" \
        PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
    make
    sudo make install
    cd -

    rm -rf "${distname}" "${distname}.tar.gz"
}

install_from_bintray() {
    case "${ARCH?}" in
        amd64)
            name="20160204-usr-local-kyua-ubuntu-12-04-amd64-${CC?}.tar.gz"
            ;;
        i386)
            name="20160714-usr-local-kyua-ubuntu-12-04-i386-${CC?}.tar.gz"
            ;;
        *)
            echo "ERROR: Unknown ARCH value ${ARCH}" 1>&2
            exit 1
            ;;
    esac
    wget "http://dl.bintray.com/jmmv/kyua/${name}" || return 1
    sudo tar -xzvp -C / -f "${name}"
    rm -f "${name}"
}

install_deps
if ! install_from_bintray; then
    install_from_github atf atf 0.20
    install_from_github lutok lutok 0.4
    install_from_github kyua kyua-testers 0.2
    install_from_github kyua kyua-cli 0.8
fi

Changes to examples_test.sh.

23
24
25
26
27
28
29

30
31
32
33
34
35
36
37
38
39
40
41
42
43
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


ExamplesDir="__EXAMPLESDIR__"
LibDir="__LIBDIR__"


make_example() {
    cp "${ExamplesDir}/Makefile" "${ExamplesDir}/${1}.cpp" .
    make "${1}"

    # Ensure that the binary we just built can find liblutok.  This is
    # needed because the lutok.pc file (which the Makefile used above
    # queries) does not provide rpaths to the installed library and
    # therefore the binary may not be able to locate it.  Hardcoding the
    # rpath flags into lutok.pc is non-trivial because we simply don't
    # have any knowledge about what the correct flag to set an rpath is.







>






|







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Cxx="__CXX__"
ExamplesDir="__EXAMPLESDIR__"
LibDir="__LIBDIR__"


make_example() {
    cp "${ExamplesDir}/Makefile" "${ExamplesDir}/${1}.cpp" .
    make CXX="${Cxx}" "${1}"

    # Ensure that the binary we just built can find liblutok.  This is
    # needed because the lutok.pc file (which the Makefile used above
    # queries) does not provide rpaths to the installed library and
    # therefore the binary may not be able to locate it.  Hardcoding the
    # rpath flags into lutok.pc is non-trivial because we simply don't
    # have any knowledge about what the correct flag to set an rpath is.