[arch-commits] Commit in python-brotlipy/repos (3 files)

Felix Yan felixonmars at archlinux.org
Fri Nov 10 15:43:19 UTC 2017


    Date: Friday, November 10, 2017 @ 15:43:18
  Author: felixonmars
Revision: 266123

archrelease: copy trunk to community-testing-x86_64

Added:
  python-brotlipy/repos/community-testing-x86_64/
  python-brotlipy/repos/community-testing-x86_64/PKGBUILD
    (from rev 266122, python-brotlipy/trunk/PKGBUILD)
  python-brotlipy/repos/community-testing-x86_64/shared-brotli.patch
    (from rev 266122, python-brotlipy/trunk/shared-brotli.patch)

---------------------+
 PKGBUILD            |   62 ++++++++++++++++++++
 shared-brotli.patch |  148 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 210 insertions(+)

Copied: python-brotlipy/repos/community-testing-x86_64/PKGBUILD (from rev 266122, python-brotlipy/trunk/PKGBUILD)
===================================================================
--- community-testing-x86_64/PKGBUILD	                        (rev 0)
+++ community-testing-x86_64/PKGBUILD	2017-11-10 15:43:18 UTC (rev 266123)
@@ -0,0 +1,62 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgbase=python-brotlipy
+pkgname=('python-brotlipy' 'python2-brotlipy')
+pkgver=0.7.0
+pkgrel=2
+pkgdesc='Python binding to the Brotli library'
+arch=('x86_64')
+license=('MIT')
+url='https://github.com/python-hyper/brotlipy'
+makedepends=('python-setuptools' 'python2-setuptools' 'python-cffi' 'python2-cffi' 'brotli06')
+checkdepends=('python-pytest-runner' 'python2-pytest-runner' 'python-hypothesis'
+              'python2-hypothesis' 'brotli06-testdata')
+source=("$pkgbase-$pkgver.tar.gz::https://github.com/python-hyper/brotlipy/archive/v$pkgver.tar.gz"
+        shared-brotli.patch)
+sha512sums=('bec8183cf3cc8ba9e594d1a86a8a33d88a6ac8e9c6a6287c837bda3726183ff1b486f2c49da4e489b5b3cb51b57dd5816413b59419920c2ced48435221f1beaf'
+            'fc472dfb857d223f1b40edb8182a34c22ed1a8ff02953de934a0cf3b223e072699b100e63bf3ba1848b312743dc302b781b71fcafb3117223439f65f97e334de')
+
+prepare() {
+  (cd brotlipy-$pkgver; patch -p1 -i ../shared-brotli.patch)
+  sed -i 's|^TEST_DATA_DIR = .*|TEST_DATA_DIR = "/usr/share/brotli06/testdata"|' brotlipy-$pkgver/test/conftest.py
+
+  cp -a "$srcdir"/brotlipy-$pkgver{,-py2}
+
+  export USE_SHARED_BROTLI=1
+  export CFLAGS="-I/usr/include/brotli06 -L/usr/lib/brotli06"
+}
+
+build() {
+  cd "$srcdir"/brotlipy-$pkgver
+  python setup.py build
+
+  cd "$srcdir"/brotlipy-$pkgver-py2
+  python2 setup.py build
+}
+
+check() {
+  cd "$srcdir"/brotlipy-$pkgver
+  python setup.py pytest
+
+  cd "$srcdir"/brotlipy-$pkgver-py2
+  python2 setup.py pytest
+}
+
+package_python-brotlipy() {
+  depends=('brotli06' 'python-cffi')
+
+  cd brotlipy-$pkgver
+  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
+
+package_python2-brotlipy() {
+  depends=('brotli06' 'python2-cffi')
+
+  cd brotlipy-$pkgver-py2
+  python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build
+  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
+
+# vim:set ts=2 sw=2 et:

Copied: python-brotlipy/repos/community-testing-x86_64/shared-brotli.patch (from rev 266122, python-brotlipy/trunk/shared-brotli.patch)
===================================================================
--- community-testing-x86_64/shared-brotli.patch	                        (rev 0)
+++ community-testing-x86_64/shared-brotli.patch	2017-11-10 15:43:18 UTC (rev 266123)
@@ -0,0 +1,148 @@
+commit ce0d620a03c494c437d989190fe321cc4b9b8b20
+Author: Felix Yan <felixonmars at archlinux.org>
+Date:   Tue Jun 6 19:16:36 2017 +0800
+
+    Allow to build with shared brotli
+    
+    It would be nice to allow building with shared brotli since we have one
+    in the repositories. This commit would not break the default
+    installation.
+
+diff --git a/.travis.yml b/.travis.yml
+index 3498f2b..2b3b7d9 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -13,12 +13,19 @@ cache:
+   pip: true
+   directories:
+     - $HOME/.ccache
+-    
++
++matrix:
++  include:
++    - python: "3.6"
++    - env: USE_SHARED_BROTLI=1
++    - sudo: true
++
+ env:
+   global:
+       - PATH="/usr/lib/ccache:$PATH"    
+ 
+ install:
++  - "if [[ $USE_SHARED_BROTLI == 1 ]]; then mkdir build; cd build; cmake ../libbrotli -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib; make; sudo make install; cd ..; fi"
+   - "pip install -U pip 'setuptools!=26.*'"
+   - "pip install ."
+   - "pip install -r test_requirements.txt"
+diff --git a/setup.py b/setup.py
+index 992261a..90d4a8b 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1,4 +1,5 @@
+ #!/usr/bin/env python
++import os
+ from setuptools import find_packages, setup
+ from setuptools.command.build_ext import build_ext
+ 
+@@ -22,37 +23,10 @@ class BuildClibBeforeExt(build_ext):
+         self.run_command("build_clib")
+         build_ext.run(self)
+ 
+-
+-setup(
+-    name="brotlipy",
+-    version="0.7.0",
+-
+-    description="Python binding to the Brotli library",
+-    long_description=long_description,
+-    url="https://github.com/python-hyper/brotlipy/",
+-    license="MIT",
+-
+-    author="Cory Benfield",
+-    author_email="cory at lukasa.co.uk",
+-
+-    setup_requires=[
+-        "cffi>=1.0.0",
+-    ],
+-    install_requires=[
+-        "cffi>=1.0.0",
+-    ],
+-    extras_require={
+-        ':python_version == "2.7" or python_version == "3.3"': ['enum34>=1.0.4, <2'],
+-    },
+-
+-    cffi_modules=["src/brotli/build.py:ffi"],
+-
+-    packages=find_packages('src'),
+-    package_dir={'': 'src'},
+-
+-    ext_package="brotli",
+-
+-    libraries=[
++libraries = []
++USE_SHARED_BROTLI = os.environ.get("USE_SHARED_BROTLI")
++if USE_SHARED_BROTLI != "1":
++    libraries = [
+         ("libbrotli", {
+             "include_dirs": [
+                 "libbrotli/include",
+@@ -84,7 +58,38 @@ setup(
+                 'libbrotli/enc/entropy_encode.c'
+             ]
+         }),
++    ]
++
++setup(
++    name="brotlipy",
++    version="0.7.0",
++
++    description="Python binding to the Brotli library",
++    long_description=long_description,
++    url="https://github.com/python-hyper/brotlipy/",
++    license="MIT",
++
++    author="Cory Benfield",
++    author_email="cory at lukasa.co.uk",
++
++    setup_requires=[
++        "cffi>=1.0.0",
++    ],
++    install_requires=[
++        "cffi>=1.0.0",
+     ],
++    extras_require={
++        ':python_version == "2.7" or python_version == "3.3"': ['enum34>=1.0.4, <2'],
++    },
++
++    cffi_modules=["src/brotli/build.py:ffi"],
++
++    packages=find_packages('src'),
++    package_dir={'': 'src'},
++
++    ext_package="brotli",
++
++    libraries=libraries,
+ 
+     zip_safe=False,
+ 
+diff --git a/src/brotli/build.py b/src/brotli/build.py
+index 562376e..0e1bb80 100644
+--- a/src/brotli/build.py
++++ b/src/brotli/build.py
+@@ -1,10 +1,16 @@
+ # -*- coding: utf-8 -*-
++import os
+ import sys
+ 
+ from cffi import FFI
+ ffi = FFI()
+ 
+-libraries = ['libbrotli']
++USE_SHARED_BROTLI = os.environ.get("USE_SHARED_BROTLI")
++if USE_SHARED_BROTLI != "1":
++    libraries = ['libbrotli']
++else:
++    libraries = ['brotlienc', 'brotlidec']
++
+ if 'win32' not in str(sys.platform).lower():
+     libraries.append('stdc++')
+ 


More information about the arch-commits mailing list