From c572cc4dd4bb5cca1aba48d7315079fa0f2694de Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Feb 10 2011 20:47:04 +0000 Subject: Fix embedded copy of waf so that the package builds against python 3.2 (PEP-3149) --- diff --git a/pycairo-1.8.10-pypath.patch b/pycairo-1.8.10-pypath.patch new file mode 100644 index 0000000..07d4e1b --- /dev/null +++ b/pycairo-1.8.10-pypath.patch @@ -0,0 +1,36 @@ +diff -up wafadmin/Tools/python.py.pypath wafadmin/Tools/python.py +--- wafadmin/Tools/python.py.pypath 2011-02-10 15:30:44.118506004 -0500 ++++ wafadmin/Tools/python.py 2011-02-10 15:32:50.922506002 -0500 +@@ -156,6 +156,9 @@ MACOSX_DEPLOYMENT_TARGET = %r + env.append_value('LINKFLAGS_PYEMBED',python_LDFLAGS.split()) + result=False + name='python'+env['PYTHON_VERSION'] ++ python_config=conf.find_program('python%s-config'%('.'.join(env['PYTHON_VERSION'].split('.')[:2])),var='PYTHON_CONFIG') ++ if not python_config: ++ python_config=conf.find_program('python-config-%s'%('.'.join(env['PYTHON_VERSION'].split('.')[:2])),var='PYTHON_CONFIG') + if python_LIBDIR is not None: + path=[python_LIBDIR] + conf.log.write("\n\n# Trying LIBDIR: %r\n"%path) +@@ -169,6 +172,12 @@ MACOSX_DEPLOYMENT_TARGET = %r + path=[os.path.join(python_prefix,"libs")] + name='python'+env['PYTHON_VERSION'].replace('.','') + result=conf.check(lib=name,uselib='PYEMBED',libpath=path) ++ if not result and python_config: ++ conf.log.write("\n\n# try again with help of python-config\n") ++ for libstr in Utils.cmd_output("%s %s --libs"%(python,python_config)).strip().split(): ++ if(libstr.startswith('-lpython')): ++ name=libstr[2:] ++ result=conf.check(lib=name,uselib='PYEMBED',libpath=path) + if result: + env['LIBPATH_PYEMBED']=path + env.append_value('LIB_PYEMBED',name) +@@ -177,9 +186,6 @@ MACOSX_DEPLOYMENT_TARGET = %r + if(sys.platform=='win32'or sys.platform.startswith('os2')or sys.platform=='darwin'or Py_ENABLE_SHARED): + env['LIBPATH_PYEXT']=env['LIBPATH_PYEMBED'] + env['LIB_PYEXT']=env['LIB_PYEMBED'] +- python_config=conf.find_program('python%s-config'%('.'.join(env['PYTHON_VERSION'].split('.')[:2])),var='PYTHON_CONFIG') +- if not python_config: +- python_config=conf.find_program('python-config-%s'%('.'.join(env['PYTHON_VERSION'].split('.')[:2])),var='PYTHON_CONFIG') + includes=[] + if python_config: + for incstr in Utils.cmd_output("%s %s --includes"%(python,python_config)).strip().split(): diff --git a/python3-cairo.spec b/python3-cairo.spec index 2e8e082..ae47164 100644 --- a/python3-cairo.spec +++ b/python3-cairo.spec @@ -4,7 +4,7 @@ Name: python3-cairo Version: 1.8.10 -Release: 10%{?dist} +Release: 11%{?dist} License: MPLv1.1 or LGPLv2 Group: Development/Languages Summary: Python 3 bindings for the cairo library @@ -15,6 +15,14 @@ Source: http://cairographics.org/releases/pycairo-%{version}.tar.bz2 Patch0: 0001-Add-support-for-libdir.patch Patch1: 0001-use-PyCapsule-API-instead-of-the-deprecated-PyCObjec.patch Patch2: wrap-cairorectangleintt.patch + +# Patch to the embedded copy of waf to fix compiling against python 3.2 +# (due to PEP-3149), by using the appropriate python-config tool, rather +# than trying to find the libraries by directly using PYTHON_VERSION +# +# Not yet sent upstream +Patch3: pycairo-1.8.10-pypath.patch + ### Build Dependencies ### BuildRequires: cairo-devel >= %{cairo_version} @@ -42,6 +50,17 @@ libraries so that they interoperate with python3-cairo. %patch1 -p1 -b .use_pycapsule %patch2 -p1 -b .wrap_cairorectangleintt +# Ensure that ./waf has created the cached unpacked version +# of the wafadmin source tree. +# This will be created to a subdirectory like +# .waf3-1.5.18-a7b91e2a913ce55fa6ecdf310df95752 +python3 ./waf --version + +# Patch the unpacked version of waf: +pushd .waf3* +%patch3 -p0 -b .pypath +popd + %build # FIXME: we should be using the system version of waf (e.g. %{_bindir}/waf) # however it is not yet python 3 compatible but should be when 1.6.0 @@ -82,6 +101,10 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/py3cairo.pc %changelog +* Thu Feb 10 2011 David Malcolm - 1.8.10-11 +- fix embedded copy of waf so that the package builds against python +3.2 (PEP-3149) + * Wed Feb 09 2011 Fedora Release Engineering - 1.8.10-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild