From 9b506675e9fa47a65e05c48145eee732f9c85a43 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Tue, 15 Oct 2019 12:57:42 -0400 Subject: [PATCH] Standalone MRAA installer for OpenAPS v0.7.0 (#1302) * Standalone MRAA installer for OpenAPS v0.7.0 Addresses https://github.com/openaps/oref0/issues/1270 * Add oref0-mraa-install to package.json --- bin/oref0-mraa-install.sh | 12 ++++++++++++ package.json | 1 + 2 files changed, 13 insertions(+) create mode 100644 bin/oref0-mraa-install.sh diff --git a/bin/oref0-mraa-install.sh b/bin/oref0-mraa-install.sh new file mode 100644 index 000000000..037ad9421 --- /dev/null +++ b/bin/oref0-mraa-install.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +echo "Starting MRAA build...Installing dependencies..." +sudo apt-get -y install git build-essential swig3.0 cmake libjson-c-dev +echo "Downloading MRAA..." +mkdir -p ~/src && cd ~/src && wget https://github.com/intel-iot-devkit/mraa/archive/v1.7.0.tar.gz +echo "Extracting and building MRAA..." +tar -xvf v1.7.0.tar.gz && mv mraa-1.7.0/ mraa/ +mkdir -p mraa/build && cd mraa/build && cmake .. -DBUILDSWIGNODE=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr && make && sudo make install +echo "Running ldconfig..." +bash -c "grep -q i386-linux-gnu /etc/ld.so.conf || echo /usr/local/lib/i386-linux-gnu/ >> /etc/ld.so.conf && ldconfig" +echo "MRAA installed. Please reboot before using." diff --git a/package.json b/package.json index e25c6995a..c8fa7431a 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "oref0-mdt-update": "./bin/oref0-mdt-update.sh", "oref0-meal": "./bin/oref0-meal.js", "oref0-monitor-cgm": "./bin/oref0-monitor-cgm.sh", + "oref0-mraa-install": "./bin/oref0-mraa-install.sh", "oref0-ns-loop": "./bin/oref0-ns-loop.sh", "oref0-normalize-temps": "./bin/oref0-normalize-temps.js", "oref0_nightscout_check": "./bin/oref0_nightscout_check.py",