diff mbox series

[v3,2/3] travis: simplify cross-compilation setup

Message ID 1500375612-10544-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v3,1/3] example: ipfragaddress: fix compilation with clang | expand

Commit Message

Github ODP bot July 18, 2017, 11 a.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Following Maxim's idea use apt-get to download and install cross-packages.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 73 (lumag:cross-2)
 ** https://github.com/Linaro/odp/pull/73
 ** Patch: https://github.com/Linaro/odp/pull/73.patch
 ** Base sha: 490f4bf22129638899ce71c99a8847e8ba849692
 ** Merge commit sha: 9f16bf8e8db817327b01f090ff2d1e656093abfc
 **/
 .travis.yml | 65 ++++++++++++++++++++-----------------------------------------
 1 file changed, 21 insertions(+), 44 deletions(-)
diff mbox series

Patch

diff --git a/.travis.yml b/.travis.yml
index 665d70f8..36728afc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -43,10 +43,6 @@  addons:
                         - clang-3.8
                         - automake autoconf libtool libssl-dev graphviz mscgen doxygen
                         - libpcap-dev
-                        - dpkg-cross equivs
-                        - gcc-aarch64-linux-gnu pkg-config-aarch64-linux-gnu libc6-dev-arm64-cross
-                        - gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf libc6-dev-armhf-cross
-                        - gcc-powerpc-linux-gnu pkg-config-powerpc-linux-gnu libc6-dev-powerpc-cross
 #        coverity_scan:
 #                project:
 #                        name: "$TRAVIS_REPO_SLUG"
@@ -66,7 +62,24 @@  env:
         - CONF="--enable-schedule-iquery"
 
 before_install:
-#       Install cunit for the validation tests because distro version is too old and fails C99 compile
+
+        # Install cross toolchains, etc
+        # apt-get update may fail thanks to Ubuntu removing Packages/indices while not removing relevant parts of Release file
+        - if [ -n "$CROSS_ARCH" ] ;
+          then
+                  BUILD_GNU_TYPE=`dpkg-architecture -a"$CROSS_ARCH" -qDEB_BUILD_GNU_TYPE` ;
+                  CROSS_GNU_TYPE=`dpkg-architecture -a"$CROSS_ARCH" -qDEB_HOST_GNU_TYPE` ;
+                  CROSS_MULTIARCH=`dpkg-architecture -a"$CROSS_ARCH" -qDEB_HOST_MULTIARCH` ;
+                  CROSS="--host="$CROSS_GNU_TYPE" --build="$BUILD_GNU_TYPE" --prefix=/usr --includedir=/usr/include/"$CROSS_MULTIARCH" --libdir=/usr/lib/"$CROSS_MULTIARCH" --libexecdir=/usr/lib/"$CROSS_MULTIARCH"" ;
+                  sudo dpkg --add-architecture "$CROSS_ARCH" ;
+                  sudo -E apt-add-repository -y "deb http://ports.ubuntu.com trusty main" ;
+                  sudo -E apt-add-repository -y "deb http://ports.ubuntu.com trusty-updates main" ;
+                  sudo -E apt-get -y update || true ;
+                  sudo -E apt-get -y --no-install-suggests --no-install-recommends --force-yes install build-essential gcc-"$CROSS_GNU_TYPE" pkg-config-"$CROSS_GNU_TYPE" ;
+                  sudo -E apt-get -y --no-install-suggests --no-install-recommends --force-yes install libc6-dev:"$CROSS_ARCH" libssl-dev:"$CROSS_ARCH" zlib1g-dev:"$CROSS_ARCH" libconfig-dev:"$CROSS_ARCH" ;
+          fi
+
+        # Install cunit for the validation tests because distro version is too old and fails C99 compile
         - sudo apt-get remove libcunit1-dev libcunit1
         - export CUNIT_VERSION=2.1-3
         - curl -sSOL https://github.com/Linaro/libcunit/releases/download/${CUNIT_VERSION}/CUnit-${CUNIT_VERSION}.tar.bz2
@@ -134,63 +147,27 @@  jobs:
         include:
                 - stage: test
                   compiler: aarch64-linux-gnu-gcc
-                  env: TEST="aarch64-linux-gnu" CROSS="--host=aarch64-linux-gnu --prefix=/usr/aarch64-linux-gnu"
+                  env: TEST="aarch64-linux-gnu" CROSS_ARCH="arm64"
                   install: true
                   script:
-                          - mkdir cross
-                          - pushd cross
-                            # one can not include colon in the command or bad things will happen, so mimic it
-                          - env echo -e 'Provides\x3a multiarch-support, debconf, debconf-2.0' > dummy
-                          - equivs-build -a arm64 dummy
-                          - wget
-                            http://ports.ubuntu.com/pool/main/o/openssl/libssl-dev_1.0.1f-1ubuntu2.22_arm64.deb
-                            http://ports.ubuntu.com/pool/main/o/openssl/libssl1.0.0_1.0.1f-1ubuntu2.22_arm64.deb
-                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g-dev_1.2.8.dfsg-1ubuntu1_arm64.deb
-                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g_1.2.8.dfsg-1ubuntu1_arm64.deb
-                          - sudo dpkg-cross -i -M -A -a arm64 *.deb
-                          - popd
                           - ./bootstrap
                           - ./configure --prefix=$HOME/odp-install $CROSS
                             --disable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-test-perf-proc --enable-test-example
                           - make -j $(nproc)
                 - stage: test
                   compiler: arm-linux-gnueabihf-gcc
-                  env: TEST="arm-linux-gnueabihf" CROSS="--host=arm-linux-gnueabihf --prefix=/usr/arm-linux-gnueabihf"
+                  env: TEST="arm-linux-gnueabihf" CROSS_ARCH="armhf"
                   install: true
                   script:
-                          - mkdir cross
-                          - pushd cross
-                            # one can not include colon in the command or bad things will happen, so mimic it
-                          - env echo -e 'Provides\x3a multiarch-support, debconf, debconf-2.0' > dummy
-                          - equivs-build -a armhf dummy
-                          - wget
-                            http://ports.ubuntu.com/pool/main/o/openssl/libssl-dev_1.0.1f-1ubuntu2.22_armhf.deb
-                            http://ports.ubuntu.com/pool/main/o/openssl/libssl1.0.0_1.0.1f-1ubuntu2.22_armhf.deb
-                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g-dev_1.2.8.dfsg-1ubuntu1_armhf.deb
-                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g_1.2.8.dfsg-1ubuntu1_armhf.deb
-                          - sudo dpkg-cross -i -M -A -a armhf *.deb
-                          - popd
                           - ./bootstrap
                           - ./configure --prefix=$HOME/odp-install $CROSS
                             --disable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-test-perf-proc --enable-test-example
                           - make -j $(nproc)
                 - stage: test
                   compiler: powerpc-linux-gnu-gcc
-                  env: TEST="powerpc-linux-gnu" CROSS="--host=powerpc-linux-gnu --prefix=/usr/powerpc-linux-gnu"
+                  env: TEST="powerpc-linux-gnueabihf" CROSS_ARCH="powerpc"
                   install: true
                   script:
-                          - mkdir cross
-                          - pushd cross
-                            # one can not include colon in the command or bad things will happen, so mimic it
-                          - env echo -e 'Provides\x3a multiarch-support, debconf, debconf-2.0' > dummy
-                          - equivs-build -a powerpc dummy
-                          - wget
-                            http://ports.ubuntu.com/pool/main/o/openssl/libssl-dev_1.0.1f-1ubuntu2.22_powerpc.deb
-                            http://ports.ubuntu.com/pool/main/o/openssl/libssl1.0.0_1.0.1f-1ubuntu2.22_powerpc.deb
-                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g-dev_1.2.8.dfsg-1ubuntu1_powerpc.deb
-                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g_1.2.8.dfsg-1ubuntu1_powerpc.deb
-                          - sudo dpkg-cross -i -M -A -a powerpc *.deb
-                          - popd
                           - ./bootstrap
                           - ./configure --prefix=$HOME/odp-install $CROSS
                             --disable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-test-perf-proc --enable-test-example