2015-03-24 03:49:56 -04:00
|
|
|
""" myhdl's distribution and installation script. """
|
2003-01-30 12:19:52 +00:00
|
|
|
|
2015-03-24 03:57:27 -04:00
|
|
|
import ast
|
2015-03-29 10:46:15 -04:00
|
|
|
import fnmatch
|
2015-03-24 03:57:27 -04:00
|
|
|
import re
|
2015-03-29 10:46:15 -04:00
|
|
|
import os
|
2003-01-30 17:19:02 +00:00
|
|
|
import sys
|
|
|
|
|
2015-03-29 10:46:15 -04:00
|
|
|
from collections import defaultdict
|
|
|
|
|
2015-03-24 03:49:56 -04:00
|
|
|
if sys.version_info < (2, 6) or (3, 0) <= sys.version_info < (3, 4):
|
|
|
|
raise RuntimeError("Python version 2.6, 2.7 or >= 3.4 required.")
|
2006-03-08 16:04:18 +00:00
|
|
|
|
2003-01-23 23:21:31 +00:00
|
|
|
|
2015-03-24 03:49:56 -04:00
|
|
|
# Prefer setuptools over distutils
|
2003-01-30 17:19:02 +00:00
|
|
|
try:
|
2015-03-24 03:49:56 -04:00
|
|
|
from setuptools import setup
|
|
|
|
except ImportError:
|
|
|
|
from distutils.core import setup
|
|
|
|
|
2015-03-24 03:57:27 -04:00
|
|
|
|
|
|
|
_version_re = re.compile(r'__version__\s+=\s+(.*)')
|
|
|
|
|
|
|
|
with open('myhdl/__init__.py', 'rb') as f:
|
|
|
|
version = str(ast.literal_eval(_version_re.search(
|
|
|
|
f.read().decode('utf-8')).group(1)))
|
|
|
|
|
2015-03-29 10:46:15 -04:00
|
|
|
data_root = 'share/myhdl'
|
|
|
|
cosim_data = defaultdict(list)
|
|
|
|
for base, dir, files in os.walk('cosimulation'):
|
|
|
|
for pat in ('*.c', 'Makefile*', '*.py', '*.v', '*.txt'):
|
|
|
|
good = fnmatch.filter(files, pat)
|
|
|
|
if good:
|
2015-03-29 11:23:22 -04:00
|
|
|
cosim_data[base].extend(os.path.join(base, f) for f in good)
|
2015-03-24 03:57:27 -04:00
|
|
|
|
2015-03-24 03:49:56 -04:00
|
|
|
setup(
|
|
|
|
name="myhdl",
|
2015-03-24 03:57:27 -04:00
|
|
|
version=version,
|
2015-03-24 03:49:56 -04:00
|
|
|
description="Python as a Hardware Description Language",
|
|
|
|
long_description="See home page.",
|
|
|
|
author="Jan Decaluwe",
|
|
|
|
author_email="jan@jandecaluwe.com",
|
|
|
|
url="http://www.myhdl.org",
|
|
|
|
packages=['myhdl', 'myhdl.conversion'],
|
2015-03-29 10:46:15 -04:00
|
|
|
data_files=[(os.path.join(data_root, k), v) for k, v in cosim_data.items()],
|
2015-03-24 03:49:56 -04:00
|
|
|
license="LGPL",
|
|
|
|
platforms='any',
|
|
|
|
keywords="HDL ASIC FPGA hardware design",
|
|
|
|
classifiers=[
|
|
|
|
'Development Status :: 5 - Production/Stable',
|
|
|
|
'Intended Audience :: Developers',
|
|
|
|
'Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)',
|
|
|
|
'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)',
|
|
|
|
'Operating System :: OS Independent',
|
|
|
|
'Programming Language :: Python',
|
|
|
|
'Programming Language :: Python :: 2',
|
|
|
|
'Programming Language :: Python :: 2.6',
|
|
|
|
'Programming Language :: Python :: 2.7',
|
|
|
|
'Programming Language :: Python :: 3',
|
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
]
|
|
|
|
)
|