public
Last active

Script for building the Py{GObject,GTK} installers using MinGW

  • Download Gist
build-pygtk-windows-installers.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#!/bin/sh
# Script for building the Py{GObject,GTK} installers using MinGW
# via wine on ubuntu 10.04
 
#Install the deps, MinGW and MSYS. GCC 4.5.0
#wine mingw-get.exe install gcc
#wine mingw-get.exe install msys-base
 
PYVERSIONS="6 7"
BDIST_TARGETS="wininst msi"
 
PYGOBJECT_VERSION=2.26.0
PYGTK_VERSION=2.22.0
 
rm -rf {pygobject.git,pycairo-1.8.10,pygtk.git}/dist/
 
for pyver in $PYVERSIONS; do
for bdist in $BDIST_TARGETS; do
if [ ${bdist} = "wininst" ] ; then
build_opt=--user-access-control=auto
else
build_opt=
fi
 
echo "============== Python2.${pyver} bdist_${bdist}"
#PyGObject
cd pygobject.git && rm -rf build/
cat .git/HEAD | grep -q windows || exit 1
wine C:\\Python2${pyver}\\python.exe setup.py build --compiler=mingw32 --enable-threading --yes-i-know-its-not-supported bdist_${bdist} ${build_opt}
test ${bdist} = "wininst" && wine dist/pygobject-$PYGOBJECT_VERSION.win32-py2.${pyver}.exe
cd ../
 
#PyCairo
cd pycairo-1.8.10 && rm -rf build/
patch -N -i fix-install-path.patch
wine C:\\Python2${pyver}\\python.exe setup.py build --compiler=mingw32 bdist_${bdist} ${build_opt}
test ${bdist} = "wininst" && wine dist/pycairo-1.8.10.win32-py2.${pyver}.exe
cd ../
 
#PyGTK
cd pygtk.git && rm -rf build/
cat .git/HEAD | grep -q windows || exit 1
PKG_CONFIG_PATH=C:/Python2${pyver}/Lib/pkgconfig/ wine C:\\Python2${pyver}\\python.exe setup.py build --compiler=mingw32 --enable-threading --yes-i-know-its-not-supported bdist_${bdist} ${build_opt}
test ${bdist} = "wininst" && wine dist/pygtk-$PYGTK_VERSION.win32-py2.${pyver}.exe
wine C:\\Python2${pyver}\\python.exe examples/pygtk-demo/pygtk-demo.py
cd ../
done
done
fix-install-path.patch
Diff
1 2 3 4 5 6 7 8 9 10 11
--- setup.py.orig 2010-10-16 18:00:18.000000000 +1300
+++ setup.py 2010-10-16 17:59:40.000000000 +1300
@@ -110,7 +110,7 @@
data_files = [
('include/pycairo', ['src/pycairo.h']),
('lib/pkgconfig', [pkgconfig_file]),
- (os.path.join(dsy.get_python_lib(), 'cairo'),
+ ('lib/site-packages/cairo',
['src/__init__.py']),
],
)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.