Skip to content

Commit

Permalink
Update PyQt example with download script
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Apr 9, 2015
1 parent f51153c commit 7f0a7a5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
12 changes: 5 additions & 7 deletions examples/pyqt/README
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
This is an example that uses binary packages.
This is an example that uses PyQt4 binary packages.

To make the installer on a non-Windows system, download the PyQt4 installer from here:
http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.10.4/PyQt4-4.10.4-gpl-Py3.3-Qt4.8.5-x32.exe

Open it up with an archive tool, and extract the PyQt4 folder and sip.pyd from
Lib/site-packages. Place them in a folder called pynsist_pkgs, and pynsist will
use them in preference to the files it finds on your system.
To make the installer on a non-Windows system, first run fetch_pyqt_windows.sh.
This will download a PyQt Windows installer from Sourceforge, unpack the files
from it, and copy the necessary ones into pynsist_pkgs where pynsist will
pick them up.
31 changes: 31 additions & 0 deletions examples/pyqt/fetch_pyqt_windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Download and the PyQt4 Windows installer and unpack files from it into
# pynsist_pkgs

set -e

PY_VERSION=3.4
PYQT_VERSION=4.11.3
QT_VERSION=4.8.6
BITNESS=32

INSTALLER_FILE=PyQt4-${PYQT_VERSION}-gpl-Py${PY_VERSION}-Qt${QT_VERSION}-x${BITNESS}.exe
URL=http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-${PYQT_VERSION}/${INSTALLER_FILE}
#wget -O "$INSTALLER_FILE" "$URL"

rm -rf pyqt4-windows
mkdir pyqt4-windows
7z x -opyqt4-windows "$INSTALLER_FILE"

rm -rf pynsist_pkgs
mkdir pynsist_pkgs

echo "Rearranging files into pynsist_pkgs..."
mv 'pyqt4-windows/Lib/site-packages'/* pynsist_pkgs/
rm pynsist_pkgs/PyQt4/assistant.exe pynsist_pkgs/PyQt4/designer.exe
mv 'pyqt4-windows/$_OUTDIR/'*.pyd pynsist_pkgs/PyQt4/
# These may not be necessary:
mv 'pyqt4-windows/$_OUTDIR/qsci/' 'pyqt4-windows/$_OUTDIR/sip/' pynsist_pkgs/PyQt4/

rm -r pyqt4-windows
echo "Done"

0 comments on commit 7f0a7a5

Please sign in to comment.