tools: pyenv setup fix (#26601)
* setup pyenv immediately * sudo * fix old-commit-hash: 821d8ff12f3b9c9c9ba852dd7160f5a72d3d761d
This commit is contained in:
@@ -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)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user