tools: pyenv setup fix (#26601)

* setup pyenv immediately

* sudo

* fix
pull/26647/head
Cameron Clough 2 years ago committed by GitHub
parent cb4fef580c
commit 821d8ff12f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      tools/ubuntu_setup.sh
  2. 9
      update_requirements.sh

@ -4,13 +4,23 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
ROOT="$(cd $DIR/../ && pwd)"
SUDO=""
# NOTE: this is used in a docker build, so do not run any scripts here.
# Use sudo if not root
if [[ ! $(id -u) -eq 0 ]]; then
if [[ -z $(which sudo) ]]; then
echo "Please install sudo or run as root"
exit 1
fi
SUDO="sudo"
fi
# Install packages present in all supported versions of Ubuntu
function install_ubuntu_common_requirements() {
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
$SUDO apt-get update
$SUDO apt-get install -y --no-install-recommends \
autoconf \
build-essential \
ca-certificates \
@ -74,7 +84,7 @@ function install_ubuntu_common_requirements() {
function install_ubuntu_jammy_requirements() {
install_ubuntu_common_requirements
sudo apt-get install -y --no-install-recommends \
$SUDO apt-get install -y --no-install-recommends \
qtbase5-dev \
qtchooser \
qt5-qmake \
@ -86,7 +96,7 @@ function install_ubuntu_jammy_requirements() {
function install_ubuntu_focal_requirements() {
install_ubuntu_common_requirements
sudo apt-get install -y --no-install-recommends \
$SUDO apt-get install -y --no-install-recommends \
libavresample-dev \
qt5-default \
python-dev

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
@ -22,8 +22,13 @@ if [ -z "\$PYENV_ROOT" ]; then
eval "\$(pyenv virtualenv-init -)"
fi
EOF
# setup now without restarting shell
export PATH=$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH
export PYENV_ROOT="$HOME/.pyenv"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
source $RC_FILE
export MAKEFLAGS="-j$(nproc)"

Loading…
Cancel
Save