From: Cole Poirier Date: Fri, 24 Jul 2020 20:18:07 +0000 (-0700) Subject: Create script to build and install power_instruction_analyzer X-Git-Url: https://git.libre-soc.org/?p=dev-env-setup.git;a=commitdiff_plain;h=f713779e2ccb82ed26f161a8de80dfbeb6b491cd Create script to build and install power_instruction_analyzer --- diff --git a/pia-install b/pia-install new file mode 100755 index 0000000..57f627e --- /dev/null +++ b/pia-install @@ -0,0 +1,23 @@ +#!/bin/bash +if [ "$EUID" -ne 0 ] + then echo "Please run as root" + exit +fi + +export MYNAME=`id 1000 | awk '{print $1}' | sed 's/.*(\(.*\))/\1/'` + +runuser $MYNAME --preserve-environment -c '/bin/bash << EOF +export PATH=/home/$MYNAME/.cargo/bin:$PATH +export HOME=/home/$MYNAME +if ! command -v rustup &> /dev/null +then + echo -e "Rustup could not be found, it can be installed by running the following command: curl --proto \047=https\047 --tlsv1.2 -sSf https://sh.rustup.rs | sh" + exit +fi +cd /home/$MYNAME/src +git clone https://salsa.debian.org/Kazan-team/power-instruction-analyzer.git pia +cd pia +maturin build --cargo-extra-args=--features=python-extension +EOF' +cd /home/$MYNAME/src/pia +python3 -m pip install target/wheels/*.whl