-
Notifications
You must be signed in to change notification settings - Fork 50
/
setup.py
93 lines (88 loc) · 4.3 KB
/
setup.py
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
#!/usr/bin/env python
# coding: utf-8
import glob
import os
from setuptools import Extension, setup
cchardet_dir = "src/cchardet/"
uchardet_dir = "src/ext/uchardet/src"
cchardet_sources = glob.glob(cchardet_dir + "*.cpp")
sources = cchardet_sources
uchardet_sources = [
os.path.join(uchardet_dir, "LangModels/LangArabicModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangBelarusianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangBulgarianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangCatalanModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangCroatianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangCzechModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangDanishModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangEnglishModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangEsperantoModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangEstonianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangFinnishModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangFrenchModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangGeorgianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangGermanModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangGreekModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangHebrewModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangHindiModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangHungarianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangIrishModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangItalianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangLatvianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangLithuanianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangMacedonianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangMalteseModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangNorwegianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangPolishModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangPortugueseModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangRomanianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangRussianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangSerbianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangSlovakModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangSloveneModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangSpanishModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangSwedishModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangThaiModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangTurkishModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangUkrainianModel.cpp"),
os.path.join(uchardet_dir, "LangModels/LangVietnameseModel.cpp"),
os.path.join(uchardet_dir, "CharDistribution.cpp"),
os.path.join(uchardet_dir, "JpCntx.cpp"),
os.path.join(uchardet_dir, "nsBig5Prober.cpp"),
os.path.join(uchardet_dir, "nsCharSetProber.cpp"),
os.path.join(uchardet_dir, "nsCJKDetector.cpp"),
os.path.join(uchardet_dir, "nsEscCharsetProber.cpp"),
os.path.join(uchardet_dir, "nsEscSM.cpp"),
os.path.join(uchardet_dir, "nsEUCJPProber.cpp"),
os.path.join(uchardet_dir, "nsEUCKRProber.cpp"),
os.path.join(uchardet_dir, "nsEUCTWProber.cpp"),
os.path.join(uchardet_dir, "nsGB2312Prober.cpp"),
os.path.join(uchardet_dir, "nsHebrewProber.cpp"),
os.path.join(uchardet_dir, "nsJohabProber.cpp"),
os.path.join(uchardet_dir, "nsLanguageDetector.cpp"),
os.path.join(uchardet_dir, "nsLatin1Prober.cpp"),
os.path.join(uchardet_dir, "nsMBCSGroupProber.cpp"),
os.path.join(uchardet_dir, "nsMBCSSM.cpp"),
os.path.join(uchardet_dir, "nsSBCharSetProber.cpp"),
os.path.join(uchardet_dir, "nsSBCSGroupProber.cpp"),
os.path.join(uchardet_dir, "nsSJISProber.cpp"),
os.path.join(uchardet_dir, "nsUniversalDetector.cpp"),
os.path.join(uchardet_dir, "nsUTF8Prober.cpp"),
os.path.join(uchardet_dir, "uchardet.cpp"),
]
sources += uchardet_sources
setup(
package_dir={"": "src"},
packages=[
"cchardet",
],
ext_modules=[
Extension(
"cchardet._cchardet",
sources=sources,
include_dirs=[uchardet_dir],
language="c++",
extra_compile_args=['-std=c++11'],
)
],
)