1
0
Эх сурвалжийг харах

Update PyQt example with download script

Thomas Kluyver 10 жил өмнө
parent
commit
7f0a7a5ca2

+ 5 - 7
examples/pyqt/README

@@ -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 - 0
examples/pyqt/fetch_pyqt_windows.sh

@@ -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"