[arch-commits] Commit in python-pygments/repos/community-any (5 files)

Evangelos Foutras foutrelis at nymeria.archlinux.org
Wed Jul 2 15:02:24 UTC 2014


    Date: Wednesday, July 2, 2014 @ 17:02:24
  Author: foutrelis
Revision: 114650

archrelease: copy trunk to community-any

Added:
  python-pygments/repos/community-any/PKGBUILD
    (from rev 114649, python-pygments/trunk/PKGBUILD)
  python-pygments/repos/community-any/make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch
    (from rev 114649, python-pygments/trunk/make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch)
  python-pygments/repos/community-any/python-pygments.install
    (from rev 114649, python-pygments/trunk/python-pygments.install)
Deleted:
  python-pygments/repos/community-any/PKGBUILD
  python-pygments/repos/community-any/python-pygments.install

--------------------------------------------------------------------+
 PKGBUILD                                                           |  120 +++++-----
 make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch |   29 ++
 python-pygments.install                                            |   14 -
 3 files changed, 100 insertions(+), 63 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2014-07-02 15:02:15 UTC (rev 114649)
+++ PKGBUILD	2014-07-02 15:02:24 UTC (rev 114650)
@@ -1,56 +0,0 @@
-# $Id$
-# Maintainer: Evangelos Foutras <evangelos at foutrelis.com>
-# Contributor: Timm Preetz <timm at preetz.us>
-
-pkgname=('python-pygments' 'python2-pygments')
-pkgver=1.6
-pkgrel=3
-pkgdesc="Python syntax highlighter"
-arch=('any')
-url="http://pygments.org/"
-license=('BSD')
-makedepends=('python-setuptools' 'python2-setuptools')
-options=('!emptydirs')
-source=(http://pypi.python.org/packages/source/P/Pygments/Pygments-$pkgver.tar.gz)
-sha256sums=('799ed4caf77516e54440806d8d9cd82a7607dfdf4e4fb643815171a4b5c921c0')
-
-build() {
-  cd "$srcdir"
-
-  rm -rf python{2,3}-build
-  for builddir in python{2,3}-build; do
-    cp -r Pygments-$pkgver $builddir
-    pushd $builddir
-    ${builddir%-build} setup.py build
-    popd
-  done
-}
-
-package_python-pygments() {
-  depends=('python-setuptools')
-  install=python-pygments.install
-
-  cd "$srcdir/python3-build"
-
-  python3 setup.py install --root="$pkgdir" -O1
-
-  # pygmentize has been moved to the python2-pygments package
-  rm "$pkgdir/usr/bin/pygmentize"
-
-  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}
-
-package_python2-pygments() {
-  depends=('python2-setuptools')
-
-  cd "$srcdir/python2-build"
-
-  python2 setup.py install --root="$pkgdir" -O1
-
-  install -Dm644 external/pygments.bashcomp \
-    "$pkgdir/usr/share/bash-completion/completions/pygmentize"
-
-  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}
-
-# vim:set ts=2 sw=2 et:

Copied: python-pygments/repos/community-any/PKGBUILD (from rev 114649, python-pygments/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2014-07-02 15:02:24 UTC (rev 114650)
@@ -0,0 +1,64 @@
+# $Id$
+# Maintainer: Evangelos Foutras <evangelos at foutrelis.com>
+# Contributor: Timm Preetz <timm at preetz.us>
+
+pkgname=('python-pygments' 'python2-pygments')
+pkgver=1.6
+pkgrel=4
+pkgdesc="Python syntax highlighter"
+arch=('any')
+url="http://pygments.org/"
+license=('BSD')
+makedepends=('python-setuptools' 'python2-setuptools')
+options=('!emptydirs')
+source=(https://pypi.python.org/packages/source/P/Pygments/Pygments-$pkgver.tar.gz
+        make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch)
+sha256sums=('799ed4caf77516e54440806d8d9cd82a7607dfdf4e4fb643815171a4b5c921c0'
+            '15cf8323ce343d32cbf78d35ab20001ce3204abe90b68a80607c7aea41499f07')
+
+prepare() {
+  cd "$srcdir/Pygments-$pkgver"
+
+  patch -Np1 -i "$srcdir/make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch"
+}
+
+build() {
+  cd "$srcdir"
+
+  rm -rf python{2,3}-build
+  for builddir in python{2,3}-build; do
+    cp -r Pygments-$pkgver $builddir
+    pushd $builddir
+    ${builddir%-build} setup.py build
+    popd
+  done
+}
+
+package_python-pygments() {
+  depends=('python-setuptools')
+  install=python-pygments.install
+
+  cd "$srcdir/python3-build"
+
+  python3 setup.py install --root="$pkgdir" -O1
+
+  # pygmentize has been moved to the python2-pygments package
+  rm "$pkgdir/usr/bin/pygmentize"
+
+  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+package_python2-pygments() {
+  depends=('python2-setuptools')
+
+  cd "$srcdir/python2-build"
+
+  python2 setup.py install --root="$pkgdir" -O1
+
+  install -Dm644 external/pygments.bashcomp \
+    "$pkgdir/usr/share/bash-completion/completions/pygmentize"
+
+  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+# vim:set ts=2 sw=2 et:

Copied: python-pygments/repos/community-any/make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch (from rev 114649, python-pygments/trunk/make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch)
===================================================================
--- make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch	                        (rev 0)
+++ make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch	2014-07-02 15:02:24 UTC (rev 114650)
@@ -0,0 +1,29 @@
+# HG changeset patch
+# User goodwillcoding <goodwillcoding at webhippo.net>
+# Date 1376769053 25200
+# Node ID c31841d2fd2171419134f30e815dcafb1e8c7eee
+# Parent  7304e4759ae65343d89a51359ca538912519cc31
+Make pygments.lexers.guess_lexer_for_filename py3 compatible.
+Background:
+In py3 one can longer sort classes by class names
+the fix addes a custome sorting function that works
+the same in py2 and py3
+
+diff --git a/pygments/lexers/__init__.py b/pygments/lexers/__init__.py
+--- a/pygments/lexers/__init__.py
++++ b/pygments/lexers/__init__.py
+@@ -188,7 +188,13 @@
+         if rv == 1.0:
+             return lexer(**options)
+         result.append((rv, lexer))
+-    result.sort()
++
++    # since py3 can no longer sort by class name by default, here is the
++    # sorting function that works in both
++    def type_sort(type_):
++        return (type_[0], type_[1].__name__)
++    result.sort(key=type_sort)
++
+     if not result[-1][0] and primary is not None:
+         return primary(**options)
+     return result[-1][1](**options)

Deleted: python-pygments.install
===================================================================
--- python-pygments.install	2014-07-02 15:02:15 UTC (rev 114649)
+++ python-pygments.install	2014-07-02 15:02:24 UTC (rev 114650)
@@ -1,7 +0,0 @@
-post_upgrade() {
-  if (($(vercmp $2 1.4-5) < 0)); then
-    echo '/usr/bin/pygmentize has been moved to the python2-pygments package'
-  fi
-}
-
-# vim:set ts=2 sw=2 et:

Copied: python-pygments/repos/community-any/python-pygments.install (from rev 114649, python-pygments/trunk/python-pygments.install)
===================================================================
--- python-pygments.install	                        (rev 0)
+++ python-pygments.install	2014-07-02 15:02:24 UTC (rev 114650)
@@ -0,0 +1,7 @@
+post_upgrade() {
+  if (($(vercmp $2 1.4-5) < 0)); then
+    echo '/usr/bin/pygmentize has been moved to the python2-pygments package'
+  fi
+}
+
+# vim:set ts=2 sw=2 et:




More information about the arch-commits mailing list