Browse Source

windows build: minor clean-up

patch-4
SomberNight 4 years ago
parent
commit
41233a4bc7
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 18
      contrib/build-wine/build-electrum-git.sh
  2. 5
      contrib/build-wine/build.sh
  3. 2
      contrib/build-wine/deterministic.spec
  4. 14
      contrib/build-wine/prepare-wine.sh

18
contrib/build-wine/build-electrum-git.sh

@ -2,20 +2,12 @@
NAME_ROOT=electrum
# These settings probably don't need any change
export WINEPREFIX=/opt/wine64
export WINEDEBUG=-all
export PYTHONDONTWRITEBYTECODE=1
PYHOME="c:/python3"
PYTHON="wine $PYHOME/python.exe -OO -B"
# Let's begin!
set -e
here="$(dirname "$(readlink -e "$0")")"
. "$CONTRIB"/build_tools_util.sh
pushd $WINEPREFIX/drive_c/electrum
@ -42,19 +34,19 @@ popd
# Install frozen dependencies
$PYTHON -m pip install --no-dependencies --no-warn-script-location \
$WINE_PYTHON -m pip install --no-dependencies --no-warn-script-location \
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements.txt
$PYTHON -m pip install --no-dependencies --no-warn-script-location \
$WINE_PYTHON -m pip install --no-dependencies --no-warn-script-location \
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-binaries.txt
$PYTHON -m pip install --no-dependencies --no-warn-script-location \
$WINE_PYTHON -m pip install --no-dependencies --no-warn-script-location \
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-hw.txt
pushd $WINEPREFIX/drive_c/electrum
# see https://github.com/pypa/pip/issues/2195 -- pip makes a copy of the entire directory
info "Pip installing Electrum. This might take a long time if the project folder is large."
$PYTHON -m pip install --no-dependencies --no-warn-script-location .
$WINE_PYTHON -m pip install --no-dependencies --no-warn-script-location .
popd
@ -62,7 +54,7 @@ rm -rf dist/
# build standalone and portable versions
info "Running pyinstaller..."
wine "$PYHOME/scripts/pyinstaller.exe" --noconfirm --ascii --clean --name $NAME_ROOT-$VERSION -w deterministic.spec
wine "$WINE_PYHOME/scripts/pyinstaller.exe" --noconfirm --ascii --clean --name $NAME_ROOT-$VERSION -w deterministic.spec
# set timestamps in dist, in order to make the installer reproducible
pushd dist

5
contrib/build-wine/build.sh

@ -28,6 +28,11 @@ export PIP_CACHE_DIR="$CACHEDIR/wine_pip_cache"
export WINE_PIP_CACHE_DIR="c:/electrum/contrib/build-wine/.cache/$WIN_ARCH/wine_pip_cache"
export DLL_TARGET_DIR="$CACHEDIR/dlls"
export WINEPREFIX="/opt/wine64"
export WINEDEBUG=-all
export WINE_PYHOME="c:/python3"
export WINE_PYTHON="wine $WINE_PYHOME/python.exe -OO -B"
. "$CONTRIB"/build_tools_util.sh
info "Clearing $here/build and $here/dist..."

2
contrib/build-wine/deterministic.spec

@ -10,8 +10,6 @@ for i, x in enumerate(sys.argv):
else:
raise Exception('no name')
PYHOME = 'c:/python3'
home = 'C:\\electrum\\'
# see https://github.com/pyinstaller/pyinstaller/issues/2005

14
contrib/build-wine/prepare-wine.sh

@ -15,14 +15,6 @@ PYINSTALLER_COMMIT="80ee4d613ecf75a1226b960a560ee01459e65ddb"
PYTHON_VERSION=3.8.7
## These settings probably don't need change
export WINEPREFIX=/opt/wine64
export WINEDEBUG=-all
PYTHON_FOLDER="python3"
PYHOME="c:/$PYTHON_FOLDER"
PYTHON="wine $PYHOME/python.exe -OO -B"
# Let's begin!
set -e
@ -57,13 +49,13 @@ for msifile in core dev exe lib pip tools; do
download_if_not_exist "$PYTHON_DOWNLOADS/${msifile}.msi" "https://www.python.org/ftp/python/$PYTHON_VERSION/$PYARCH/${msifile}.msi"
download_if_not_exist "$PYTHON_DOWNLOADS/${msifile}.msi.asc" "https://www.python.org/ftp/python/$PYTHON_VERSION/$PYARCH/${msifile}.msi.asc"
verify_signature "$PYTHON_DOWNLOADS/${msifile}.msi.asc" $KEYRING_PYTHON_DEV
wine msiexec /i "$PYTHON_DOWNLOADS/${msifile}.msi" /qb TARGETDIR=$PYHOME
wine msiexec /i "$PYTHON_DOWNLOADS/${msifile}.msi" /qb TARGETDIR=$WINE_PYHOME
done
break_legacy_easy_install
info "Installing build dependencies."
$PYTHON -m pip install --no-dependencies --no-warn-script-location \
$WINE_PYTHON -m pip install --no-dependencies --no-warn-script-location \
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-build-wine.txt
info "Installing NSIS."
@ -143,6 +135,6 @@ info "Building PyInstaller."
fi
) || fail "PyInstaller build failed"
info "Installing PyInstaller."
$PYTHON -m pip install --no-dependencies --no-warn-script-location ./pyinstaller
$WINE_PYTHON -m pip install --no-dependencies --no-warn-script-location ./pyinstaller
info "Wine is configured."

Loading…
Cancel
Save