2019-03-09 07:53:05 +00:00
|
|
|
from setuptools import setup, Extension
|
|
|
|
|
|
|
|
setup_args = dict(
|
|
|
|
name='tbxi',
|
|
|
|
version='0.1',
|
|
|
|
author='Elliot Nunn',
|
|
|
|
author_email='elliotnunn@fastmail.com',
|
|
|
|
description='Tools to compile and inspect Mac OS 8/9 NewWorld ROM images',
|
|
|
|
url='https://github.com/elliotnunn/tbxi',
|
|
|
|
classifiers=[
|
2019-05-05 13:33:24 +00:00
|
|
|
'Programming Language :: Python :: 3 :: Only',
|
2019-03-09 07:53:05 +00:00
|
|
|
'Programming Language :: C',
|
|
|
|
'Operating System :: OS Independent',
|
2019-05-05 13:33:24 +00:00
|
|
|
'Intended Audience :: Developers',
|
|
|
|
'Topic :: Software Development :: Build Tools',
|
|
|
|
'License :: OSI Approved :: MIT License',
|
2019-03-09 07:53:05 +00:00
|
|
|
],
|
|
|
|
packages=['tbxi'],
|
|
|
|
scripts=['bin/prclc', 'bin/prcldump'],
|
|
|
|
ext_modules=[Extension('tbxi.fast_lzss', ['speedups/fast_lzss.c'])],
|
|
|
|
)
|
|
|
|
|
|
|
|
# http://charlesleifer.com/blog/misadventures-in-python-packaging-optional-c-extensions/
|
|
|
|
|
|
|
|
# Yes, it might be a bit extreme to catch SystemExit to find a compiler error...
|
|
|
|
|
|
|
|
try:
|
|
|
|
setup(**setup_args)
|
|
|
|
except (SystemExit, Exception):
|
|
|
|
setup_args.pop('ext_modules')
|
|
|
|
setup(**setup_args)
|
|
|
|
else:
|
|
|
|
exit()
|