diff options
author | obache <obache@pkgsrc.org> | 2011-12-12 11:33:27 +0000 |
---|---|---|
committer | obache <obache@pkgsrc.org> | 2011-12-12 11:33:27 +0000 |
commit | c1a681401443adb9cfb25c29b02c2b1415e2a56b (patch) | |
tree | 5a4b65d9e1d07affd57d9af211a9e490d77e5a20 /graphics | |
parent | 90b64e621b415d783ee12910ec4b85381a3445a7 (diff) | |
download | pkgsrc-c1a681401443adb9cfb25c29b02c2b1415e2a56b.tar.gz |
* apply patch for python<=2.5, taken from upstream.
* install manual page.
Bump PKGREVISION.
Diffstat (limited to 'graphics')
6 files changed, 184 insertions, 3 deletions
diff --git a/graphics/py-blockdiag/Makefile b/graphics/py-blockdiag/Makefile index 3bef5f0b91b..2652119b419 100644 --- a/graphics/py-blockdiag/Makefile +++ b/graphics/py-blockdiag/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.5 2011/12/07 13:12:08 obache Exp $ +# $NetBSD: Makefile,v 1.6 2011/12/12 11:33:27 obache Exp $ # DISTNAME= blockdiag-1.1.1 PKGNAME= ${PYPKGPREFIX}-${DISTNAME} +PKGREVISION= 1 CATEGORIES= graphics MASTER_SITES= http://pypi.python.org/packages/source/b/blockdiag/ @@ -20,5 +21,11 @@ PKG_DESTDIR_SUPPORT= user-destdir USE_LANGUAGES= # none +INSTALLATION_DIRS+= ${PKGMANDIR}/man1 + +post-install: + ${INSTALL_MAN} ${WRKSRC}/blockdiag.1 \ + ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1 + .include "../../lang/python/egg.mk" .include "../../mk/bsd.pkg.mk" diff --git a/graphics/py-blockdiag/PLIST b/graphics/py-blockdiag/PLIST index 96560a2eff7..8d42af22646 100644 --- a/graphics/py-blockdiag/PLIST +++ b/graphics/py-blockdiag/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.5 2011/12/07 13:12:08 obache Exp $ +@comment $NetBSD: PLIST,v 1.6 2011/12/12 11:33:27 obache Exp $ bin/blockdiag ${PYSITELIB}/${EGG_INFODIR}/PKG-INFO ${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt @@ -345,3 +345,4 @@ ${PYSITELIB}/blockdiag/utils/uuid.pyo ${PYSITELIB}/blockdiag_sphinxhelper.py ${PYSITELIB}/blockdiag_sphinxhelper.pyc ${PYSITELIB}/blockdiag_sphinxhelper.pyo +man/man1/blockdiag.1 diff --git a/graphics/py-blockdiag/distinfo b/graphics/py-blockdiag/distinfo index 46c4d48f776..84cbfb27932 100644 --- a/graphics/py-blockdiag/distinfo +++ b/graphics/py-blockdiag/distinfo @@ -1,5 +1,8 @@ -$NetBSD: distinfo,v 1.5 2011/12/07 13:12:08 obache Exp $ +$NetBSD: distinfo,v 1.6 2011/12/12 11:33:27 obache Exp $ SHA1 (blockdiag-1.1.1.tar.gz) = d5c2942019f7c837531e44dc7384225993ecd497 RMD160 (blockdiag-1.1.1.tar.gz) = d2e8689ef092a24b6681753995b33709c871b8a0 Size (blockdiag-1.1.1.tar.gz) = 128625 bytes +SHA1 (patch-src_blockdiag_tests_test__rst__directives.py) = 52c467a3223b42b651e8e9c93582c3b0f0c706d3 +SHA1 (patch-src_blockdiag_tests_test__utils__fontmap.py) = 430e7322ebc8ac9080274a8bd888f1bf05e70570 +SHA1 (patch-src_blockdiag_tests_utils.py) = bf965de7cd031c3729cd8d91ce9b006a52fe07b0 diff --git a/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_test__rst__directives.py b/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_test__rst__directives.py new file mode 100644 index 00000000000..9cd0da20ddc --- /dev/null +++ b/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_test__rst__directives.py @@ -0,0 +1,47 @@ +$NetBSD: patch-src_blockdiag_tests_test__rst__directives.py,v 1.1 2011/12/12 11:33:28 obache Exp $ + +* Fix testcase using 'with' statement are failed in python2.5 environment + https://bitbucket.org/tk0miya/blockdiag/changeset/f078235db9b9 + +--- src/blockdiag/tests/test_rst_directives.py.orig 2011-11-21 02:41:13.000000000 +0000 ++++ src/blockdiag/tests/test_rst_directives.py +@@ -5,7 +5,7 @@ import os + import sys + import tempfile + import unittest2 +-from utils import stderr_wrapper ++from utils import stderr_wrapper, assertRaises + from docutils import nodes + from docutils.core import publish_doctree + from docutils.parsers.rst import directives as docutils +@@ -150,20 +150,20 @@ class TestRstDirectives(unittest2.TestCa + self.assertFalse('target' in doctree[0]) + + @use_tmpdir ++ @assertRaises(RuntimeError) + def test_rst_directives_with_block_fontpath1(self, path): +- with self.assertRaises(RuntimeError): +- directives.setup(format='SVG', fontpath=['dummy.ttf'], +- outputdir=path) +- text = ".. blockdiag::\n :alt: hello world\n\n { A -> B }" +- doctree = publish_doctree(text) ++ directives.setup(format='SVG', fontpath=['dummy.ttf'], ++ outputdir=path) ++ text = ".. blockdiag::\n :alt: hello world\n\n { A -> B }" ++ doctree = publish_doctree(text) + + @use_tmpdir ++ @assertRaises(RuntimeError) + def test_rst_directives_with_block_fontpath2(self, path): +- with self.assertRaises(RuntimeError): +- directives.setup(format='SVG', fontpath='dummy.ttf', +- outputdir=path) +- text = ".. blockdiag::\n :alt: hello world\n\n { A -> B }" +- doctree = publish_doctree(text) ++ directives.setup(format='SVG', fontpath='dummy.ttf', ++ outputdir=path) ++ text = ".. blockdiag::\n :alt: hello world\n\n { A -> B }" ++ doctree = publish_doctree(text) + + @use_tmpdir + def test_rst_directives_with_block_maxwidth(self, path): diff --git a/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_test__utils__fontmap.py b/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_test__utils__fontmap.py new file mode 100644 index 00000000000..48197876b7d --- /dev/null +++ b/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_test__utils__fontmap.py @@ -0,0 +1,91 @@ +$NetBSD: patch-src_blockdiag_tests_test__utils__fontmap.py,v 1.1 2011/12/12 11:33:28 obache Exp $ + +* Fix testcase using 'with' statement are failed in python2.5 environment + https://bitbucket.org/tk0miya/blockdiag/changeset/f078235db9b9 + +--- src/blockdiag/tests/test_utils_fontmap.py.orig 2011-11-21 02:38:58.000000000 +0000 ++++ src/blockdiag/tests/test_utils_fontmap.py +@@ -3,7 +3,7 @@ + import os + import sys + import unittest2 +-from utils import stderr_wrapper ++from utils import stderr_wrapper, assertRaises + from cStringIO import StringIO + from blockdiag.utils.collections import namedtuple + from blockdiag.utils.fontmap import FontInfo, FontMap +@@ -31,33 +31,33 @@ class TestUtilsFontmap(unittest2.TestCas + FontInfo("my-cursive", None, 11) + FontInfo("-fantasy", None, 11) + ++ @assertRaises(AttributeError) + def test_fontinfo_invalid_familyname1(self): +- with self.assertRaises(AttributeError): +- FontInfo("unknown", None, 11) ++ FontInfo("unknown", None, 11) + ++ @assertRaises(AttributeError) + def test_fontinfo_invalid_familyname2(self): +- with self.assertRaises(AttributeError): +- FontInfo("sansserif-", None, 11) ++ FontInfo("sansserif-", None, 11) + ++ @assertRaises(AttributeError) + def test_fontinfo_invalid_familyname3(self): +- with self.assertRaises(AttributeError): +- FontInfo("monospace-unkown", None, 11) ++ FontInfo("monospace-unkown", None, 11) + ++ @assertRaises(AttributeError) + def test_fontinfo_invalid_familyname4(self): +- with self.assertRaises(AttributeError): +- FontInfo("cursive-bold-bold", None, 11) ++ FontInfo("cursive-bold-bold", None, 11) + ++ @assertRaises(AttributeError) + def test_fontinfo_invalid_familyname4(self): +- with self.assertRaises(AttributeError): +- FontInfo("SERIF", None, 11) ++ FontInfo("SERIF", None, 11) + ++ @assertRaises(TypeError) + def test_fontinfo_invalid_fontsize1(self): +- with self.assertRaises(TypeError): +- FontInfo("serif", None, None) ++ FontInfo("serif", None, None) + ++ @assertRaises(ValueError) + def test_fontinfo_invalid_fontsize2(self): +- with self.assertRaises(ValueError): +- FontInfo("serif", None, '') ++ FontInfo("serif", None, '') + + def test_fontinfo_parse(self): + font = FontInfo("serif", None, 11) +@@ -212,15 +212,17 @@ class TestUtilsFontmap(unittest2.TestCas + self.assertEqual(11, font1.size) + + def test_fontmap_duplicated_fontentry1(self): +- _config = "[fontmap]\nsansserif: %s\nsansserif-normal: %s\n" % \ +- (self.fontpath[0], self.fontpath[1]) +- config = StringIO(_config) +- fmap = FontMap(config) +- +- font1 = fmap.find() +- self.assertEqual('sansserif', font1.generic_family) +- self.assertEqual(self.fontpath[1], font1.path) +- self.assertEqual(11, font1.size) ++ # this testcase is only for python2.6 or later ++ if sys.version_info > (2, 6): ++ _config = "[fontmap]\nsansserif: %s\nsansserif-normal: %s\n" % \ ++ (self.fontpath[0], self.fontpath[1]) ++ config = StringIO(_config) ++ fmap = FontMap(config) ++ ++ font1 = fmap.find() ++ self.assertEqual('sansserif', font1.generic_family) ++ self.assertEqual(self.fontpath[1], font1.path) ++ self.assertEqual(11, font1.size) + + @stderr_wrapper + def test_fontmap_with_nodefault_fontentry(self): diff --git a/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_utils.py b/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_utils.py new file mode 100644 index 00000000000..30824e59527 --- /dev/null +++ b/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_utils.py @@ -0,0 +1,32 @@ +$NetBSD: patch-src_blockdiag_tests_utils.py,v 1.1 2011/12/12 11:33:28 obache Exp $ + +* Fix testcase using 'with' statement are failed in python2.5 environment + https://bitbucket.org/tk0miya/blockdiag/changeset/f078235db9b9 + +--- src/blockdiag/tests/utils.py.orig 2011-11-13 08:30:10.000000000 +0000 ++++ src/blockdiag/tests/utils.py +@@ -38,6 +38,24 @@ def stderr_wrapper(func): + return wrap + + ++def assertRaises(exc): ++ def decorator(func): ++ def fn(self, *args, **kwargs): ++ try: ++ func(self, *args, **kwargs) ++ except exc: ++ pass ++ else: ++ msg = '%s does not raise exceptions: %s' % \ ++ (func.__name__, str(exc)) ++ self.fail(msg) ++ ++ fn.__name__ = func.__name__ ++ return fn ++ ++ return decorator ++ ++ + def __build_diagram(filename): + import os + testdir = os.path.dirname(__file__) |