Pycairo 1.8.8 release

Create config.h in 'src' dir. Unify the 3 install methods so they all use
config.h to get version info.
This commit is contained in:
Steve Chaplin 2009-08-26 18:49:55 +08:00 committed by Christoph Reiter
parent 453ebefd09
commit c01a43c7ce
18 changed files with 159 additions and 148 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@
aclocal.m4
autom4te.cache
autoscan.log
build
config.cache
config.h
config.h.in

44
INSTALL
View File

@ -1,31 +1,31 @@
GNU Autotools - install method 1 - preferred method
--------------------------------
Using the same install method of install as cairo - GNU autotools.
$ python -c "import sys; print sys.prefix"
# make a note of the python prefix
$ ./configure --prefix=<python_prefix>
$ make
$ make install # may require superuser access
To build from CVS, use this line instead of the configure line above:
$ ./autogen.sh --prefix=<python_prefix>
If you're installing to another prefix than the one where Python is installed
Python will not be able to find the cairo module until you add
$prefix/lib/pythonX.Y/site-packages to the PYTHONPATH variable.
Waf - install method 2 - alternative install method
----------------------
Waf - recommended install method
---
$ ./waf --help # shows available waf options
$ ./waf configure
$ ./waf build
$ ./waf install
Python distutils - install method 3 - alternative install method
-----------------------------------
GNU Autotools - alternative install method
-------------
Using the same install method of install as cairo - GNU autotools.
$ python -c "import sys; print sys.prefix"
# make a note of the python prefix
$ ./configure --prefix=<python_prefix>
$ make
$ make install # may require superuser access
To build from CVS, use this line instead of the configure line above:
$ ./autogen.sh --prefix=<python_prefix>
If you're installing to another prefix than the one where Python is installed
Python will not be able to find the cairo module until you add
$prefix/lib/pythonX.Y/site-packages to the PYTHONPATH variable.
Python distutils - alternative install method
----------------
$ python setup.py install

View File

@ -59,7 +59,6 @@ release-upload: release-check $(tar_file) $(md5_file)
scp $(tar_file) $(md5_file) $(RELEASE_UPLOAD_HOST):$(RELEASE_UPLOAD_DIR)
mv $(tar_file) $(md5_file) releases
ssh $(RELEASE_UPLOAD_HOST) "rm -f $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(tar_file) $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
cvs tag RELEASE_$(PYCAIRO_VERSION_MAJOR)_$(PYCAIRO_VERSION_MINOR)_$(PYCAIRO_VERSION_MICRO)
release-publish: release-upload releases/$(md5_file)
@echo ""

11
NEWS
View File

@ -1,3 +1,14 @@
Overview of changes from pycairo 1.8.6 to pycairo 1.8.8
=======================================================
General Changes:
Pycairo 1.8.8 requires cairo 1.8.8 (or later).
Move from CVS to git.
Add support for the waf build tool.
Updated methods
The PDF/PS/SVGSurface constructors now accept None as a filename.
Overview of changes from pycairo 1.8.4 to pycairo 1.8.6
=======================================================
General Changes:

2
README
View File

@ -3,7 +3,7 @@ http://www.cairographics.org/pycairo
Dependencies
------------
cairo >= 1.8.6
cairo >= 1.8.8
Python >= 2.6
Compiling

View File

@ -1,42 +1,25 @@
Here are the steps to follow to create a new pycairo release:
1) Ensure that there are no local, uncommitted modifications. The best
thing to do here may be to begin with a fresh checkout from CVS:
1) Fill out an entry in the NEWS file
Sift through the information in 'git log' since the last release. Summarize
major changes briefly in a style similar to other entries in NEWS.
cvs -d cairographics.org:/cvs/cairo co pycairo
2) Increment pycairo version number in:
configure.ac
doc/conf.py
README
setup.py
wscript
But it's probably good enough if "cvs -q update -Ad" generates no
output.
Increment pycairo_major/minor/micro_version in configure.ac
Increase the cairo_required_version - to an even numbered version.
Increment pycairo_major/minor version to match the cairo major/minor
version that pycairo requires (and increment the micro version if
necessary for any subsequent pycairo updates).
2) Fill out an entry in the NEWS file
(install fresh copy, run tests and examples)
Sift through the information in ChangeLog since the last release. Summarize
major changes briefly in a style similar to other entries in NEWS.
3) Increment version numbers in:
cairo/cairomodule.c
configure.ac
doc/conf.py
README
setup.py
Increment pycairo_major/minor/micro_version in configure.ac
Increase the cairo_required_version - to an even numbered version.
Increment pycairo_major/minor version to match the cairo major/minor
version that pycairo requires (and increment the micro version if
necessary for any subsequent pycairo updates).
(install fresh copy, run examples, run any other tests)
4) Commit the changes to NEWS, configure.ac etc
Don't forget to fill out the ChangeLog just like with any other commit.
It's especially important to mention the new version number in the
ChangeLog.
Add a '=== Pycairo x.x.x ===' header to ChangeLog
Do "cvs -q update -Ad" to confirm there are no uncommitted changes.
5) Run "make distcheck" and verify that it gives in no warnings or errors and
3) Run "make distcheck" and verify that it gives in no warnings or errors and
ends with a message of the form:
===============================================
@ -44,7 +27,16 @@ Here are the steps to follow to create a new pycairo release:
pycairo-X.Y.Z.tar.gz
===============================================
6) Edit Makefile.am and select either 'snapshot' or 'release'.
4) Commit the changes to NEWS, configure.ac etc
It's especially important to mention the new version number in the git commit
comment.
Add a '=== Pycairo x.x.x ===' header.
$ git tag v 1.x.x
push the changes to the freedesktop server.
5) Edit Makefile.am and select either 'snapshot' or 'release'.
Run "make release-publish" which will perform the following steps for you:
* Check that the version number ends with an even micro component
@ -55,22 +47,21 @@ Here are the steps to follow to create a new pycairo release:
* scp both files to appear on http://cairographics.org/releases
* Place local copies of the files in the releases directory
* Create a LATEST-package-version file (after deleting any old one)
* Tag the entire source tree with a tag of the form RELEASE_X_Y_Z
* Provide some text for the release announcement (see below).
7) Verify that the tar file arrived at the website.
6) Verify that the tar file arrived at the website.
Check tar file has read permissions for all.
Update the pycairo webpage to reference the new release.
Update http://cheeseshop.python.org entry for pycairo.
8) Edit:
cairo/cairomodule.c
7) Edit:
configure.ac
setup.py
wscript
to increment pycairo_version_micro to the next larger (odd) number and
commit.
9) Send a message to cairo-announce@cairographics.org
8) Send a message to cairo-announce@cairographics.org
and CC python-announce-list@python.org
to announce the new release using the text provided from
"make release-publish".

View File

@ -4,7 +4,7 @@ AC_PREREQ(2.59)
# the pycairo version number
m4_define(pycairo_version_major, 1)
m4_define(pycairo_version_minor, 8)
m4_define(pycairo_version_micro, 7)
m4_define(pycairo_version_micro, 8)
m4_define(pycairo_version, pycairo_version_major.pycairo_version_minor.pycairo_version_micro)
# versions of packages we require
@ -19,7 +19,7 @@ AC_DEFINE(PYCAIRO_VERSION_MINOR, pycairo_version_minor, [pycairo minor version])
AC_DEFINE(PYCAIRO_VERSION_MICRO, pycairo_version_micro, [pycairo macro version])
AC_CONFIG_SRCDIR([src/pycairo.h])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE([1.9.6 -Wall])

View File

@ -48,7 +48,7 @@ copyright = u'2008, Steve Chaplin'
# The short X.Y version.
version = '1.8'
# The full version, including alpha/beta/rc tags.
release = '1.8.6'
release = '1.8.8'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

136
setup.py
View File

@ -3,48 +3,43 @@
import distutils.core as dic
import distutils.dir_util as dut
import distutils.file_util as fut
import io
import subprocess
import sys
pycairo_version = '1.8.7'
cairo_version_required = '1.8.6'
pycairo_version = '1.8.8'
cairo_version_required = '1.8.8'
pkgconfig_file = 'pycairo.pc'
config_file = 'src/config.h'
def call(command):
pipe = subprocess.Popen(command, shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
pipe.wait()
return pipe
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))
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()]
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 ("""\
def createPcFile(PcFile):
print 'creating %s' % PcFile
with open(PcFile, 'w') as fo:
fo.write ("""\
prefix=%s
Name: Pycairo
@ -54,31 +49,62 @@ Requires: cairo
Cflags: -I${prefix}/include/pycairo
Libs:
""" % (sys.prefix, pycairo_version)
)
fo.close()
)
def createConfigFile(ConfigFile):
print 'creating %s' % ConfigFile
v = pycairo_version.split('.')
with open(ConfigFile, 'w') as fo:
fo.write ("""\
// Configuration header created by setup.py - do not edit
#ifndef _CONFIG_H
#define _CONFIG_H 1
#define PYCAIRO_VERSION_MAJOR %s
#define PYCAIRO_VERSION_MICRO %s
#define PYCAIRO_VERSION_MINOR %s
#define VERSION "%s"
#endif // _CONFIG_H
""" % (v[0], v[1], v[2], pycairo_version)
)
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')
createPcFile(pkgconfig_file)
createConfigFile(config_file)
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,
)
name = 'cairo._cairo',
sources = ['src/cairomodule.c',
'src/context.c',
'src/font.c',
'src/matrix.c',
'src/path.c',
'src/pattern.c',
'src/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])],
)
name = "pycairo",
version = pycairo_version,
description = "python interface for cairo",
ext_modules = [cairo],
data_files=[('include/pycairo',['src/pycairo.h']),
('lib/pkgconfig',[pkgconfig_file])],
)

View File

@ -31,9 +31,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "config.h"
#include "private.h"
/* to read CAIRO_PS_LEVEL_* constants */

View File

@ -31,9 +31,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "config.h"
#include "private.h"

View File

@ -31,9 +31,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "config.h"
#include "private.h"

View File

@ -31,9 +31,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "config.h"
#include "private.h"

View File

@ -31,9 +31,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "config.h"
#include "private.h"

View File

@ -31,9 +31,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "config.h"
#include "private.h"

View File

@ -31,10 +31,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "config.h"
#include "private.h"

View File

@ -20,7 +20,7 @@ def build(bld):
features = 'cc cshlib pyext',
source = 'cairomodule.c context.c font.c path.c pattern.c matrix.c surface.c',
target = '_cairo',
includes = '. ..', # '..' for config.h
includes = '.',
uselib = 'CAIRO',
install_path = '${PYTHONDIR}/cairo',
)

View File

@ -1,10 +1,9 @@
# -*- python -*-
import io
import os
APPNAME='pycairo'
VERSION='1.8.7'
VERSION='1.8.8'
srcdir = '.'
blddir = '../%s-build' % APPNAME
@ -45,8 +44,7 @@ def configure(conf):
conf.define('PYCAIRO_VERSION_MINOR', version[1])
conf.define('PYCAIRO_VERSION_MICRO', version[2])
conf.env.append_value('CCDEFINES', 'HAVE_CONFIG_H') # remove later - always have_config
conf.write_config_header('config.h')
conf.write_config_header('src/config.h')
def build(bld):