diff --git a/.travis.yml b/.travis.yml index 8e52e567..71b751f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -167,10 +167,10 @@ jobs: - VMTYPE=build before_install: -- source src/travis/$TRAVIS_OS_NAME-$PLATFORM-before-install.sh +- source src/travis/$TRAVIS_OS_NAME-before-install.sh install: -- source src/travis/$TRAVIS_OS_NAME-$PLATFORM-install.sh +- source src/travis/$TRAVIS_OS_NAME-install.sh script: # Discover and run all Python unit tests. Buffer output so that it's not sent to the build log. diff --git a/src/travis/linux-arm64-before-install.sh b/src/travis/linux-arm64-before-install.sh deleted file mode 100755 index 62afcc86..00000000 --- a/src/travis/linux-arm64-before-install.sh +++ /dev/null @@ -1,75 +0,0 @@ -export whereibelong=$(pwd) -export dist=$(lsb_release --codename --short) -echo "We are running on Ubuntu $dist" -export LD_LIBRARY_PATH=~/ssl/lib:~/python/lib -cpucount=$(nproc --all) -echo "This device has $cpucount CPUs for compiling..." -echo -e "nameserver 8.8.8.8\nnameserver 8.8.4.4" > /tmp/resolv.conf -sudo cp /tmp/resolv.conf /etc -sudo apt-get -qq --yes update > /dev/null -sudo apt-get -qq --yes install xz-utils > /dev/null -SSLVER=$(~/ssl/bin/openssl version) -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 "RUNNING: apt dist-upgrade..." - sudo apt-get -qq --yes dist-upgrade > /dev/null - echo "Installing build tools..." - sudo apt-get -qq --yes install build-essential - - echo "Installing deps for python3" - sudo cp -v /etc/apt/sources.list /tmp - sudo chmod a+rwx /tmp/sources.list - echo "deb-src http://archive.ubuntu.com/ubuntu/ $dist main" >> /tmp/sources.list - sudo cp -v /tmp/sources.list /etc/apt - sudo apt-get -qq --yes update > /dev/null - sudo apt-get -qq --yes build-dep python3 > /dev/null - sudo apt-get -qq --yes install zlib1g-dev > /dev/null - sudo apt-get -qq --yes install libffi-dev > /dev/null - - # Compile latest OpenSSL - echo "Downloading OpenSSL..." - wget --quiet https://www.openssl.org/source/openssl-$BUILD_OPENSSL_VERSION.tar.gz - echo "Extracting OpenSSL..." - tar xf openssl-$BUILD_OPENSSL_VERSION.tar.gz - cd openssl-$BUILD_OPENSSL_VERSION - echo "Compiling OpenSSL $BUILD_OPENSSL_VERSION..." - ./config shared --prefix=$HOME/ssl - echo "Running make for OpenSSL..." - make -j$cpucount -s - echo "Running make install for OpenSSL..." - make install > /dev/null - cd ~ - - # Compile latest Python - echo "Downloading Python $BUILD_PYTHON_VERSION..." - curl -O https://www.python.org/ftp/python/$BUILD_PYTHON_VERSION/Python-$BUILD_PYTHON_VERSION.tar.xz - echo "Extracting Python..." - tar xf Python-$BUILD_PYTHON_VERSION.tar.xz - cd Python-$BUILD_PYTHON_VERSION - echo "Compiling Python $BUILD_PYTHON_VERSION..." - safe_flags="--with-openssl=$HOME/ssl --enable-shared --prefix=$HOME/python --with-ensurepip=upgrade" - unsafe_flags="--enable-optimizations --with-lto" - echo "running configure with safe and unsafe" - ./configure $safe_flags $unsafe_flags > /dev/null - make -j$cpucount PROFILE_TASK="-m test.regrtest --pgo -j$(( $cpucount * 2 ))" -s - echo "Installing Python..." - make install > /dev/null -fi - -python=~/python/bin/python3 -pip=~/python/bin/pip3 - -$python -V - -cd $whereibelong - -echo "Upgrading pip packages..." -$pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 $pip install -U -$pip install --upgrade -r src/requirements.txt -$pip install --upgrade https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz - -mkdir ~/.ruby -export GEM_HOME=~/.ruby -export PATH=$PATH:~/.ruby/bin diff --git a/src/travis/linux-arm64-install.sh b/src/travis/linux-arm64-install.sh deleted file mode 100755 index d8c0c1a9..00000000 --- a/src/travis/linux-arm64-install.sh +++ /dev/null @@ -1,33 +0,0 @@ -cd src -if [ "$VMTYPE" == "test" ]; then - export gam="$python gam.py" - export gampath=$(readlink -e .) -else - $python -OO -m PyInstaller --clean --noupx --strip -F --distpath=gam $GAMOS-gam.spec - export gam="gam/gam" - export gampath=$(readlink -e gam) - export GAMVERSION=`$gam version simple` - cp LICENSE $gampath - cp whatsnew.txt $gampath - cp GamCommands.txt $gampath - this_glibc_ver=$(ldd --version | awk '/ldd/{print $NF}') - GAM_ARCHIVE=gam-$GAMVERSION-$GAMOS-$PLATFORM-glibc$this_glibc_ver.tar.xz - rm $gampath/lastupdatecheck.txt - tar cfJ $GAM_ARCHIVE gam/ - echo "PyInstaller GAM info:" - du -h gam/gam - time $gam version extended - - if [[ "$dist" == "precise" ]]; then - GAM_LEGACY_ARCHIVE=gam-$GAMVERSION-$GAMOS-$PLATFORM-legacy.tar.xz - $python -OO -m staticx gam/gam gam/gam-staticx - strip gam/gam-staticx - rm gam/gam - mv gam/gam-staticx gam/gam - tar cfJ $GAM_LEGACY_ARCHIVE gam/ - echo "Legacy StaticX GAM info:" - du -h gam/gam - time $gam version extended - fi - -fi diff --git a/src/travis/linux-x86_64-before-install.sh b/src/travis/linux-before-install.sh similarity index 98% rename from src/travis/linux-x86_64-before-install.sh rename to src/travis/linux-before-install.sh index 0f336f83..d3f3e204 100755 --- a/src/travis/linux-x86_64-before-install.sh +++ b/src/travis/linux-before-install.sh @@ -6,7 +6,7 @@ if [ "$VMTYPE" == "test" ]; then else export whereibelong=$(pwd) export dist=$(lsb_release --codename --short) - echo "We are running on Ubuntu $dist" + echo "We are running on Ubuntu $dist $PLATFORM" export LD_LIBRARY_PATH=~/ssl/lib:~/python/lib cpucount=$(nproc --all) echo "This device has $cpucount CPUs for compiling..." diff --git a/src/travis/linux-x86_64-install.sh b/src/travis/linux-install.sh similarity index 100% rename from src/travis/linux-x86_64-install.sh rename to src/travis/linux-install.sh diff --git a/src/travis/osx-x86_64-before-install.sh b/src/travis/osx-before-install.sh similarity index 100% rename from src/travis/osx-x86_64-before-install.sh rename to src/travis/osx-before-install.sh diff --git a/src/travis/osx-x86_64-install.sh b/src/travis/osx-install.sh similarity index 100% rename from src/travis/osx-x86_64-install.sh rename to src/travis/osx-install.sh diff --git a/src/travis/windows-x86_64-before-install.sh b/src/travis/windows-before-install.sh similarity index 66% rename from src/travis/windows-x86_64-before-install.sh rename to src/travis/windows-before-install.sh index 54a3498e..ab51cf96 100755 --- a/src/travis/windows-x86_64-before-install.sh +++ b/src/travis/windows-before-install.sh @@ -1,3 +1,13 @@ +if [[ "$PLATFORM" == "x86_64" ]]; then + export BITS="64" + export PYTHONFILE_BITS="-amd64" + export WIX_BITS="x64" +elif [[ "$PLATFORM" == "x86" ]]; then + export BITS="32" + export PYTHONFILE_BITS="" + export WIX_BITS="x86" +fi +echo "This is a ${BITS}-bit build for ${PLATFORM}" echo "Installing Net-Framework-Core..." export mypath=$(pwd) @@ -5,21 +15,23 @@ choco install vcbuildtools until powershell Install-WindowsFeature Net-Framework-Core; do echo "trying again..."; done cd ~ -export exefile=Win64OpenSSL_Light-${BUILD_OPENSSL_VERSION//./_}.exe +export exefile=Win${BITS}OpenSSL_Light-${BUILD_OPENSSL_VERSION//./_}.exe if [ ! -e $exefile ]; then echo "Downloading $exefile..." wget --quiet https://slproweb.com/download/$exefile fi echo "Installing $exefile..." powershell ".\\${exefile} /silent /sp- /suppressmsgboxes /DIR=C:\\ssl" -export python_file=python-$BUILD_PYTHON_VERSION-amd64.exe +export python_file=python-${BUILD_PYTHON_VERSION}${PYTHONFILE_BITS}.exe wget --quiet https://www.python.org/ftp/python/$BUILD_PYTHON_VERSION/$python_file powershell ".\\${python_file} /quiet InstallAllUsers=1 TargetDir=c:\\python" -until cinst -y wixtoolset; do echo "trying again..."; done +until cinst -y wixtoolset; do echo "trying wix install again..."; done until cp -v /c/ssl/libcrypto-1_1-x64.dll /c/python/DLLs/; do echo "trying libcrypto copy again..."; done -cp -v /c/python/DLLs/libcrypto-1_1-x64.dll /c/python/DLLs/libcrypto-1_1.dll until cp -v /c/ssl/libssl-1_1-x64.dll /c/python/DLLs/; do echo "trying libssl copy again..."; done -cp -v /c/python/DLLs/libssl-1_1-x64.dll /c/python/DLLs/libssl-1_1.dll +if [[ "$PLATFORM" == "x86_64" ]]; then + cp -v /c/python/DLLs/libssl-1_1-x64.dll /c/python/DLLs/libssl-1_1.dll + cp -v /c/python/DLLs/libcrypto-1_1-x64.dll /c/python/DLLs/libcrypto-1_1.dll +fi export PATH=$PATH:/c/python/scripts cd $mypath export python=/c/python/python.exe @@ -40,12 +52,12 @@ wget --quiet https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz tar xf develop.tar.gz cd pyinstaller-develop/bootloader echo "bootloader before:" -md5sum ../PyInstaller/bootloader/Windows-64bit/* +md5sum ../PyInstaller/bootloader/Windows-${BITS}bit/* -$python ./waf all --target-arch=64bit --msvc_version "msvc 14.0" +$python ./waf all --target-arch=${BITS}bit --msvc_version "msvc 14.0" echo "bootloader after:" -md5sum ../PyInstaller/bootloader/Windows-64bit/* +md5sum ../PyInstaller/bootloader/Windows-${BITS}bit/* echo "PATH: $PATH" cd .. $python setup.py install diff --git a/src/travis/windows-x86_64-install.sh b/src/travis/windows-install.sh similarity index 97% rename from src/travis/windows-x86_64-install.sh rename to src/travis/windows-install.sh index ea82bca6..14c6b37c 100755 --- a/src/travis/windows-x86_64-install.sh +++ b/src/travis/windows-install.sh @@ -15,6 +15,6 @@ GAM_ARCHIVE=gam-$GAMVERSION-$GAMOS-$PLATFORM.zip /c/Program\ Files/7-Zip/7z.exe a -tzip $GAM_ARCHIVE gam -xr!.svn mkdir gam-64 cp -rf gam/* gam-64/; -/c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/candle.exe -arch x64 gam.wxs +/c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/candle.exe -arch $WIX_BITS gam.wxs /c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/light.exe -ext /c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/WixUIExtension.dll gam.wixobj -o gam-$GAMVERSION-$GAMOS-$PLATFORM.msi || true; rm *.wixpdb diff --git a/src/travis/windows-x86-before-install.sh b/src/travis/windows-x86-before-install.sh deleted file mode 100755 index c6d04583..00000000 --- a/src/travis/windows-x86-before-install.sh +++ /dev/null @@ -1,49 +0,0 @@ -echo "Installing Net-Framework-Core..." -export mypath=$(pwd) - -choco install vcbuildtools - -until powershell Install-WindowsFeature Net-Framework-Core; do echo "trying again..."; done -cd ~ -export exefile=Win32OpenSSL_Light-${BUILD_OPENSSL_VERSION//./_}.exe -if [ ! -e $exefile ]; then - echo "Downloading $exefile..." - wget --quiet https://slproweb.com/download/$exefile -fi -echo "Installing $exefile..." -powershell ".\\${exefile} /silent /sp- /suppressmsgboxes /DIR=C:\\ssl" -export python_file=python-$BUILD_PYTHON_VERSION.exe -wget --quiet https://www.python.org/ftp/python/$BUILD_PYTHON_VERSION/$python_file -powershell ".\\${python_file} /quiet InstallAllUsers=1 TargetDir=c:\\python" -until cinst -y wixtoolset; do echo "trying again..."; done -until cp -v /c/ssl/libcrypto-1_1.dll /c/python/DLLs/libcrypto-1_1.dll; do echo "trying again..."; done -until cp -v /c/ssl/libssl-1_1.dll /c/python/DLLs/libssl-1_1.dll; do echo "trying again..."; done -export PATH=$PATH:/c/python/scripts -cd $mypath -export python=/c/python/python.exe -export pip=/c/python/scripts/pip.exe -until [ -f $python ]; do :; done -until [ -f $pip ]; do :; done - -$pip install --upgrade pip -$pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 $pip install -U -$pip install --upgrade -r src/requirements.txt -#$pip install --upgrade pyinstaller -# Install PyInstaller from source and build bootloader -# to try and avoid getting flagged as malware since -# lots of malware uses PyInstaller default bootloader -# https://stackoverflow.com/questions/53584395/how-to-recompile-the-bootloader-of-pyinstaller -echo "Downloading PyInstaller..." -wget --quiet https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz -tar xf develop.tar.gz -cd pyinstaller-develop/bootloader -echo "bootloader before:" -md5sum ../PyInstaller/bootloader/Windows-32bit/* -$python ./waf all --msvc_version "msvc 14.0" -echo "bootloader after:" -md5sum ../PyInstaller/bootloader/Windows-32bit/* -echo "PATH: $PATH" -cd .. -$python setup.py install -echo "cd to $mypath" -cd $mypath diff --git a/src/travis/windows-x86-install.sh b/src/travis/windows-x86-install.sh deleted file mode 100755 index 8c1d6949..00000000 --- a/src/travis/windows-x86-install.sh +++ /dev/null @@ -1,18 +0,0 @@ -cd src -pyinstaller --clean --noupx -F --distpath=gam $GAMOS-gam.spec -export gam="gam/gam" -export gampath=$(readlink -e gam) -$gam version extended -export GAMVERSION=`$gam version simple` -rm gam/lastupdatecheck.txt -cp LICENSE gam -cp GamCommands.txt gam -cp whatsnew.txt gam -cp gam-setup.bat gam -GAM_ARCHIVE=gam-$GAMVERSION-$GAMOS-$PLATFORM.zip -/c/Program\ Files/7-Zip/7z.exe a -tzip $GAM_ARCHIVE gam -xr!.svn -mkdir gam-64 -cp -rf gam/* gam-64/; -/c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/candle.exe -arch x86 gam.wxs -/c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/light.exe -ext /c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/WixUIExtension.dll gam.wixobj -o gam-$GAMVERSION-$GAMOS-$PLATFORM.msi || true; -rm *.wixpdb