From f713779e2ccb82ed26f161a8de80dfbeb6b491cd Mon Sep 17 00:00:00 2001 From: Cole Poirier Date: Fri, 24 Jul 2020 13:18:07 -0700 Subject: [PATCH] Create script to build and install power_instruction_analyzer --- pia-install | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 pia-install 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 -- 2.30.2