#!/bin/sh unset WINEARCH WINEPREFIX set -e SELF=`readlink -f $0` CWD=`dirname $0` SOURCES=`readlink -f $CWD/../../` PYTHON64="https://www.python.org/ftp/python/2.7.12/python-2.7.12.amd64.msi" PYTHON32="https://www.python.org/ftp/python/2.7.12/python-2.7.12.msi" PYTHONVC="https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi" PYCRYPTO32="http://www.voidspace.org.uk/downloads/pycrypto26/pycrypto-2.6.win32-py2.7.exe" PYCRYPTO64="http://www.voidspace.org.uk/downloads/pycrypto26/pycrypto-2.6.win-amd64-py2.7.exe" PACKAGES="rpyc psutil pyaml rsa pefile image rsa netaddr pypiwin32" BUILDENV=${1:-`pwd`/buildenv} if [ -f $BUILDENV/.ready ]; then echo "Buildenv at $BUILDENV already prepared" exit 0 fi WINE=${WINE:-wine} WINE32="$BUILDENV/win32" WINE64="$BUILDENV/win64" DOWNLOADS="$BUILDENV/downloads" mkdir -p "$BUILDENV" mkdir -p "$DOWNLOADS" WINEARCH=win32 WINEPREFIX=$WINE32 wineboot if [ ! $? -eq 0 ]; then echo "apt-get install wine32" exit 1 fi WINEARCH=win64 WINEPREFIX=$WINE64 wineboot if [ ! $? -eq 0 ]; then echo "apt-get install wine64" exit 1 fi for dist in $PYTHON32 $PYTHON64 $PYTHONVC $WINETRICKS; do wget -cP $DOWNLOADS $dist done for prefix in $WINE32 $WINE64; do rm -f $prefix/dosdevices/d: rm -f $prefix/dosdevices/e: ln -s ../../downloads $prefix/dosdevices/d: ln -s $SOURCES $prefix/dosdevices/e: done for prefix in $WINE32 $WINE64; do [ ! -f $prefix/drive_c/.vc ] && \ WINEPREFIX=$prefix msiexec /i D:\\VCForPython27.msi /q && \ touch $prefix/drive_c/.vc done [ ! -f $WINE32/drive_c/.python ] && \ WINEPREFIX=$WINE32 msiexec /i D:\\python-2.7.12.msi /q && \ touch $WINE32/drive_c/.python [ ! -f $WINE64/drive_c/.python ] && \ WINEPREFIX=$WINE64 msiexec /i D:\\python-2.7.12.amd64.msi /q && \ touch $WINE64/drive_c/.python for prefix in $WINE32 $WINE64; do WINEPREFIX=$prefix wine python -m pip install --upgrade pip WINEPREFIX=$prefix wine pip install --upgrade $PACKAGES done WINEPREFIX=$WINE32 wine easy_install -Z $PYCRYPTO32 WINEPREFIX=$WINE64 wine easy_install -Z $PYCRYPTO64 cat >$WINE32/python.sh <$WINE32/cl.sh <$WINE64/python.sh <$WINE64/cl.sh <