summaryrefslogtreecommitdiff
path: root/external/bsd/tre/dist/python/setup.py.in
diff options
context:
space:
mode:
authorrin <rin@NetBSD.org>2017-11-17 16:11:11 +0000
committerrin <rin@NetBSD.org>2017-11-17 16:11:11 +0000
commit5b042ff1c6fb488a60b35fea15bef04fc4ffc7cd (patch)
treee6d308edffcf18c659373a4950ec0808ac9f7a5a /external/bsd/tre/dist/python/setup.py.in
parent051d2cffd12a265f76b86ad11c7a720e6ecb2e19 (diff)
Import tre from https://github.com/laurikari/tre as of 10171117:
- tre_reg*b() functions are added, that take bytes literally. - minor bug fixes
Diffstat (limited to 'external/bsd/tre/dist/python/setup.py.in')
-rw-r--r--external/bsd/tre/dist/python/setup.py.in39
1 files changed, 39 insertions, 0 deletions
diff --git a/external/bsd/tre/dist/python/setup.py.in b/external/bsd/tre/dist/python/setup.py.in
new file mode 100644
index 00000000000..681b613f7e2
--- /dev/null
+++ b/external/bsd/tre/dist/python/setup.py.in
@@ -0,0 +1,39 @@
+# setup.py - Builds and installs the TRE Python language bindings module
+#
+# Copyright (c) 2009 Ville Laurikari <ville@laurikari.net>
+#
+
+import distutils.sysconfig
+from distutils.core import setup, Extension
+import sys
+import os
+import shutil
+
+version = "@TRE_VERSION@"
+data_files = []
+include_dirs = ["../lib"]
+libraries = ["tre"]
+
+if sys.platform == "win32":
+ # Place tre.dll in site-packages, next to tre.pyd.
+ data_files = [(distutils.sysconfig.get_python_lib(), ["tre.dll"])]
+ include_dirs += ["../win32"]
+ shutil.copy("../win32/Release/tre.dll", ".")
+ libraries = ["../win32/Release/tre"]
+
+setup(name = "tre",
+ version = version,
+ description = "Python module for TRE",
+ author = "Ville Laurikari",
+ author_email = "ville@laurikari.net",
+ license = "2-clause BSD",
+ url = "http://laurikari.net/tre/",
+ data_files = data_files,
+ ext_modules = [Extension("tre",
+ sources = ["tre-python.c"],
+ define_macros = [("HAVE_CONFIG_H", None)],
+ include_dirs = include_dirs,
+ libraries = libraries
+ ),
+ ],
+ )