aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py.in
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-03-07 05:10:02 +0100
committerTristan Gingold <tgingold@free.fr>2018-03-07 05:10:02 +0100
commitf94f726d515bcf48c50752a3487441fad629ee13 (patch)
tree8f8ddfcdc4f1aa5e825a51a26d6b63bbfcd3f2fb /setup.py.in
parent0e9e1f63cdf19dc45804d7b8728698f879489ee9 (diff)
downloadghdl-f94f726d515bcf48c50752a3487441fad629ee13.tar.gz
ghdl-f94f726d515bcf48c50752a3487441fad629ee13.tar.bz2
ghdl-f94f726d515bcf48c50752a3487441fad629ee13.zip
configure: add --enable-python
Diffstat (limited to 'setup.py.in')
-rw-r--r--setup.py.in43
1 files changed, 43 insertions, 0 deletions
diff --git a/setup.py.in b/setup.py.in
new file mode 100644
index 000000000..57f997084
--- /dev/null
+++ b/setup.py.in
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+
+from distutils.core import setup, Extension
+import distutils.file_util
+import distutils.dir_util
+from distutils.command.build import build
+import os
+import os.path
+
+class GHDLBuild(build):
+ def my_copy_tree(self, src, dst):
+ """Tuned version of copy_tree: exclude .o files"""
+ distutils.dir_util.mkpath(dst, verbose=True)
+
+ for n in os.listdir(src):
+ src_name = os.path.join(src, n)
+ dst_name = os.path.join(dst, n)
+
+ if os.path.isdir(src_name):
+ self.my_copy_tree(src_name, dst_name)
+ elif not src_name.endswith(".o"):
+ distutils.file_util.copy_file(src_name, dst_name)
+
+ def run(self):
+ # Run original build code
+ build.run(self)
+
+ # Copy VHDL libraries & shared library
+ dstdir = os.path.join(self.build_lib, 'libghdl')
+ distutils.file_util.copy_file("libghdl" + "@SOEXT@", dstdir)
+ self.my_copy_tree(os.path.join("lib", "ghdl"),
+ os.path.join(dstdir, "ghdl"))
+
+setup (name='libghdl',
+ version='0.35',
+ description = 'Interface to ghdl, a VHDL analyzer',
+ author = 'Tristan Gingold',
+ author_email = 'tgingold@free.fr',
+ url = 'github.com/ghdl/ghdl',
+ package_dir = {'libghdl' : 'src/vhdl/python/libghdl'},
+ packages = ['libghdl'],
+ cmdclass = {
+ 'build': GHDLBuild})