[weasel-commit] Source: pycairo=1.8.8-1

  • From: rbuilder@xxxxxxxxx
  • To: weasel-commit@xxxxxxxxxxxxx
  • Date: Wed, 13 Jan 2010 10:05:21 -0500

================================
pycairo:source=1.8.8-1 (previous: 1.8.6-1)
cvc rdiff pycairo -1 /weasel.rpath.org@wgl:3-devel/1.8.8-1
================================
1.8.8-1 Filip Brcic (brcha@xxxxxxx) Wed Jan 13 10:04:44 2010
    version bump + metadata

pycairo-1.8.8.tar.gz: new
pycairo-1.8.8-pkgconfig_dir.patch: new
--- /dev/null
+++ pycairo-1.8.8-pkgconfig_dir.patch
@@ -0,0 +17 @@
+--- setup.py
++++ setup.py
+@@ -4,6 +4,7 @@
+ import distutils.dir_util  as dut
+ import distutils.file_util as fut
+ import io
++import os
+ import subprocess
+ import sys
+ 
+@@ -106,5 +107,5 @@
+   description = "python interface for cairo",
+   ext_modules = [cairo],
+   data_files=[('include/pycairo',['src/pycairo.h']),
+-              ('lib/pkgconfig',[pkgconfig_file])],
++              (os.environ.get('PKGCONFIG_DIR', 
'lib/pkgconfig'),[pkgconfig_file])],
+   )

pycairo.recipe: changed
Index: pycairo.recipe
====================================================================
contents(size sha1)
inode(mtime)
--- pycairo.recipe /weasel.rpath.org@wgl:3-devel/1.8.6-1
+++ pycairo.recipe /weasel.rpath.org@wgl:3-devel/1.8.8-1
@@ -1,34 +1,35 @@
 #
-# Copyright (c) 2006-2007 rPath, Inc.
-# This file is distributed under the terms of the MIT License.
-# A copy is available at http://www.rpath.com/permanent/mit-license.html
+# Copyright (c) 2010 Filip Brcic <brcha@xxxxxxxxxxxx>
+# Distributed under the terms of the GNU General Public License v3
 #
 
 loadSuperClass('python')
-class Pycairo(AutoPackageRecipe, Python.VersionMixIn):
+class Pycairo(CPackageRecipe, Python.VersionMixIn):
     name = 'pycairo'
-    version = '1.8.6'
-    buildRequires = [ 'cairo:devel', 'pkg-config:devel', 'freetype:devel',
-        'fontconfig:devel', 'libpng:devel', 'zlib:devel', 'python:devel',
-        'libICE:devel', 'libSM:devel', 'libX11:devel', 'libXext:devel',
-        'libXrender:devel', 'libXt:devel', 'libXau:devel', 'libXdmcp:devel', ]
+    version = '1.8.8'
 
-    def unpack(r):
+    buildRequires = [
+        'cairo:devel', 'python:devel'
+        ]
+
+    shortDesc  = 'Python Cairo module'
+    longDesc   = 'Python wrapper for cairo vector graphics library'
+    url        = 'http://cairographics.org/pycairo/'
+    licenses   = [ 'LGPL-2.1', 'MPL-1.1' ]
+    categories = [ 'Development/Python' ]
+
+    def setup(r):
         r.setDefaultPython()
         r.addArchive('http://cairographics.org/releases/')
 
-        if Arch.x86_64:
-            # First build 32bit
-            macros32 = r.macros.copy()
-            macros32.cc = '"gcc -m32"'
-            macros32.cxx = '"g++ -m32"'
-            macros32.libdir = '%(prefix)s/lib'
+        # Don't run py-compile.
+        r.addAction("""
+sed -i -e '/if test -n "$$dlist"; then/,/else :; fi/d' src/Makefile.in
+""")
 
-            r.Run('cp -a %(builddir)s %(builddir)s/../32bit')
+        r.addPatch('pycairo-1.8.8-pkgconfig_dir.patch')
+        r.addPatch('pycairo-1.8.8-svg_check.patch')
 
-            r.Configure(dir='../32bit', overrideMacros=macros32, 
preConfigure='USE_ARCH=32')
-            r.Make(dir='../32bit', overrideMacros=macros32, 
preMake='USE_ARCH=32')
-            r.MakeInstall(dir='../32bit', overrideMacros=macros32, 
preMake='USE_ARCH=32')
+        r.PythonSetup()
 
-            r.NormalizePkgConfig(exceptions='.*')
-            r.NonMultilibComponent(exceptions='.*')
+        r.Install('src/__init__.py', '%(sitepkgs)s/cairo/')


pycairo-1.8.8-svg_check.patch: new
--- /dev/null
+++ pycairo-1.8.8-svg_check.patch
@@ -0,0 +116 @@
+--- setup.py
++++ setup.py
+@@ -29,6 +30,16 @@
+     print pipe.stderr.read()
+     raise SystemExit('Error: %s >= %s not found' % (pkg, version))
+ 
++def pkg_config_svg_check():
++  if os.environ.get('PYCAIRO_DISABLE_SVG', None) is None:
++    pipe = call('pkg-config --exists cairo-svg')
++    if pipe.returncode == 0:
++      return [('PYCAIRO_ENABLE_SVG', None)]
++    else:
++      return []
++  else:
++    return []
++
+ def pkg_config_parse(opt, pkg):
+   pipe = call("pkg-config %s %s" % (opt, pkg))
+   output = pipe.stdout.read()
+@@ -94,6 +105,7 @@
+              'src/pattern.c',
+              'src/surface.c',
+              ],
++  define_macros = pkg_config_svg_check(),
+   include_dirs = pkg_config_parse('--cflags-only-I', 'cairo'),
+   library_dirs = pkg_config_parse('--libs-only-L', 'cairo'),
+   libraries    = pkg_config_parse('--libs-only-l', 'cairo'),
+--- src/cairomodule.c
++++ src/cairomodule.c
+@@ -122,7 +122,7 @@
+ #else
+   0,
+ #endif
+-#ifdef CAIRO_HAS_SVG_SURFACE
++#ifdef PYCAIRO_ENABLE_SVG
+   &PycairoSVGSurface_Type,
+ #else
+   0,
+@@ -209,7 +209,7 @@
+   if (PyType_Ready(&PycairoPSSurface_Type) < 0)
+     return;
+ #endif
+-#ifdef CAIRO_HAS_SVG_SURFACE
++#ifdef PYCAIRO_ENABLE_SVG
+   if (PyType_Ready(&PycairoSVGSurface_Type) < 0)
+     return;
+ #endif
+@@ -285,7 +285,7 @@
+   PyModule_AddObject(m, "PSSurface", (PyObject *)&PycairoPSSurface_Type);
+ #endif
+ 
+-#ifdef CAIRO_HAS_SVG_SURFACE
++#ifdef PYCAIRO_ENABLE_SVG
+   Py_INCREF(&PycairoSVGSurface_Type);
+   PyModule_AddObject(m, "SVGSurface", (PyObject *)&PycairoSVGSurface_Type);
+ #endif
+@@ -350,7 +350,7 @@
+ #else
+   PyModule_AddIntConstant(m, "HAS_PS_SURFACE", 0);
+ #endif
+-#if CAIRO_HAS_SVG_SURFACE
++#if PYCAIRO_ENABLE_SVG
+   PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 1);
+ #else
+   PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 0);
+--- src/private.h
++++ src/private.h
+@@ -86,7 +86,7 @@
+ extern PyTypeObject PycairoPSSurface_Type;
+ #endif
+ 
+-#if CAIRO_HAS_SVG_SURFACE
++#if PYCAIRO_ENABLE_SVG
+ extern PyTypeObject PycairoSVGSurface_Type;
+ #endif
+ 
+--- src/pycairo.h
++++ src/pycairo.h
+@@ -178,7 +178,7 @@
+ #define PycairoPSSurface_Type       *(Pycairo_CAPI->PSSurface_Type)
+ #endif
+ 
+-#if CAIRO_HAS_SVG_SURFACE
++#if PYCAIRO_ENABLE_SVG
+ #define PycairoSVGSurface_Type      *(Pycairo_CAPI->SVGSurface_Type)
+ #endif
+ 
+--- src/surface.c
++++ src/surface.c
+@@ -80,7 +80,7 @@
+     type = &PycairoPSSurface_Type;
+     break;
+ #endif
+-#if CAIRO_HAS_SVG_SURFACE
++#if PYCAIRO_ENABLE_SVG
+   case CAIRO_SURFACE_TYPE_SVG:
+     type = &PycairoSVGSurface_Type;
+     break;
+@@ -965,7 +965,7 @@
+ 
+ 
+ /* Class SVGSurface(Surface) ----------------------------------------------- 
*/
+-#ifdef CAIRO_HAS_SVG_SURFACE
++#ifdef PYCAIRO_ENABLE_SVG
+ #include <cairo-svg.h>
+ 
+ static PyObject *
+@@ -1067,7 +1067,7 @@
+   0,                                  /* tp_is_gc */
+   0,                                  /* tp_bases */
+ };
+-#endif  /* CAIRO_HAS_SVG_SURFACE */
++#endif  /* PYCAIRO_ENABLE_SVG */
+ 
+ 
+ /* Class Win32Surface(Surface) -------------------------------------------- */

pycairo-1.8.6.tar.gz: removed

Committed by: brcha

Other related posts:

  • » [weasel-commit] Source: pycairo=1.8.8-1 - rbuilder