add another py3k patch so that we compile correctly under python 3
* fixes a couple of print syntax and a try, except syntax
This commit is contained in:
parent
deb2673e8d
commit
a85d01d453
60
pygobject2-py3k-dist.patch
Normal file
60
pygobject2-py3k-dist.patch
Normal file
@ -0,0 +1,60 @@
|
||||
diff --git a/dsextras.py b/dsextras.py
|
||||
index 10973e2..db771f2 100644
|
||||
--- a/dsextras.py
|
||||
+++ b/dsextras.py
|
||||
@@ -122,8 +122,8 @@ class BuildExt(build_ext):
|
||||
msnative_struct = { '2' : '-fnative-struct',
|
||||
'3' : '-mms-bitfields' }
|
||||
gcc_version = getoutput('gcc -dumpversion')
|
||||
- print 'using MinGW GCC version %s with %s option' % \
|
||||
- (gcc_version, msnative_struct[gcc_version[0]])
|
||||
+ print ('using MinGW GCC version %s with %s option' % \
|
||||
+ (gcc_version, msnative_struct[gcc_version[0]]))
|
||||
self.extra_compile_args.append(msnative_struct[gcc_version[0]])
|
||||
|
||||
def modify_compiler(self):
|
||||
@@ -312,9 +312,9 @@ class PkgConfigExtension(Extension):
|
||||
self.can_build_ok = 1
|
||||
return 1
|
||||
else:
|
||||
- print "Warning: Too old version of %s" % self.pkc_name
|
||||
- print " Need %s, but %s is installed" % \
|
||||
- (version, orig_version)
|
||||
+ print ("Warning: Too old version of %s" % self.pkc_name)
|
||||
+ print (" Need %s, but %s is installed" % \
|
||||
+ (version, orig_version))
|
||||
self.can_build_ok = 0
|
||||
return 0
|
||||
|
||||
@@ -343,7 +343,8 @@ try:
|
||||
from codegen.codegen import register_types, SourceWriter, \
|
||||
FileOutput
|
||||
import codegen.createdefs
|
||||
-except ImportError, e:
|
||||
+except ImportError:
|
||||
+ (etype, e) = sys.exc_info()[:2]
|
||||
template_classes_enabled=False
|
||||
|
||||
class Template(object):
|
||||
diff --git a/m4/python.m4 b/m4/python.m4
|
||||
index bdc8ee6..372627b 100644
|
||||
--- a/m4/python.m4
|
||||
+++ b/m4/python.m4
|
||||
@@ -196,7 +196,7 @@ python2.1 python2.0])
|
||||
dnl doesn't work.
|
||||
AC_CACHE_CHECK([for $am_display_PYTHON script directory],
|
||||
[am_cv_python_pythondir],
|
||||
- [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null ||
|
||||
+ [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX'))" 2>/dev/null ||
|
||||
echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`])
|
||||
AC_SUBST([pythondir], [$am_cv_python_pythondir])
|
||||
|
||||
@@ -213,7 +213,7 @@ python2.1 python2.0])
|
||||
dnl doesn't work.
|
||||
AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
|
||||
[am_cv_python_pyexecdir],
|
||||
- [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null ||
|
||||
+ [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX'))" 2>/dev/null ||
|
||||
echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`])
|
||||
AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
Name: pygobject2
|
||||
Version: 2.26.0
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
License: LGPLv2+
|
||||
Group: Development/Languages
|
||||
Summary: Python 2 bindings for GObject
|
||||
@ -21,7 +21,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||||
#VCS: git:git://git.gnome.org/pygobject
|
||||
Source: http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.21/pygobject-%{version}.tar.bz2
|
||||
Patch1: pygobject-py3m4.patch
|
||||
|
||||
Patch2: pygobject-py3k-dist.patch
|
||||
### Build Dependencies ###
|
||||
|
||||
BuildRequires: glib2-devel >= %{glib2_version}
|
||||
@ -92,6 +92,7 @@ for use in Python 3 programs.
|
||||
%prep
|
||||
%setup -q -n pygobject-%{version}
|
||||
%patch1 -p1 -b .pygobject-py3m4
|
||||
%patch2 -p1 -b .pygobject-py3k-dist
|
||||
|
||||
%if 0%{?with_python3}
|
||||
rm -rf %{py3dir}
|
||||
@ -177,6 +178,10 @@ rm examples/Makefile*
|
||||
%endif # with_python3
|
||||
|
||||
%changelog
|
||||
* Tue Sep 28 2010 John (J5) Palmieri <johnp@redhat.com> - 2.26.0-2
|
||||
- add another py3k patch so that we compile correctly under python 3
|
||||
- fixes a couple of print syntax and a try, except syntax
|
||||
|
||||
* Tue Sep 28 2010 John (J5) Palmieri <johnp@redhat.com> - 2.26.0-1
|
||||
- Update to upstream 2.26.0
|
||||
- package python3-gobject module
|
||||
|
||||
Loading…
Reference in New Issue
Block a user