guetzli-recursively-gui/.eggs/py2app-0.12-py3.6.egg/py2app/recipes/pyenchant.py
2017-04-20 00:57:59 +02:00

29 lines
970 B
Python

"""
Recipe for pyEnchant <http://pypi.python.org/pypi/pyenchant>
PyEnchant is a python library that wraps a C library
using ctypes, hence the usual way to find the library
won't work.
"""
import os
def check(cmd, mf):
m = mf.findNode('enchant')
if m is None or m.filename is None:
return None
if 'PYENCHANT_LIBRARY_PATH' in os.environ:
libpath = os.environ['PYENCHANT_LIBRARY_PATH']
print("WARNING: using pyEnchant without embedding")
print("WARNING: this is not supported at the moment")
else:
path = os.path.dirname(m.filename)
if not os.path.exists(os.path.join(path, "lib", "libenchant.1.dylib")):
print("WARNING: using pyEnchant without embedding")
print("WARNING: this is not supported at the moment")
# Include the entire package outside of site-packages.zip,
# mostly to avoid trying to extract the C code from the package
return dict(packages=['enchant'])