head 1.34; access; symbols RELEASE_1_8_6:1.34 RELEASE_1_8_4:1.33 RELEASE_1_8_2:1.30 RELEASE_1_8_0:1.28 RELEASE_1_6_4:1.25 RELEASE_1_4_12:1.21 RELEASE_1_4_0:1.17 RELEASE_1_2_6:1.13 RELEASE_1_2_2:1.10 RELEASE_1_2_0:1.8 RELEASE_1_1_6:1.7 RELEASE_1_0_2:1.6 RELEASE_1_0_0:1.5 SNAPSHOT_0_9_0:1.4 SNAPSHOT_0_6_0:1.3 SNAPSHOT_0_5_1:1.1; locks; strict; comment @# @; 1.34 date 2009.03.19.09.03.46; author stevech1097; state Exp; branches; next 1.33; commitid O95NcZT5ycyeECGt; 1.33 date 2009.03.19.08.48.37; author stevech1097; state Exp; branches; next 1.32; commitid VK0AYgPoEa12zCGt; 1.32 date 2009.03.03.12.40.23; author stevech1097; state Exp; branches; next 1.31; commitid PPwwCKqo95vqmAEt; 1.31 date 2009.01.15.10.06.15; author stevech1097; state Exp; branches; next 1.30; commitid yaKuhvXLOoYc1xyt; 1.30 date 2009.01.15.09.36.47; author stevech1097; state Exp; branches; next 1.29; commitid ha3bUFLElCy5Rwyt; 1.29 date 2008.12.15.07.00.18; author stevech1097; state Exp; branches; next 1.28; commitid i2DBl0gLaKWcZwut; 1.28 date 2008.12.15.06.38.03; author stevech1097; state Exp; branches; next 1.27; commitid Aki7NXXemokzRwut; 1.27 date 2008.12.10.06.50.05; author stevech1097; state Exp; branches; next 1.26; commitid XZEZsQ38uXVE5Ttt; 1.26 date 2008.08.09.03.32.19; author stevech1097; state Exp; branches; next 1.25; commitid xhN1KM6NZJ0XW3et; 1.25 date 2008.07.17.04.15.06; author stevech1097; state Exp; branches; next 1.24; commitid pQBZfPbTOCAsV6bt; 1.24 date 2008.07.16.23.23.51; author stevech1097; state Exp; branches; next 1.23; commitid IMY4h0dlIpPxj5bt; 1.23 date 2008.05.12.12.06.37; author stevech1097; state Exp; branches; next 1.22; commitid 6vPFiN5bxFgKEF2t; 1.22 date 2007.12.13.06.45.26; author stevech1097; state Exp; branches; next 1.21; commitid DskAyZJuJ28tJeJs; 1.21 date 2007.12.13.06.09.52; author stevech1097; state Exp; branches; next 1.20; commitid 7rAnUjiYelRhxeJs; 1.20 date 2007.12.13.05.29.33; author stevech1097; state Exp; branches; next 1.19; commitid DyqdsqSHy1jsjeJs; 1.19 date 2007.11.20.09.16.10; author stevech1097; state Exp; branches; next 1.18; commitid pHrltlknUAe2jiGs; 1.18 date 2007.03.14.09.47.35; author stevech1097; state Exp; branches; next 1.17; 1.17 date 2007.03.14.09.18.16; author stevech1097; state Exp; branches; next 1.16; 1.16 date 2007.01.21.13.49.30; author stevech1097; state Exp; branches; next 1.15; 1.15 date 2006.12.27.10.32.20; author stevech1097; state Exp; branches; next 1.14; 1.14 date 2006.11.27.02.00.05; author stevech1097; state Exp; branches; next 1.13; 1.13 date 2006.11.27.01.44.09; author stevech1097; state Exp; branches; next 1.12; 1.12 date 2006.09.22.04.00.15; author stevech1097; state Exp; branches; next 1.11; 1.11 date 2006.08.21.03.32.28; author stevech1097; state Exp; branches; next 1.10; 1.10 date 2006.08.19.13.14.44; author stevech1097; state Exp; branches; next 1.9; 1.9 date 2006.08.17.15.48.09; author stevech1097; state Exp; branches; next 1.8; 1.8 date 2006.07.03.03.46.35; author stevech1097; state Exp; branches; next 1.7; 1.7 date 2006.05.29.05.37.34; author stevech1097; state Exp; branches; next 1.6; 1.6 date 2005.10.11.06.49.18; author stevech1097; state Exp; branches; next 1.5; commitid 5e5c434b606c4567; 1.5 date 2005.08.31.23.37.47; author stevech1097; state Exp; branches; next 1.4; commitid 482a43163f4a4567; 1.4 date 2005.08.10.16.08.45; author stevech1097; state Exp; branches; next 1.3; commitid 3ff642fa268a4567; 1.3 date 2005.08.01.15.54.21; author stevech1097; state Exp; branches; next 1.2; commitid 516942ee45a94567; 1.2 date 2005.07.02.10.11.05; author stevech1097; state Exp; branches; next 1.1; commitid 720242c668384567; 1.1 date 2005.05.25.12.06.30; author stevech1097; state Exp; branches; next ; commitid 732242946a434567; desc @@ 1.34 log @'SC' @ text @#!/usr/bin/env python import distutils.core as dic import distutils.dir_util as dut import distutils.file_util as fut import subprocess import sys pycairo_version = '1.8.5' cairo_version_required = '1.8.4' def call(command): pipe = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) pipe.wait() return pipe def pkg_config_version_check(pkg, version): pipe = call('pkg-config --print-errors --exists "%s >= %s"' % (pkg, version)) if pipe.returncode == 0: print '%s >= %s detected' % (pkg, version) else: print pipe.stderr.read() raise SystemExit('Error: %s >= %s not found' % (pkg, version)) def pkg_config_parse(opt, pkg): pipe = call("pkg-config %s %s" % (opt, pkg)) output = pipe.stdout.read() opt = opt[-2:] return [x.lstrip(opt) for x in output.split()] if sys.version_info < (2,6): raise SystemExit('Error: Python >= 2.6 is required') pkg_config_version_check ('cairo', cairo_version_required) if sys.platform == 'win32': runtime_library_dirs = [] else: runtime_library_dirs = pkg_config_parse('--libs-only-L', 'cairo') pkgconfig_file='pycairo.pc' print 'creating %s' % pkgconfig_file fo = open (pkgconfig_file, 'w') fo.write ("""\ prefix=%s Name: Pycairo Description: Python bindings for cairo Version: %s Requires: cairo Cflags: -I${prefix}/include/pycairo Libs: """ % (sys.prefix, pycairo_version) ) fo.close() cairo = dic.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 = pkg_config_parse('--cflags-only-I', 'cairo'), library_dirs = pkg_config_parse('--libs-only-L', 'cairo'), libraries = pkg_config_parse('--libs-only-l', 'cairo'), runtime_library_dirs = runtime_library_dirs, ) dic.setup( name = "pycairo", version = pycairo_version, description = "python interface for cairo", packages = ['cairo'], ext_modules = [cairo], data_files=[('include/pycairo',['cairo/pycairo.h']), ('lib/pkgconfig',[pkgconfig_file])], ) @ 1.33 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.8.4' @ 1.32 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.8.3' @ 1.31 log @'SC' @ text @d10 1 a10 1 cairo_version_required = '1.8.2' d35 2 a36 2 if sys.version_info < (2,5): raise SystemExit('Error: Python >= 2.5 is required') @ 1.30 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.8.2' @ 1.29 log @'SC' @ text @d9 2 a10 2 pycairo_version = '1.8.1' cairo_version_required = '1.8.0' @ 1.28 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.8.0' @ 1.27 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.6.5' a11 3 # Notes: # on Fedora Core 5 module is compiled with 'gcc -g' - why -g? @ 1.26 log @'SC' @ text @d10 1 a10 1 cairo_version_required = '1.6.4' @ 1.25 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.6.4' @ 1.24 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.4.13' @ 1.23 log @'SC' @ text @d23 1 a23 1 pipe = call("pkg-config --print-errors --exists '%s >= %s'" % @ 1.22 log @'SC' @ text @d10 1 a10 1 cairo_version_required = '1.4.12' d38 2 a39 2 if sys.version_info < (2,4): raise SystemExit('Error: Python >= 2.4 is required') @ 1.21 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.4.12' @ 1.20 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.4.1' @ 1.19 log @'SC' @ text @d10 1 a10 1 cairo_version_required = '1.4.0' @ 1.18 log @'SC' @ text @d6 1 a6 1 import os a13 1 # later: replace os.popen() with subprocess module, new in Python 2.4 d15 12 a26 8 def pkg_config (opt, pkg): fo = os.popen ('pkg-config %s %s' % (opt, pkg)) return fo.read(), fo.close() def pkg_config_version_check (pkg, version): output, status = pkg_config ('--atleast-version=%s' % version, pkg) if status is None: print '%s version >= %s detected' % (pkg, version) d28 2 a29 1 raise SystemExit ('Error: %s version >= %s not found' % (pkg, version)) d31 3 a33 2 def pkg_config_parse (opt, pkg): output, status = pkg_config (opt, pkg) d38 3 @ 1.17 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.4.0' @ 1.16 log @'SC' @ text @d9 2 a10 2 pycairo_version = '1.3.11' cairo_version_required = '1.3.12' @ 1.15 log @'SC' @ text @d9 2 a10 2 pycairo_version = '1.3.1' cairo_version_required = '1.3.2' @ 1.14 log @'SC' @ text @d9 2 a10 2 pycairo_version = '1.2.7' cairo_version_required = '1.2.6' @ 1.13 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.2.6' @ 1.12 log @'SC' @ text @d9 2 a10 2 pycairo_version = '1.2.3' cairo_version_required = '1.2.2' @ 1.11 log @'SC' @ text @d34 20 d57 1 a57 1 sources = ['cairo/cairomodule.c', d68 1 a68 1 runtime_library_dirs = pkg_config_parse('--libs-only-L', 'cairo'), d77 2 a79 21 pkgconfig_dir = os.path.join (sys.prefix, 'lib', 'pkgconfig') pkgconfig_file = os.path.join (pkgconfig_dir, 'pycairo.pc') print 'creating %s' % pkgconfig_file fo = file (pkgconfig_file, 'w') fo.write ("""\ prefix=%s Name: Pycairo Description: Python bindings for cairo Version: %s Requires: cairo Cflags: -I${prefix}/include/pycairo Libs: """ % (sys.prefix, pycairo_version) ) fo.close() includedir = os.path.join (sys.prefix, 'include', 'pycairo') dut.mkpath (includedir, verbose=True) fut.copy_file ('cairo/pycairo.h', includedir, verbose=True) @ 1.10 log @'SC' @ text @d9 1 a9 1 pycairo_version = '1.2.2' @ 1.9 log @'SC' @ text @d3 3 a5 1 import distutils.core as dic d7 1 d13 1 a13 7 # need to install //include/pycairo/pycairo.h # //lib/pkgconfig/pycairo.pc # prefix defaults to /usr # distutils.dir_util.mkpath() # distutils.file_util.copy_file() # # on Fedora Core 5 it gets compiled with 'gcc -g' - why -g? d16 4 d21 1 a21 2 fo = os.popen('pkg-config --atleast-version=%s %s' % (version, pkg)) status = fo.close() d28 1 a28 1 output = os.popen('pkg-config %s %s' % (opt, pkg)).read() d48 1 d58 21 @ 1.8 log @'SC' @ text @d3 2 a4 1 from distutils.core import setup, Extension d6 23 a28 3 def pkg_config_parse(pkg, opt): import os conf = os.popen('pkg-config %s %s' % (opt,pkg)).read() d30 1 a30 1 return [x.lstrip(opt) for x in conf.split()] a31 2 def get_include(pkg): return pkg_config_parse(pkg,'--cflags-only-I') d33 1 a33 2 def get_lib_dirs(pkg): return pkg_config_parse(pkg,'--libs-only-L') d35 14 a48 17 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'), ) d50 3 a52 2 setup( name = "pycairo", version = "1.2.0", a53 1 d55 1 a55 1 ext_modules = [_cairo], a56 1 @ 1.7 log @'SC' @ text @d36 1 a36 1 version = "1.1.6", @ 1.6 log @'SC' @ text @d36 1 a36 1 version = "1.0.2", @ 1.5 log @'SC' @ text @d36 1 a36 1 version = "1.0.0", @ 1.4 log @'SC' @ text @d36 1 a36 1 version = "0.9.0", @ 1.3 log @'SC' @ text @d35 2 a36 2 setup( name = "pycairo", version = "0.6.0", @ 1.2 log @SC @ text @d36 1 a36 1 version = "0.5.1", @ 1.1 log @SC @ text @d36 1 a36 1 version = "0.5.0", @