mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
Tools: use venv on Archlinux to fix install
This commit is contained in:
parent
be74f7b480
commit
2b8a605fd2
2
.github/workflows/test_environment.yml
vendored
2
.github/workflows/test_environment.yml
vendored
@ -115,6 +115,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
|
source $HOME/venv-ardupilot/bin/activate || true
|
||||||
git config --global --add safe.directory /__w/ardupilot/ardupilot
|
git config --global --add safe.directory /__w/ardupilot/ardupilot
|
||||||
./waf configure
|
./waf configure
|
||||||
./waf rover
|
./waf rover
|
||||||
@ -128,6 +129,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
|
source $HOME/venv-ardupilot/bin/activate || true
|
||||||
case ${{matrix.os}} in
|
case ${{matrix.os}} in
|
||||||
*"archlinux"*)
|
*"archlinux"*)
|
||||||
export PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin:$PATH
|
export PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin:$PATH
|
||||||
|
@ -50,10 +50,25 @@ function maybe_prompt_user() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
sudo usermod -a -G uucp $USER
|
sudo usermod -a -G uucp "$USER"
|
||||||
|
|
||||||
sudo pacman -Sy --noconfirm --needed $BASE_PKGS $SITL_PKGS $PX4_PKGS
|
sudo pacman -Sy --noconfirm --needed $BASE_PKGS $SITL_PKGS $PX4_PKGS
|
||||||
pip3 -q install --user -U $PYTHON_PKGS
|
|
||||||
|
python3 -m venv "$HOME"/venv-ardupilot
|
||||||
|
|
||||||
|
# activate it:
|
||||||
|
SOURCE_LINE="source $HOME/venv-ardupilot/bin/activate"
|
||||||
|
$SOURCE_LINE
|
||||||
|
|
||||||
|
if [[ -z "${DO_PYTHON_VENV_ENV}" ]] && maybe_prompt_user "Make ArduPilot venv default for python [N/y]?" ; then
|
||||||
|
DO_PYTHON_VENV_ENV=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $DO_PYTHON_VENV_ENV -eq 1 ]]; then
|
||||||
|
echo "$SOURCE_LINE" >> ~/.bashrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
pip3 -q install -U $PYTHON_PKGS
|
||||||
|
|
||||||
(
|
(
|
||||||
cd /usr/lib/ccache
|
cd /usr/lib/ccache
|
||||||
@ -78,7 +93,7 @@ exportline="export PATH=$OPT/$ARM_ROOT/bin:\$PATH";
|
|||||||
if ! grep -Fxq "$exportline" ~/.bashrc ; then
|
if ! grep -Fxq "$exportline" ~/.bashrc ; then
|
||||||
if maybe_prompt_user "Add $OPT/$ARM_ROOT/bin to your PATH [N/y]?" ; then
|
if maybe_prompt_user "Add $OPT/$ARM_ROOT/bin to your PATH [N/y]?" ; then
|
||||||
echo "$exportline" >> ~/.bashrc
|
echo "$exportline" >> ~/.bashrc
|
||||||
. ~/.bashrc
|
. "$HOME/.bashrc"
|
||||||
else
|
else
|
||||||
echo "Skipping adding $OPT/$ARM_ROOT/bin to PATH."
|
echo "Skipping adding $OPT/$ARM_ROOT/bin to PATH."
|
||||||
fi
|
fi
|
||||||
@ -88,7 +103,7 @@ exportline2="export PATH=$CWD/$ARDUPILOT_TOOLS:\$PATH";
|
|||||||
if ! grep -Fxq "$exportline2" ~/.bashrc ; then
|
if ! grep -Fxq "$exportline2" ~/.bashrc ; then
|
||||||
if maybe_prompt_user "Add $CWD/$ARDUPILOT_TOOLS to your PATH [N/y]?" ; then
|
if maybe_prompt_user "Add $CWD/$ARDUPILOT_TOOLS to your PATH [N/y]?" ; then
|
||||||
echo "$exportline2" >> ~/.bashrc
|
echo "$exportline2" >> ~/.bashrc
|
||||||
. ~/.bashrc
|
. "$HOME/.bashrc"
|
||||||
else
|
else
|
||||||
echo "Skipping adding $CWD/$ARDUPILOT_TOOLS to PATH."
|
echo "Skipping adding $CWD/$ARDUPILOT_TOOLS to PATH."
|
||||||
fi
|
fi
|
||||||
@ -96,7 +111,7 @@ fi
|
|||||||
|
|
||||||
SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
|
SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
|
||||||
(
|
(
|
||||||
cd $SCRIPT_DIR
|
cd "$SCRIPT_DIR"
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user