[cairo-commit] pycairo ChangeLog,1.123,1.124 setup.py,NONE,1.1

Steve Chaplin commit at pdx.freedesktop.org
Wed May 25 05:06:32 PDT 2005


Committed by: stevech1097

Update of /cvs/cairo/pycairo
In directory gabe:/tmp/cvs-serv29474

Modified Files:
	ChangeLog 
Added Files:
	setup.py 
Log Message:
SC

Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/pycairo/ChangeLog,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- ChangeLog	25 May 2005 11:07:13 -0000	1.123
+++ ChangeLog	25 May 2005 12:06:30 -0000	1.124
@@ -1,5 +1,9 @@
 2005-05-25  Steve Chaplin  <steve1097 at yahoo.com.au>
 
+	* setup.py: new file, contributed by Niki Spahiev
+
+2005-05-25  Steve Chaplin  <steve1097 at yahoo.com.au>
+
 	* cairo/pycairo-context.c: update method table to hold the correct
 	values for cairo_mask, cairo_mask_surface and cairo_stroke_preserve
 

--- NEW FILE: setup.py ---
#!/usr/bin/env python

from distutils.core import setup, Extension

def pkg_config_parse(pkg, opt):
    import os
    conf = os.popen('pkg-config %s %s' % (opt,pkg)).read()
    opt = opt[-2:]
    return [x.lstrip(opt) for x in conf.split()]

def get_include(pkg):
    return pkg_config_parse(pkg,'--cflags-only-I')

def get_lib_dirs(pkg):
    return pkg_config_parse(pkg,'--libs-only-L')

def get_libs(pkg):
    return pkg_config_parse(pkg,'--libs-only-l')

#~ print get_include('cairo')
#~ print get_lib_dirs('cairo')
#~ print get_libs('cairo')

_cairo = Extension(name = 'cairo._cairo',
            sources= ['cairo/cairomodule.c',
            'cairo/pycairo-context.c', 'cairo/pycairo-font.c',
            'cairo/pycairo-matrix.c', 'cairo/pycairo-path.c',
            'cairo/pycairo-pattern.c', 'cairo/pycairo-surface.c',
            ],
            include_dirs = get_include('cairo'),
            library_dirs = get_lib_dirs('cairo'),
            libraries = get_libs('cairo'),
        )

setup( name = "pycairo", 
    version = "0.5.0",
    description = "python interface for cairo",

    packages = ['cairo'],
    ext_modules = [_cairo],
    )





More information about the cairo-commit mailing list