Skip to content

Conversation

@obscurerichard
Copy link
Member

This will now build on the Raspberry Pi 2
using either a host based build or using Docker.

This improves the Debian builds so that they install
some missing OpenSSL libraries that were making CI bomb

(see https://ci.moduscreate.com/blue/organizations/jenkins/ModusCreateOrg%2Fgenus/detail/PR-209/1/pipeline for example)

This is the first cut of a build for the Raspberry Pi. I worked this up on a Raspberry Pi 2 Model B, using Raspbian GNU/Linux 9.6 (stretch). It requires that we build cmake from source since the version included in stretch is too old.

diff --git a/scripts/build.sh b/scripts/build.sh index a71a1ef..3d444be 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -10,7 +10,7 @@ set -o functrace
 IFS=$'\n\t'

 # Enable for enhanced debugging
-#set -vx +${DEBUG:-false} && set -vx

 # Credit to https://stackoverflow.com/a/17805088 and http://wiki.bash-hackers.org/scripting/debuggingtips
@@ -66,9 +66,9 @@ elif [ "$OS" == "Darwin" ]; then
     brew upgrade cmake || true
 elif [ "$(cut -c1-5 <<<"$OS")" == "Linux" ]; then
     # Do something under GNU/Linux platform
- if ! command -v apt-get >/dev/null 2>&1; then + if command -v apt-get >/dev/null 2>&1; then
         ensure_debian_devtools_installed - elif ! command -v pacman >/dev/null 2>&1; then + elif command -v pacman >/dev/null 2>&1; then
         ensure_arch_devtools_installed
     else
         echo "Only debian/ubuntu and arch Linux are supported targets, sorry." diff --git a/scripts/common.sh b/scripts/common.sh index d79fdd0..853ae0b 100755 --- a/scripts/common.sh +++ b/scripts/common.sh
@@ -39,14 +39,25 @@ function ensure_cmake {
     local cmake
     version=3.12
     build=3 + arch=$(arch)
     tmpdir=$(mktemp -d) - cmake="cmake-$version.$build-Linux-x86_64" - cd "$tmpdir" || exit 1 - curl -sSO "https://cmake.org/files/v$version/$cmake.sh" - $SUDO mkdir /opt/cmake - yes | $SUDO sh "$cmake.sh"
--prefix=/opt/cmake || true # exits 141 on success for some reason - $SUDO rm -f /usr/local/bin/cmake - $SUDO ln -s "/opt/cmake/$cmake/bin/cmake" /usr/local/bin/cmake +
cmake="cmake-$version.$build-Linux-$arch" + cd "$tmpdir" + curl -fsSO "https://cmake.org/files/v$version/$cmake.sh" + if [[ -f "$cmake" ]]; then + $SUDO mkdir -p /opt/cmake + yes | $SUDO sh "$cmake.sh"
--prefix=/opt/cmake || true # exits 141 on success for some reason + $SUDO rm -f /usr/local/bin/cmake + $SUDO ln -s "/opt/cmake/$cmake/bin/cmake" /usr/local/bin/cmake + else + cmake="cmake-$version.$build" +
curl -fsSO "https://cmake.org/files/v$version/$cmake.tar.gz" + tar xfz "$cmake.tar.gz" + cd "$cmake" + ./configure + make + $SUDO make install + fi
     rm -rf "$tmpdir"
 }

k
Disable removal of tmp dir temporarily to aid debugging.
This now works correctly to install cmake from source on the Raspberry Pi running Raspbian 9.6 (stretch).
@obscurerichard obscurerichard changed the title Build on Raspberry Pi 2 GEN-403 Build on Raspberry Pi 2 Jan 22, 2019
@obscurerichard obscurerichard merged commit e12d29e into ModusCreateOrg:master Jan 22, 2019
@obscurerichard obscurerichard deleted the GEN-403/raspberry-pi-port branch January 22, 2019 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant