mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
Update linux-before-install.sh
This commit is contained in:
68
.github/actions/linux-before-install.sh
vendored
68
.github/actions/linux-before-install.sh
vendored
@@ -1,22 +1,18 @@
|
|||||||
echo "RUNNING: apt update..."
|
if [[ "${GOAL}" == "build" ]]; then
|
||||||
sudo apt-get -qq --yes update > /dev/null
|
echo "RUNNING: apt update..."
|
||||||
sudo apt-get -qq --yes install swig libpcsclite-dev
|
sudo apt-get -qq --yes update > /dev/null
|
||||||
if [[ "$TRAVIS_JOB_NAME" == *"Testing" ]]; then
|
sudo apt-get -qq --yes install swig libpcsclite-dev
|
||||||
export python="python"
|
fi
|
||||||
export pip="pip"
|
export whereibelong=$(pwd)
|
||||||
echo "Travis setup Python $TRAVIS_PYTHON_VERSION"
|
echo "We are running on $ImageOS $ImageVersion"
|
||||||
echo "running tests with this version"
|
export LD_LIBRARY_PATH=~/ssl/lib:~/python/lib
|
||||||
else
|
export cpucount=$(nproc --all)
|
||||||
export whereibelong=$(pwd)
|
echo "This device has $cpucount CPUs for compiling..."
|
||||||
echo "We are running on $ImageOS $ImageVersion"
|
export SSLVER=$(~/ssl/bin/openssl version)
|
||||||
export LD_LIBRARY_PATH=~/ssl/lib:~/python/lib
|
export SSLRESULT=$?
|
||||||
cpucount=$(nproc --all)
|
export PYVER=$(~/python/bin/python3 -V)
|
||||||
echo "This device has $cpucount CPUs for compiling..."
|
export PYRESULT=$?
|
||||||
SSLVER=$(~/ssl/bin/openssl version)
|
if [ $SSLRESULT -ne 0 ] || [[ "$SSLVER" != "OpenSSL $BUILD_OPENSSL_VERSION "* ]] || [ $PYRESULT -ne 0 ] || [[ "$PYVER" != "Python $BUILD_PYTHON_VERSION"* ]]; then
|
||||||
SSLRESULT=$?
|
|
||||||
PYVER=$(~/python/bin/python3 -V)
|
|
||||||
PYRESULT=$?
|
|
||||||
if [ $SSLRESULT -ne 0 ] || [[ "$SSLVER" != "OpenSSL $BUILD_OPENSSL_VERSION "* ]] || [ $PYRESULT -ne 0 ] || [[ "$PYVER" != "Python $BUILD_PYTHON_VERSION"* ]]; then
|
|
||||||
echo "SSL Result: $SSLRESULT - SSL Ver: $SSLVER - Py Result: $PYRESULT - Py Ver: $PYVER"
|
echo "SSL Result: $SSLRESULT - SSL Ver: $SSLVER - Py Result: $PYRESULT - Py Ver: $PYVER"
|
||||||
if [ $SSLRESULT -ne 0 ]; then
|
if [ $SSLRESULT -ne 0 ]; then
|
||||||
echo "sslresult -ne 0"
|
echo "sslresult -ne 0"
|
||||||
@@ -35,6 +31,7 @@ else
|
|||||||
rm -rf python
|
rm -rf python
|
||||||
mkdir ssl
|
mkdir ssl
|
||||||
mkdir python
|
mkdir python
|
||||||
|
if [[ "${GOAL}" == "build" ]]; then
|
||||||
echo "RUNNING: apt upgrade..."
|
echo "RUNNING: apt upgrade..."
|
||||||
sudo apt-mark hold openssh-server
|
sudo apt-mark hold openssh-server
|
||||||
sudo apt-get --yes upgrade
|
sudo apt-get --yes upgrade
|
||||||
@@ -48,9 +45,10 @@ else
|
|||||||
sudo cp -v /tmp/sources.list /etc/apt
|
sudo cp -v /tmp/sources.list /etc/apt
|
||||||
sudo apt-get -qq --yes update > /dev/null
|
sudo apt-get -qq --yes update > /dev/null
|
||||||
sudo apt-get -qq --yes build-dep python3 > /dev/null
|
sudo apt-get -qq --yes build-dep python3 > /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
# Compile latest OpenSSL
|
# Compile latest OpenSSL
|
||||||
wget --quiet https://www.openssl.org/source/openssl-$BUILD_OPENSSL_VERSION.tar.gz
|
curl -O "https://www.openssl.org/source/openssl-${BUILD_OPENSSL_VERSION}.tar.gz"
|
||||||
echo "Extracting OpenSSL..."
|
echo "Extracting OpenSSL..."
|
||||||
tar xf openssl-$BUILD_OPENSSL_VERSION.tar.gz
|
tar xf openssl-$BUILD_OPENSSL_VERSION.tar.gz
|
||||||
cd openssl-$BUILD_OPENSSL_VERSION
|
cd openssl-$BUILD_OPENSSL_VERSION
|
||||||
@@ -64,40 +62,26 @@ else
|
|||||||
|
|
||||||
# Compile latest Python
|
# Compile latest Python
|
||||||
echo "Downloading Python $BUILD_PYTHON_VERSION..."
|
echo "Downloading Python $BUILD_PYTHON_VERSION..."
|
||||||
curl -O https://www.python.org/ftp/python/$BUILD_PYTHON_VERSION/Python-$BUILD_PYTHON_VERSION.tar.xz
|
curl -O "https://www.python.org/ftp/python/${BUILD_PYTHON_VERSION}/Python-${BUILD_PYTHON_VERSION}.tar.xz"
|
||||||
echo "Extracting Python..."
|
echo "Extracting Python..."
|
||||||
tar xf Python-$BUILD_PYTHON_VERSION.tar.xz
|
tar xf "Python-${BUILD_PYTHON_VERSION}.tar.xz"
|
||||||
cd Python-$BUILD_PYTHON_VERSION
|
cd Python-$BUILD_PYTHON_VERSION
|
||||||
echo "Compiling Python $BUILD_PYTHON_VERSION..."
|
echo "Compiling Python $BUILD_PYTHON_VERSION..."
|
||||||
safe_flags="--with-openssl=$HOME/ssl --enable-shared --prefix=$HOME/python --with-ensurepip=upgrade"
|
safe_flags="--with-openssl=$HOME/ssl --enable-shared --prefix=$HOME/python --with-ensurepip=upgrade"
|
||||||
unsafe_flags="--enable-optimizations --with-lto --with-openssl=~/ssl --with-openssl-rpath=~~/ssl/lib"
|
unsafe_flags="--enable-optimizations --with-lto --with-openssl=~/ssl --with-openssl-rpath=~~/ssl/lib"
|
||||||
if [ ! -e Makefile ]; then
|
|
||||||
echo "running configure with safe and unsafe"
|
|
||||||
./configure $safe_flags $unsafe_flags > /dev/null
|
./configure $safe_flags $unsafe_flags > /dev/null
|
||||||
fi
|
|
||||||
#make -j$cpucount PROFILE_TASK="-m test.regrtest --pgo -j$(( $cpucount * 2 ))" -s
|
|
||||||
make -j$cpucount -s
|
make -j$cpucount -s
|
||||||
RESULT=$?
|
|
||||||
echo "First make exited with $RESULT"
|
|
||||||
if [ $RESULT != 0 ]; then
|
|
||||||
echo "Trying Python compile again without unsafe flags..."
|
|
||||||
make clean
|
|
||||||
./configure $safe_flags > /dev/null
|
|
||||||
make -j$cpucount -s
|
|
||||||
echo "Sticking with safe Python for now..."
|
|
||||||
fi
|
|
||||||
echo "Installing Python..."
|
echo "Installing Python..."
|
||||||
make install > /dev/null
|
make install > /dev/null
|
||||||
cd ~
|
cd ~
|
||||||
fi
|
fi
|
||||||
|
|
||||||
python=~/python/bin/python3
|
python=~/python/bin/python3
|
||||||
pip=~/python/bin/pip3
|
pip=~/python/bin/pip3
|
||||||
|
|
||||||
if ([ "${ImageOS}" == "ubuntu20" ]) && [ "${HOSTTYPE}" == "x86_64" ]; then
|
if ([ "${ImageOS}" == "ubuntu20" ]) && [ "${HOSTTYPE}" == "x86_64" ]; then
|
||||||
"${python}" -m pip install --upgrade patchelf-wrapper
|
"${python}" -m pip install --upgrade patchelf-wrapper
|
||||||
"${python}" -m pip install --upgrade staticx
|
"${python}" -m pip install --upgrade staticx
|
||||||
fi
|
|
||||||
|
|
||||||
cd $whereibelong
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cd $whereibelong
|
||||||
|
|||||||
Reference in New Issue
Block a user