1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
--- setup.py.orig 2023-09-07 13:16:56 UTC
+++ setup.py
@@ -35,7 +35,7 @@ def read_define(path, macro):
def get_version():
""" 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')
@@ -128,7 +128,7 @@ class BuildExt(build_ext):
target_lang=language)
-NAME = 'Brotli'
+NAME = 'brotli'
VERSION = get_version()
@@ -177,96 +177,17 @@ EXT_MODULES = [
'_brotli',
sources=[
'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',
- 'c/dec/huffman.c',
- 'c/dec/state.c',
- 'c/enc/backward_references.c',
- 'c/enc/backward_references_hq.c',
- 'c/enc/bit_cost.c',
- 'c/enc/block_splitter.c',
- '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',
- 'c/enc/encode.c',
- 'c/enc/encoder_dict.c',
- 'c/enc/entropy_encode.c',
- 'c/enc/fast_log.c',
- 'c/enc/histogram.c',
- 'c/enc/literal_cost.c',
- 'c/enc/memory.c',
- 'c/enc/metablock.c',
- 'c/enc/static_dict.c',
- 'c/enc/utf8_util.c',
],
depends=[
- 'c/common/constants.h',
- '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',
- 'c/dec/huffman.h',
- 'c/dec/prefix.h',
- 'c/dec/state.h',
- 'c/enc/backward_references.h',
- 'c/enc/backward_references_hq.h',
- 'c/enc/backward_references_inc.h',
- 'c/enc/bit_cost.h',
- 'c/enc/bit_cost_inc.h',
- 'c/enc/block_encoder_inc.h',
- 'c/enc/block_splitter.h',
- 'c/enc/block_splitter_inc.h',
- 'c/enc/brotli_bit_stream.h',
- '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',
- 'c/enc/encoder_dict.h',
- 'c/enc/entropy_encode.h',
- 'c/enc/entropy_encode_static.h',
- 'c/enc/fast_log.h',
- 'c/enc/find_match_length.h',
- 'c/enc/hash.h',
- 'c/enc/hash_composite_inc.h',
- 'c/enc/hash_forgetful_chain_inc.h',
- 'c/enc/hash_longest_match64_inc.h',
- 'c/enc/hash_longest_match_inc.h',
- 'c/enc/hash_longest_match_quickly_inc.h',
- 'c/enc/hash_rolling_inc.h',
- 'c/enc/hash_to_binary_tree_inc.h',
- 'c/enc/histogram.h',
- 'c/enc/histogram_inc.h',
- 'c/enc/literal_cost.h',
- 'c/enc/memory.h',
- 'c/enc/metablock.h',
- 'c/enc/metablock_inc.h',
- 'c/enc/params.h',
- 'c/enc/prefix.h',
- 'c/enc/quality.h',
- 'c/enc/ringbuffer.h',
- 'c/enc/static_dict.h',
- 'c/enc/static_dict_lut.h',
- 'c/enc/utf8_util.h',
- 'c/enc/write_bits.h',
],
include_dirs=[
- 'c/include',
+ '%%LOCALBASE%%/include',
+ ],
+ libraries=[
+ 'brotlicommon', 'brotlidec', 'brotlienc',
+ ],
+ library_dirs=[
+ '%%LOCALBASE%%/lib',
]),
]
|