Skip to content

Instantly share code, notes, and snippets.

@Gadgetoid
Created February 6, 2019 18:59
Show Gist options
  • Save Gadgetoid/c611c29154f2763535543419f3627eae to your computer and use it in GitHub Desktop.
Save Gadgetoid/c611c29154f2763535543419f3627eae to your computer and use it in GitHub Desktop.
Script to build Sigrok and PulseView on the Raspberry Pi with Twinkie USB Power-Delivery sniffer support
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="500a", MODE="0660", GROUP="dialout"
#!/bin/bash
USER=`whoami`
TARGET=/usr
BUILD_ROOT=`pwd`
echo "Building in $BUILD_ROOT"
echo "Adding user $USER to dialout"
sudo gpasswd --add $USER dialout
echo "Installing dependencies..."
sudo apt-get -y install gcc g++ libtool automake autoconf libftdi-dev libusb-1.0-0-dev libglib2.0-dev check
sudo apt-get -y install libzip-dev libglibmm-2.4-dev doxygen python3.4-dev python-gobject-dev swig3.0
sudo apt-get -y install qtbase5-dev qtbase5-dev-tools libqt5svg5-dev libevent-pthreads-2.0-5 cmake sudo apt-get -y install libboost1.58-dev libboost-filesystem1.58-dev libboost-system1.58-dev libboost-serialization1.58-dev
echo "Cloning libraries..."
git clone https://github.com/vpalatin/libsigrok.git -b twinkie-0.5.0
git clone https://github.com/vpalatin/libsigrokdecode.git -b twinkie-0.5.0
git clone https://github.com/vpalatin/sigrok-cli.git -b twinkie-0.7.0
git clone https://github.com/vpalatin/pulseview.git -b twinkie-0.4.0
echo "Building libsigrok"
cd libsigrok/
./autogen.sh
PKG_CONFIG_PATH=$TARGET/lib/pkgconfig ./configure --prefix=$TARGET
LD_RUN_PATH=$TARGET/lib make
sudo PYTHONPATH=$TARGET/lib/python2.7/site-packages make install
cd $BUILD_ROOT
echo "Building libsigrokdecode"
cd libsigrokdecode/
./autogen.sh
./configure --prefix=$TARGET
LD_RUN_PATH=$TARGET/lib make
sudo make install
cd $BUILD_ROOT
echo "Building sigrok-cli"
cd sigrok-cli/
./autogen.sh
PKG_CONFIG_PATH=$TARGET/lib/pkgconfig ./configure --prefix=$TARGET
LD_RUN_PATH=$TARGET/lib make
sudo make install
cd $BUILD_ROOT
export PKG_CONFIG_PATH=/usr
echo "Building pulseview"
cd pulseview/
mkdir -p build
cd build
PKG_CONFIG_PATH=$TARGET/lib/pkgconfig cmake -DCMAKE_INSTALL_PREFIX:PATH=$TARGET -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=true -DENABLE_TESTS=n ..
make
sudo make install
cd $BUILD_ROOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment