Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEN-403 Fix linux build, stub in Raspberry Pi #207

Merged

Conversation

obscurerichard
Copy link
Member

@obscurerichard obscurerichard commented Dec 20, 2018

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.

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 WIP: GEN-403 Fix linux build, stub in Raspberry Pi GEN-403 Fix linux build, stub in Raspberry Pi Dec 21, 2018
@mschwartz mschwartz merged commit 4862f76 into ModusCreateOrg:master Dec 21, 2018
@mschwartz mschwartz deleted the GEN-403/raspberry-pi-port branch December 21, 2018 06:04
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.

None yet

2 participants