mirror of https://github.com/EspoTek/Labrador.git
New bootstrap script
This commit is contained in:
parent
a31312f034
commit
fa1d7b780c
|
@ -3,34 +3,45 @@
|
|||
set -e
|
||||
|
||||
# Install prerequisites
|
||||
sudo apt-get update
|
||||
sudo apt-get install qt5-default
|
||||
sudo apt-get install libusb-1.0-0-dev
|
||||
QT5_NOT_INSTALLED = dpkg -s qt5-default
|
||||
LIBUSB_NOT_INSTALLED = dpkg -s libusb-1.0-0-dev
|
||||
|
||||
# Here, we're installing gcc-8.10
|
||||
if [ $QT5_NOT_INSTALLED ] || [ $LIBUSB_NOT_INSTALLED ]; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install qt5-default
|
||||
sudo apt-get install libusb-1.0-0-dev
|
||||
else
|
||||
"Prerequesites are already installed. Skipping step."
|
||||
fi
|
||||
|
||||
# Move to /tmp so we don't leave junk in the user's folders
|
||||
cd /tmp
|
||||
|
||||
# Install gcc-8.10, which is modern C++ friendly
|
||||
# see https://solarianprogrammer.com/2017/12/08/raspberry-pi-raspbian-install-gcc-compile-cpp-17-programs/
|
||||
cd /tmp
|
||||
rm -rf raspberry-pi-gcc-binary
|
||||
git clone --depth 1 https://github.com/EspoTek/raspberry-pi-gcc-binary
|
||||
cd ./raspberry-pi-gcc-binary
|
||||
tar xf gcc-8.1.0.tar.bz2
|
||||
sudo mv -f gcc-8.1.0 /usr/local/gcc-8.1.0-labrador
|
||||
if [ -d "/usr/local/gcc-8.1.0-labrador" ]; then
|
||||
echo "gcc-8.1.0-labrador is already installed. Skipping step."
|
||||
else
|
||||
rm -rf raspberry-pi-gcc-binary
|
||||
git clone --depth 1 https://github.com/EspoTek/raspberry-pi-gcc-binary
|
||||
cd ./raspberry-pi-gcc-binary
|
||||
tar xf gcc-8.1.0.tar.bz2
|
||||
sudo mv gcc-8.1.0 /usr/local/gcc-8.1.0-labrador
|
||||
fi
|
||||
|
||||
# Temporarily set PATH to prioritise gcc-8.10 above the other versions
|
||||
export PATH=/usr/local/gcc-8.1.0-labrador/bin:$PATH
|
||||
# Clone the latest version of Labrador
|
||||
cd /tmp
|
||||
rm -rf labrador
|
||||
git clone --depth 1 https://github.com/espotek/labrador
|
||||
|
||||
# Set PATH so that make can find gcc-8.10
|
||||
export PATH=/usr/local/gcc-8.1.0-labrador/bin:$PATH
|
||||
|
||||
# Build labrador
|
||||
cd labrador/Desktop_Interface
|
||||
qmake
|
||||
# Some people have reported issues with multi-job make (I suspect this is a power issue), so I've set it to single-threaded for now
|
||||
make CXX=g++-8.1.0 CC=gcc-8.1.0
|
||||
make CXX=g++-8.1.0 CC=gcc-8.1.0
|
||||
sudo make install
|
||||
|
||||
# Cleanup
|
||||
rm -rf raspberry-pi-gcc-binary
|
||||
rm -rf labrador
|
||||
rm -rf /usr/local/gcc-8.1.0-labrador
|
||||
rm -rf labrador
|
Loading…
Reference in New Issue