diff --git a/Taskfile.yml b/Taskfile.yml index 310883dc..51baad76 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -8,7 +8,7 @@ vars: LEGACY_ELECTRON_VERSION: sh: echo "${LEGACY_ELECTRON_VERSION:-30.0.8}" WINE_PYTHON: - sh: echo "${WINE_PYTHON:-wine python}" + sh: echo "${WINE_PYTHON:-wine C:/Python314/python.exe}" DOCKER_COMPOSE_CMD: sh: echo "${DOCKER_COMPOSE_CMD:-docker compose}" DOCKER_COMPOSE_FILE: diff --git a/scripts/setup_wine_env.sh b/scripts/setup_wine_env.sh index 8ce1e103..35b7b5ee 100755 --- a/scripts/setup_wine_env.sh +++ b/scripts/setup_wine_env.sh @@ -8,7 +8,8 @@ export WINEDEBUG=-all export WINEARCH=win64 export WINEPREFIX=${WINEPREFIX:-$HOME/.wine} -PYTHON_VERSION="3.13.1" +# Latest Python 3.14.x Windows 64-bit installer (see https://www.python.org/downloads/release/python-3144/) +PYTHON_VERSION="3.14.4" PYTHON_EXE="python-${PYTHON_VERSION}-amd64.exe" PYTHON_URL="https://www.python.org/ftp/python/${PYTHON_VERSION}/${PYTHON_EXE}" @@ -16,6 +17,14 @@ GIT_VERSION="2.52.0" GIT_EXE="Git-${GIT_VERSION}-64-bit.exe" GIT_URL="https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/${GIT_EXE}" +wine_wrap() { + if command -v xvfb-run >/dev/null 2>&1; then + WINEDEBUG=-all xvfb-run -a "$@" + else + WINEDEBUG=-all "$@" + fi +} + echo "Downloading Windows Python and Git..." wget -q "$PYTHON_URL" wget -q "$GIT_URL" @@ -23,19 +32,19 @@ wget -q "$GIT_URL" chmod +x *.exe echo "Initializing Wine prefix in $WINEPREFIX..." -xvfb-run wine wineboot --init +wine_wrap wine wineboot --init echo "Installing Python $PYTHON_VERSION into Wine..." -xvfb-run wine "./$PYTHON_EXE" /quiet InstallAllUsers=1 TargetDir=C:\\Python313 PrependPath=1 +wine_wrap wine "./$PYTHON_EXE" /quiet InstallAllUsers=1 TargetDir=C:\\Python314 PrependPath=1 echo "Installing Git into Wine..." -xvfb-run wine "./$GIT_EXE" /VERYSILENT /NORESTART +wine_wrap wine "./$GIT_EXE" /VERYSILENT /NORESTART echo "Installing build dependencies in Wine Python..." -xvfb-run wine C:/Python313/python.exe -m pip install --upgrade pip -xvfb-run wine C:/Python313/python.exe -m pip install cx_Freeze poetry +wine_wrap wine C:/Python314/python.exe -m pip install --upgrade pip +wine_wrap wine C:/Python314/python.exe -m pip install cx_Freeze poetry if [ -f "requirements.txt" ]; then - xvfb-run wine C:/Python313/python.exe -m pip install -r requirements.txt + wine_wrap wine C:/Python314/python.exe -m pip install -r requirements.txt fi # Clean up installers