Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Commit fc4eb0d

Browse files
committed
Add pypi files
1 parent a29421d commit fc4eb0d

File tree

5 files changed

+169
-0
lines changed

5 files changed

+169
-0
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.idea
2+
build
3+
dist
4+
MANIFEST
5+
sphinxbase/swig/sphinxbase_wrap.c
6+
sphinxbase/swig/python/sphinxbase.py
7+
pocketsphinx/swig/pocketsphinx_wrap.c
8+
pocketsphinx/swig/python/pocketsphinx.py
9+
*.pyd
10+
*.egg-info

MANIFEST.in

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
recursive-include sphinxbase/include *.h
2+
recursive-include sphinxbase/src *.c
3+
recursive-include sphinxbase/src *.h
4+
recursive-include sphinxbase/swig *.i
5+
prune sphinxbase/include/s60
6+
prune sphinxbase/include/wince
7+
prune sphinxbase/include/android
8+
prune sphinxbase/src/sphinx_adtools
9+
prune sphinxbase/src/sphinx_cepview
10+
prune sphinxbase/src/sphinx_fe
11+
prune sphinxbase/src/sphinx_jsgf2fsg
12+
prune sphinxbase/src/sphinx_lmtools
13+
exclude sphinxbase/swig/python/sphinxbase.py
14+
recursive-include pocketsphinx/include *.h
15+
recursive-include pocketsphinx/src *.c
16+
recursive-include pocketsphinx/src *.h
17+
recursive-include pocketsphinx/swig *.i
18+
prune pocketsphinx/src/gst-plugin
19+
prune pocketsphinx/src/programs
20+
exclude pocketsphinx/swig/python/pocketsphinx.py
21+
readme.md

pypi.bat

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@echo off
2+
3+
rmdir build /S /Q
4+
rmdir dist /S /Q
5+
rmdir PyPocketSphinx.egg-info /S /Q
6+
7+
del sphinxbase\swig\python\sphinxbase.py /F /Q
8+
del sphinxbase\swig\sphinxbase_wrap.c /F /Q
9+
10+
del pocketsphinx\swig\python\pocketsphinx.py /F /Q
11+
del pocketsphinx\swig\pocketsphinx_wrap.c /F /Q
12+
13+
C:\Python27\python.exe setup.py bdist_egg upload
14+
C:\Python27_x64\python.exe setup.py bdist_egg upload
15+
C:\Python34\python.exe setup.py bdist_egg upload
16+
C:\Python34_x64\python.exe setup.py bdist_egg upload
17+
C:\Python27\python.exe setup.py bdist_wininst upload
18+
C:\Python27_x64\python.exe setup.py bdist_wininst upload
19+
C:\Python34\python.exe setup.py bdist_wininst upload
20+
C:\Python34_x64\python.exe setup.py bdist_wininst upload
21+
C:\Python27\python.exe setup.py bdist_wheel upload
22+
C:\Python34\python.exe setup.py bdist_wheel upload
23+
C:\Python27\python.exe setup.py sdist --formats=gztar upload
24+
C:\Python27\python.exe setup.py sdist --formats=zip upload
25+
pause

readme.md

Whitespace-only changes.

setup.py

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#!/usr/bin/env python
2+
# encoding: utf-8
3+
import os
4+
import sys
5+
from glob import glob
6+
try:
7+
from setuptools import setup, Extension
8+
from distutils.command.build import build
9+
from setuptools.command.install import install
10+
except Extension as err:
11+
from distutils.core import setup
12+
from distutils.extension import Extension
13+
from distutils.command.build import build
14+
from distutils.command.install import install
15+
16+
libsphinxbase = (
17+
[s for s in glob('sphinxbase/src/libsphinxbase/lm/*.c') if 'lm3g_templates.c' not in s] +
18+
glob('sphinxbase/src/libsphinxbase/feat/*.c') +
19+
glob('sphinxbase/src/libsphinxbase/util/*.c') +
20+
glob('sphinxbase/src/libsphinxbase/fe/*.c')
21+
)
22+
23+
libsphinxad = []
24+
25+
libpocketsphinx = glob('pocketsphinx/src/libpocketsphinx/*.c')
26+
27+
sb_headers = ['sphinxbase/include', 'sphinxbase/include/win32']
28+
ps_headers = ['pocketsphinx/include', 'sphinxbase/src/libpocketsphinx']
29+
30+
libraries = []
31+
32+
definitions = [
33+
('SPHINXBASE_EXPORTS', None),
34+
('POCKETSPHINX_EXPORTS', None),
35+
('HAVE_CONFIG_H', None),
36+
('_CRT_SECURE_NO_DEPRECATE', None),
37+
('_USRDLL', None),
38+
('SPHINXDLL', None)
39+
]
40+
41+
if sys.platform.startswith('linux'):
42+
pass
43+
elif sys.platform.startswith('win'):
44+
libsphinxad.extend(['sphinxbase/src/libsphinxad/play_win32.c', 'sphinxbase/src/libsphinxad/rec_win32.c'])
45+
libraries.append('winmm')
46+
definitions.extend([('WIN32', None), ('_WINDOWS', None), ('YY_NO_UNISTD_H', None)])
47+
elif sys.platform.startswith('darwin'):
48+
pass
49+
elif sys.platform == 'cygwin':
50+
libraries.append('iconv')
51+
52+
53+
class Build(build):
54+
def run(self):
55+
self.run_command('build_ext')
56+
build.run(self)
57+
58+
59+
class Install(install):
60+
def run(self):
61+
self.run_command('build_ext')
62+
install.run(self)
63+
64+
65+
def read(filename):
66+
return open(os.path.join(os.path.dirname(__file__), filename)).read()
67+
68+
69+
setup(
70+
name = 'PyPocketSphinx',
71+
version = '12608',
72+
description = 'Python interface to CMU SphinxBase and PocketSphinx libraries',
73+
long_description = read('readme.md'),
74+
author = 'Dmitry Prazdnichnov',
75+
author_email = 'dp@bambucha.org',
76+
maintainer = '',
77+
maintainer_email = '',
78+
url = 'https://github.com/bambocher/PyPocketSphinx',
79+
download_url = '',
80+
packages = ['sphinxbase', 'pocketsphinx'],
81+
ext_modules = [
82+
Extension(
83+
name = 'sphinxbase._sphinxbase',
84+
sources = libsphinxbase + libsphinxad + ['sphinxbase/swig/sphinxbase.i'],
85+
swig_opts = ['-modern'] + ['-I' + h for h in sb_headers] + ['-outdir', 'sphinxbase/swig/python'],
86+
include_dirs = sb_headers,
87+
libraries = libraries,
88+
define_macros = definitions
89+
),
90+
Extension(
91+
name = 'pocketsphinx._pocketsphinx',
92+
sources = libsphinxbase + libsphinxad + libpocketsphinx + ['pocketsphinx/swig/pocketsphinx.i'],
93+
swig_opts = ['-modern'] + ['-I' + h for h in sb_headers] + ['-I' + h for h in ps_headers] + ['-Isphinxbase/swig'] + ['-outdir', 'pocketsphinx/swig/python'],
94+
include_dirs = sb_headers + ps_headers,
95+
libraries = libraries,
96+
define_macros = definitions
97+
)
98+
],
99+
cmdclass = {'build': Build, 'install': Install},
100+
classifiers = [
101+
'License :: OSI Approved :: BSD License',
102+
'Operating System :: Microsoft :: Windows',
103+
'Programming Language :: Python :: 2.7',
104+
'Programming Language :: Python :: 3.4',
105+
],
106+
license = 'BSD',
107+
keywords = ['sphinxbase', 'pocketsphinx'],
108+
platforms = ['Windows'],
109+
package_dir = {
110+
'sphinxbase': 'sphinxbase/swig/python',
111+
'pocketsphinx': 'pocketsphinx/swig/python'
112+
}
113+
)

0 commit comments

Comments
 (0)