archivers/py-brotli: Update to 1.1.0

- Convert to USE_PYTHON=pep517

Changes:	https://github.com/google/brotli/releases
This commit is contained in:
Po-Chuan Hsieh 2023-09-11 11:08:05 +08:00
parent 243c6ee72e
commit 821a031c39
No known key found for this signature in database
GPG key ID: 9A4BD10F002DD04B
4 changed files with 47 additions and 28 deletions

View file

@ -1,6 +1,5 @@
PORTNAME= brotli
PORTVERSION= 1.0.9
PORTREVISION= 1
PORTVERSION= 1.1.0
CATEGORIES= archivers python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -13,25 +12,22 @@ WWW= https://github.com/google/brotli
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= brotli>=${PORTVERSION}:archivers/brotli
BUILD_DEPENDS= brotli>=${PORTVERSION},1<${PORTVERSION}_99,1:archivers/brotli \
${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
LIB_DEPENDS= libbrotlicommon.so:archivers/brotli
USES= compiler:c++0x cpe pkgconfig python shebangfix zip
USE_PYTHON= autoplist concurrent distutils
USES= cpe python
USE_PYTHON= autoplist concurrent pep517
CPE_VENDOR= google
SHEBANG_FILES= python/bro.py
post-patch:
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/setup.py
@${MKDIR} ${WRKSRC}/common/
@${MV} ${WRKSRC}/c/common/version.h ${WRKSRC}/
# Clean up bundled libraries
@${RM} -r ${WRKSRC}/c/
pre-configure:
@${PRINTF} "#define BROTLI_VERSION 0x%x%03x%03x\n" `pkgconf --modversion libbrotlicommon | sed 's|\.| |g'` > ${WRKSRC}/common/version.h
post-install:
${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1598605172
SHA256 (Brotli-1.0.9.zip) = 4d1b810aa0ed773f81dceda2cc7b403d01057458730e309856356d4ef4188438
SIZE (Brotli-1.0.9.zip) = 510202
TIMESTAMP = 1694348256
SHA256 (Brotli-1.1.0.tar.gz) = 81de08ac11bcb85841e440c13611c00b67d3bf82698314928d0b676362546724
SIZE (Brotli-1.1.0.tar.gz) = 7372270

View file

@ -0,0 +1,19 @@
--- MANIFEST.in.orig 2023-09-09 22:24:31 UTC
+++ MANIFEST.in
@@ -1,11 +1,4 @@
include CONTRIBUTING.md
-include c/common/*.c
-include c/common/*.h
-include c/dec/*.c
-include c/dec/*.h
-include c/enc/*.c
-include c/enc/*.h
-include c/include/brotli/*.h
include LICENSE
include MANIFEST.in
include python/_brotli.cc
@@ -16,4 +9,3 @@ include python/tests/*
include README.md
include setup.py
include tests/testdata/*
-include c/tools/brotli.c

View file

@ -1,22 +1,23 @@
--- setup.py.orig 2020-08-27 06:24:08 UTC
--- setup.py.orig 2023-09-07 13:16:56 UTC
+++ setup.py
@@ -25,7 +25,7 @@ CURR_DIR = os.path.abspath(os.path.dirname(os.path.rea
@@ -35,7 +35,7 @@ def read_define(path, macro):
def get_version():
""" Return BROTLI_VERSION string as defined in 'common/version.h' file. """
- version_file_path = os.path.join(CURR_DIR, 'c', 'common', 'version.h')
+ version_file_path = os.path.join(CURR_DIR, 'common', 'version.h')
version = 0
with open(version_file_path, 'r') as f:
for line in f:
@@ -181,92 +181,17 @@ EXT_MODULES = [
""" Return library version string from 'common/version.h' file. """
- version_file_path = os.path.join(CURR_DIR, 'c', 'common', 'version.h')
+ version_file_path = os.path.join(CURR_DIR, 'version.h')
major = read_define(version_file_path, 'BROTLI_VERSION_MAJOR')
minor = read_define(version_file_path, 'BROTLI_VERSION_MINOR')
patch = read_define(version_file_path, 'BROTLI_VERSION_PATCH')
@@ -177,96 +177,17 @@ EXT_MODULES = [
'_brotli',
sources=[
'python/_brotli.cc',
'python/_brotli.c',
- 'c/common/constants.c',
- 'c/common/context.c',
- 'c/common/dictionary.c',
- 'c/common/platform.c',
- 'c/common/shared_dictionary.c',
- 'c/common/transform.c',
- 'c/dec/bit_reader.c',
- 'c/dec/decode.c',
@ -29,6 +30,7 @@
- 'c/enc/brotli_bit_stream.c',
- 'c/enc/cluster.c',
- 'c/enc/command.c',
- 'c/enc/compound_dictionary.c',
- 'c/enc/compress_fragment.c',
- 'c/enc/compress_fragment_two_pass.c',
- 'c/enc/dictionary_hash.c',
@ -48,6 +50,7 @@
- 'c/common/context.h',
- 'c/common/dictionary.h',
- 'c/common/platform.h',
- 'c/common/shared_dictionary_internal.h',
- 'c/common/transform.h',
- 'c/common/version.h',
- 'c/dec/bit_reader.h',
@ -66,6 +69,7 @@
- 'c/enc/cluster.h',
- 'c/enc/cluster_inc.h',
- 'c/enc/command.h',
- 'c/enc/compound_dictionary.h',
- 'c/enc/compress_fragment.h',
- 'c/enc/compress_fragment_two_pass.h',
- 'c/enc/dictionary_hash.h',
@ -99,13 +103,13 @@
],
include_dirs=[
- 'c/include',
+ '%%LOCALBASE%%/include',
+ '/usr/local/include',
+ ],
+ libraries=[
+ 'brotlicommon', 'brotlidec', 'brotlienc',
+ ],
+ library_dirs=[
+ '%%LOCALBASE%%/lib',
],
language='c++'),
+ '/usr/local/lib',
]),
]