Initial commit.
authorRob Cakebread <pythonhead@gentoo.org>
Sat, 14 Apr 2007 17:54:00 +0000 (17:54 +0000)
committerRob Cakebread <pythonhead@gentoo.org>
Sat, 14 Apr 2007 17:54:00 +0000 (17:54 +0000)
Package-Manager: portage-2.1.2.3

dev-python/pygments/ChangeLog [new file with mode: 0644]
dev-python/pygments/Manifest [new file with mode: 0644]
dev-python/pygments/files/digest-pygments-0.7.1 [new file with mode: 0644]
dev-python/pygments/files/pygments-0.7.1-_mapping.py-ebuild.patch [new file with mode: 0644]
dev-python/pygments/files/pygments-0.7.1-html_formatter.patch [new file with mode: 0644]
dev-python/pygments/files/pygments-0.7.1-other.py-ebuild.patch [new file with mode: 0644]
dev-python/pygments/metadata.xml [new file with mode: 0644]
dev-python/pygments/pygments-0.7.1.ebuild [new file with mode: 0644]

diff --git a/dev-python/pygments/ChangeLog b/dev-python/pygments/ChangeLog
new file mode 100644 (file)
index 0000000..928370e
--- /dev/null
@@ -0,0 +1,13 @@
+# ChangeLog for dev-python/pygments
+# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/pygments/ChangeLog,v 1.1 2007/04/14 17:54:00 pythonhead Exp $
+
+*pygments-0.7.1 (14 Apr 2007)
+
+  14 Apr 2007; Rob Cakebread <pythonhead@gentoo.org>
+  +files/pygments-0.7.1-_mapping.py-ebuild.patch,
+  +files/pygments-0.7.1-html_formatter.patch,
+  +files/pygments-0.7.1-other.py-ebuild.patch, +metadata.xml,
+  +pygments-0.7.1.ebuild:
+  Initial commit. Thanks Georg Brandl <g.brandl@gmx.net> bug #167115
+
diff --git a/dev-python/pygments/Manifest b/dev-python/pygments/Manifest
new file mode 100644 (file)
index 0000000..6512317
--- /dev/null
@@ -0,0 +1,38 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+AUX pygments-0.7.1-_mapping.py-ebuild.patch 1043 RMD160 684881215c8be4af0b9568d4459105b56cc16f6d SHA1 7865e6fe854169ee588549e936b3d583102a6256 SHA256 d223874c43fb62171908a1a222328ac688357b760567e3739cc4fa31995ead5f
+MD5 f4c1df65543ec79c9b9506a5d8a8b00b files/pygments-0.7.1-_mapping.py-ebuild.patch 1043
+RMD160 684881215c8be4af0b9568d4459105b56cc16f6d files/pygments-0.7.1-_mapping.py-ebuild.patch 1043
+SHA256 d223874c43fb62171908a1a222328ac688357b760567e3739cc4fa31995ead5f files/pygments-0.7.1-_mapping.py-ebuild.patch 1043
+AUX pygments-0.7.1-html_formatter.patch 3196 RMD160 4e5e43356a457e58f49085ac26af8aeb3f571d1a SHA1 1775516adf17d8fcead0de9bb2248f0abf881b88 SHA256 14bad70101fc4c225a2626a0459a3929d447d9033e32e37895baff0572da2ff9
+MD5 37a210e6df740c2edbab2b9fe2e59148 files/pygments-0.7.1-html_formatter.patch 3196
+RMD160 4e5e43356a457e58f49085ac26af8aeb3f571d1a files/pygments-0.7.1-html_formatter.patch 3196
+SHA256 14bad70101fc4c225a2626a0459a3929d447d9033e32e37895baff0572da2ff9 files/pygments-0.7.1-html_formatter.patch 3196
+AUX pygments-0.7.1-other.py-ebuild.patch 350 RMD160 967b38bf2b6969cd9bf311f0542b97fa07dfff93 SHA1 68bd75593271e46b28bd961ee0bdb59d03f615df SHA256 a81336c004cc000b247f88836fe9e8cfdcb056269ca1e3c729b0b57ce93121ad
+MD5 010c3d12aab4183773a9ce3076561883 files/pygments-0.7.1-other.py-ebuild.patch 350
+RMD160 967b38bf2b6969cd9bf311f0542b97fa07dfff93 files/pygments-0.7.1-other.py-ebuild.patch 350
+SHA256 a81336c004cc000b247f88836fe9e8cfdcb056269ca1e3c729b0b57ce93121ad files/pygments-0.7.1-other.py-ebuild.patch 350
+DIST Pygments-0.7.1.tar.gz 664696 RMD160 5bf587c4496ff5330d16e1c73265d653b6ddf9b5 SHA1 740de095ce71d1b36a72b2df98207a22ead57690 SHA256 932866bde0019c370c36232d877c223a5f1d275c3161806552cb123d6f5d3638
+EBUILD pygments-0.7.1.ebuild 1228 RMD160 739d9d3e0e41d15c9863f3a7353b78dd5429c2c1 SHA1 7597a13a37a81389bbb1b86b79dccbefd629fb2a SHA256 57ad336985fb769cc95a1a451e10d68d03ee9ba2ed0c09a2dac8a8527597f42b
+MD5 1e5748ab09574caab9277de20276a710 pygments-0.7.1.ebuild 1228
+RMD160 739d9d3e0e41d15c9863f3a7353b78dd5429c2c1 pygments-0.7.1.ebuild 1228
+SHA256 57ad336985fb769cc95a1a451e10d68d03ee9ba2ed0c09a2dac8a8527597f42b pygments-0.7.1.ebuild 1228
+MISC ChangeLog 553 RMD160 57c55c891ab78a8241b2b001a34cff44f2edd9f8 SHA1 d507bd896c48e3a4d600a528b3437b1fd70ccfa2 SHA256 5f6fa4ae629b4e85f4e52fa4eb451349b8124747069b7d72fab691fac8bdc70f
+MD5 95762aa110e37a2475d717e6c87aada5 ChangeLog 553
+RMD160 57c55c891ab78a8241b2b001a34cff44f2edd9f8 ChangeLog 553
+SHA256 5f6fa4ae629b4e85f4e52fa4eb451349b8124747069b7d72fab691fac8bdc70f ChangeLog 553
+MISC metadata.xml 324 RMD160 e99bd87525fcbccf3a5b10eae160832ae26a013c SHA1 330d20ed94f6607bb7293f935789dcf3f1151cc7 SHA256 83404c337ddbe4445d64859a64e352d02b7e3fd9929e4a265c06880d7938da3e
+MD5 8c5b007ef421db1269be4805edab4240 metadata.xml 324
+RMD160 e99bd87525fcbccf3a5b10eae160832ae26a013c metadata.xml 324
+SHA256 83404c337ddbe4445d64859a64e352d02b7e3fd9929e4a265c06880d7938da3e metadata.xml 324
+MD5 79d62f4dcc90b31eac8cc4a8ed996054 files/digest-pygments-0.7.1 244
+RMD160 6f7fda0f129385cdd4ddbb61861a479f0addd7f4 files/digest-pygments-0.7.1 244
+SHA256 8f19e938f346b5b99fd1dc5fff933e7548c593edb0d24db8e37d925277c13dda files/digest-pygments-0.7.1 244
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.3 (GNU/Linux)
+
+iD8DBQFGIRVL96cFzIajWwkRAn1CAKCQi8E+s+NbaZlhLn1EdcsBtk1/MgCePc1G
+of1P6y/mZtAMDRUMWkuWsFg=
+=5Aur
+-----END PGP SIGNATURE-----
diff --git a/dev-python/pygments/files/digest-pygments-0.7.1 b/dev-python/pygments/files/digest-pygments-0.7.1
new file mode 100644 (file)
index 0000000..43b4d28
--- /dev/null
@@ -0,0 +1,3 @@
+MD5 8b5b50fb53ce39f94dbcf7040c0a441a Pygments-0.7.1.tar.gz 664696
+RMD160 5bf587c4496ff5330d16e1c73265d653b6ddf9b5 Pygments-0.7.1.tar.gz 664696
+SHA256 932866bde0019c370c36232d877c223a5f1d275c3161806552cb123d6f5d3638 Pygments-0.7.1.tar.gz 664696
diff --git a/dev-python/pygments/files/pygments-0.7.1-_mapping.py-ebuild.patch b/dev-python/pygments/files/pygments-0.7.1-_mapping.py-ebuild.patch
new file mode 100644 (file)
index 0000000..0b4a7d5
--- /dev/null
@@ -0,0 +1,11 @@
+--- pygments/lexers/_mapping.py.orig   2007-04-14 10:37:23.000000000 -0700
++++ pygments/lexers/_mapping.py        2007-04-14 10:38:18.000000000 -0700
+@@ -16,7 +16,7 @@
+ LEXERS = {
+     'ApacheConfLexer': ('pygments.lexers.text', 'ApacheConf', ('apacheconf', 'aconf', 'apache'), ('.htaccess', 'apache.conf', 'apache2.conf'), ('text/x-apacheconf',)),
+     'BBCodeLexer': ('pygments.lexers.text', 'BBCode', ('bbcode',), (), ('text/x-bbcode',)),
+-    'BashLexer': ('pygments.lexers.other', 'Bash', ('bash', 'sh'), ('*.sh',), ('application/x-sh', 'application/x-shellscript')),
++    'BashLexer': ('pygments.lexers.other', 'Bash', ('bash', 'sh', 'ebuild'), ('*.sh','*.ebuild',), ('application/x-sh', 'application/x-shellscript')),
+     'BatchLexer': ('pygments.lexers.other', 'Batchfile', ('bat',), ('*.bat', '*.cmd'), ('application/x-dos-batch',)),
+     'BefungeLexer': ('pygments.lexers.other', 'Befunge', ('befunge',), ('*.befunge',), ('application/x-befunge',)),
+     'BooLexer': ('pygments.lexers.dotnet', 'Boo', ('boo',), ('*.boo',), ('text/x-boo',)),
diff --git a/dev-python/pygments/files/pygments-0.7.1-html_formatter.patch b/dev-python/pygments/files/pygments-0.7.1-html_formatter.patch
new file mode 100644 (file)
index 0000000..8ddb6e8
--- /dev/null
@@ -0,0 +1,86 @@
+Index: /pygments/trunk/tests/test_html_formatter.py\r
+===================================================================\r
+--- tests/test_html_formatter.py (revision 2849)\r
++++ tests/test_html_formatter.py (revision 2850)\r
+@@ -94,2 +94,16 @@\r
\r
+         os.unlink(pathname)\r
++\r
++    def test_get_style_defs(self):\r
++        fmt = HtmlFormatter()\r
++        sd = fmt.get_style_defs()\r
++        self.assert_(sd.startswith('.'))\r
++        \r
++        fmt = HtmlFormatter(cssclass='foo')\r
++        sd = fmt.get_style_defs()\r
++        self.assert_(sd.startswith('.foo'))\r
++        sd = fmt.get_style_defs('.bar')\r
++        self.assert_(sd.startswith('.bar'))\r
++        sd = fmt.get_style_defs(['.bar', '.baz'])\r
++        fl = sd.splitlines()[0]\r
++        self.assert_('.bar' in fl and '.baz' in fl)\r
+Index: /pygments/trunk/pygments/formatters/html.py\r
+===================================================================\r
+--- pygments/formatters/html.py (revision 2839)\r
++++ pygments/formatters/html.py (revision 2850)\r
+@@ -182,4 +182,6 @@\r
+     `cssclass`\r
+         CSS class for the wrapping ``<div>`` tag (default: ``'highlight'``).\r
++        If you set this option, the default selector for `get_style_defs()`\r
++        will be this class.\r
\r
+     `cssstyles`\r
+@@ -314,10 +316,12 @@\r
+                 c2s[name] = (style[:-2], ttype, len(ttype))\r
\r
+-    def get_style_defs(self, arg=''):\r
+-        """\r
+-        Return CSS style definitions for the classes produced by the\r
+-        current highlighting style. ``arg`` can be a string of selectors\r
+-        to insert before the token type classes.\r
+-        """\r
++    def get_style_defs(self, arg=None):\r
++        """\r
++        Return CSS style definitions for the classes produced by the current\r
++        highlighting style. ``arg`` can be a string or list of selectors to\r
++        insert before the token type classes.\r
++        """\r
++        if arg is None:\r
++            arg = ('cssclass' in self.options and '.'+self.cssclass or '')\r
+         if isinstance(arg, basestring):\r
+             args = [arg]\r
+@@ -326,7 +330,9 @@\r
\r
+         def prefix(cls):\r
++            if cls:\r
++                cls = '.' + cls\r
+             tmp = []\r
+             for arg in args:\r
+-                tmp.append((arg and arg + ' ' or '') + '.' + cls)\r
++                tmp.append((arg and arg + ' ' or '') + cls)\r
+             return ', '.join(tmp)\r
\r
+@@ -343,5 +349,5 @@\r
+                 text_style = ' ' + self.class2style[self.ttype2class[Text]][0]\r
+             lines.insert(0, '%s { background: %s;%s }' %\r
+-                         (arg, self.style.background_color, text_style))\r
++                         (prefix(''), self.style.background_color, text_style))\r
+         return '\n'.join(lines)\r
\r
+Index: /pygments/trunk/CHANGES\r
+===================================================================\r
+--- CHANGES (revision 2844)\r
++++ CHANGES (revision 2850)\r
+@@ -1,4 +1,12 @@\r
+ Pygments changelog\r
+ ==================\r
++\r
++Version 0.8\r
++-----------\r
++(codename to be selected, released Apr XX, 2007)\r
++\r
++- The `get_style_defs` method of HTML formatters now uses the `cssclass`\r
++  option as the default selector if it was given.\r
++\r
\r
+ Version 0.7.1\r
diff --git a/dev-python/pygments/files/pygments-0.7.1-other.py-ebuild.patch b/dev-python/pygments/files/pygments-0.7.1-other.py-ebuild.patch
new file mode 100644 (file)
index 0000000..e988a11
--- /dev/null
@@ -0,0 +1,11 @@
+--- pygments/lexers/other.py.orig      2007-04-14 10:37:15.000000000 -0700
++++ pygments/lexers/other.py   2007-04-14 10:37:46.000000000 -0700
+@@ -205,7 +205,7 @@
+     """
+     name = 'Bash'
+-    aliases = ['bash', 'sh']
++    aliases = ['bash', 'sh', 'ebuild']
+     filenames = ['*.sh']
+     mimetypes = ['application/x-sh', 'application/x-shellscript']
diff --git a/dev-python/pygments/metadata.xml b/dev-python/pygments/metadata.xml
new file mode 100644 (file)
index 0000000..30765ba
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <herd>python</herd>
+       <longdescription>Pygments is a syntax highlighting package written in Python. Pygments can output to html, bbcode, latex, rtf and other formats.</longdescription>
+</pkgmetadata>
diff --git a/dev-python/pygments/pygments-0.7.1.ebuild b/dev-python/pygments/pygments-0.7.1.ebuild
new file mode 100644 (file)
index 0000000..e30d775
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/pygments/pygments-0.7.1.ebuild,v 1.1 2007/04/14 17:54:00 pythonhead Exp $
+
+inherit eutils distutils
+
+MY_PN="Pygments"
+MY_P="${MY_PN}-${PV}"
+NEED_PYTHON=2.3
+
+DESCRIPTION="Pygments is a syntax highlighting package written in Python."
+HOMEPAGE="http://pygments.org/"
+SRC_URI="http://cheeseshop.python.org/packages/source/P/${MY_PN}/${MY_P}.tar.gz"
+LICENSE="BSD"
+KEYWORDS="~x86"
+SLOT="0"
+IUSE="doc"
+S=${WORKDIR}/${MY_P}
+PYTHON_MODNAME="pygments"
+DOCS="CHANGES"
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}
+       #Patch from upstream trunk, can be removed in 0.8 bump
+       epatch ${FILESDIR}/${P}-html_formatter.patch || die "Patch failed"
+       #Gentoo patches to make lexer recognize ebuilds as bash input
+       epatch ${FILESDIR}/${P}-other.py-ebuild.patch || die "Patch failed"
+       epatch ${FILESDIR}/${P}-_mapping.py-ebuild.patch || die "Patch failed"
+}
+
+src_install(){
+       distutils_src_install
+       use doc && dohtml -r docs/build/.
+}
+
+src_test() {
+       #Doesn't play nicely in portage sandbox, check if fixed in 0.8
+       rm tests/test_html_formatter.py
+       PYTHONPATH=. "${python}" tests/run.py || die "tests failed"
+}