Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ install:

before_script:
- if test "${COMMIT_MESSAGE#*'[publish]'}" != "$COMMIT_MESSAGE"; then echo "publishing" && export PUBLISH=true; else echo "not publishing"; fi;

- if test "${MASON_PLATFORM}" == "ArmLinux"; then source osx/ArmLinux_setup.sh; fi;

script:
- source ./build.sh
- ${TARGET}
- $COMPILE_ENV ./wrapper.sh
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function upgrade_gcc {
fi
echo "updating apt"
sudo apt-get update -y
if [[ $(lsb_release --id) =~ "Ubuntu" ]]; then
if [[ $(lsb_release --id) =~ "Ubuntu" ]] || [[ $(lsb_release --id) =~ "Raspbian" ]]; then
echo "installing C++11 compiler"
sudo apt-get install -qq -y gcc-4.8 g++-4.8
export CC="gcc-4.8"
Expand Down Expand Up @@ -91,6 +91,8 @@ function upgrade_clang {
sudo apt-get install -y software-properties-common
sudo add-apt-repository "deb http://llvm.org/apt/unstable/ llvm-toolchain-${CLANG_VERSION} main"
fi
fi
if [[ $(lsb_release --id) =~ "Debian" ]] || [[ $(lsb_release --id) =~ "Raspbian" ]]; then
echo "updating apt"
sudo apt-get update -y
echo 'upgrading libstdc++'
Expand Down
17 changes: 17 additions & 0 deletions osx/ArmLinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -u

export MASON_PLATFORM="ArmLinux"
export HOST_PLATFORM="Linux"
export BOOST_ARCH="arm"
export ARCH_NAME="armv7"
export HOST_ARG=""
export CXX="g++"
export CC="gcc"
export MAKE="make"
# default to C++11 for this platform
if [[ "${CXX11:-false}" == false ]]; then
export CXX11=true
fi
source $(dirname "$BASH_SOURCE")/settings.sh
3 changes: 3 additions & 0 deletions osx/ArmLinux_fake_sudo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

$@
23 changes: 23 additions & 0 deletions osx/ArmLinux_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CHROOT_BASE=. # This makes Travis CI environment easier

MASON_PLATFORM=${MASON_PLATFORM-ArmLinux}
CXX11=${CXX11-true}
TARGET=${TARGET-build_mapnik}
QUIET=${QUIET-true}
MAPNIK_BRANCH=${MAPNIK_BRANCH-master}

# select g++/gcc here because upgrade_(compiler) is called before platorm script
CXX=g++
CC=gcc

export COMPILE_ENV="sudo chroot $CHROOT_BASE /usr/bin/env MASON_PLATFORM=${MASON_PLATFORM} CXX11=${CXX11} TARGET=${TARGET} QUIET=${QUIET} MAPNIK_BRANCH=${MAPNIK_BRANCH} CXX=${CXX} CC=${CC}"

# setup chroot/qemu
sudo apt-get install debootstrap qemu-user-static
sudo debootstrap --foreign --variant=minbase --arch armhf --include=locales testing `pwd`/$CHROOT_BASE http://mirrordirector.raspbian.org/raspbian
sudo cp /usr/bin/qemu-arm-static $CHROOT_BASE/usr/bin/
sudo cp osx/ArmLinux_setup_stage2.sh $CHROOT_BASE/tmp/setup.sh
sudo cp osx/ArmLinux_fake_sudo.sh $CHROOT_BASE/usr/bin/sudo

# enter chroot/qemu
$COMPILE_ENV /tmp/setup.sh
28 changes: 28 additions & 0 deletions osx/ArmLinux_setup_stage2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

LANG=${LANG-'en_US.UTF-8'}

# finish debootstrap process
./debootstrap/debootstrap --second-stage
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
cat <<'EOF' > /tmp/preseed.txt
locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8
locales locales/default_environment_locale select en_US.UTF-8
tzdata tzdata/Areas select US
tzdata tzdata/Zones/US select Central
EOF
debconf-set-selections /tmp/preseed.txt
export LANGUAGE=$LANG
export LANG=$LANG
export LC_ALL=$LANG
locale-gen $LANG
dpkg-reconfigure tzdata locales

# set up apt-get
echo "deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi" > /etc/apt/sources.list

apt-get update
apt-get install -q -y lsb-release wget

# mount proc for 'free'
mount proc /proc -t proc
18 changes: 18 additions & 0 deletions osx/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,24 @@ elif [[ ${MASON_PLATFORM} == 'Linaro-softfp' ]]; then
fi
export ZLIB_PATH="${SYSROOT}/usr"

elif [[ ${MASON_PLATFORM} == 'ArmLinux' ]]; then
export EXTRA_CFLAGS=""
export EXTRA_LDFLAGS=""
export EXTRA_CXXFLAGS=""
export EXTRA_CPPFLAGS=""
export CORE_CXX="g++"
export CORE_CC="gcc"
export ARCH_FLAGS=""
export STDLIB="libstdcpp"
export STDLIB_CXXFLAGS=""
export STDLIB_LDFLAGS=""
export CXX_VISIBILITY_FLAGS=""
if [[ "${CXX11}" == true ]]; then
export STDLIB="libstdcpp"
export STDLIB_CXXFLAGS="-std=c++11 -DBOOST_SPIRIT_USE_PHOENIX_V3=1"
export STDLIB_LDFLAGS=""
fi
export SDK_PATH=""
elif [[ ${MASON_PLATFORM} == 'Android' ]]; then
export CXX_VISIBILITY_FLAGS=""
export alias ldconfig=true
Expand Down
13 changes: 13 additions & 0 deletions wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

echo "Initial environment:"
env

echo "Sourcing build.sh for build functions ..."
source ./build.sh

echo "Post-build.sh environment:"
env

echo "Running '${TARGET}' as build target ..."
${TARGET}