aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-09-16 20:07:18 -0400
committerJesse Luehrs <doy@tozt.net>2014-09-16 20:07:18 -0400
commita80e1a9a8863235102faf5250d3021065d1eea1f (patch)
tree3a82297855a8fd10bd0a5b20bb690c09e982aec1 /setup.py
parent408785e25250ad1a6f15b385849ee2cd29d19d4e (diff)
downloadlibvt100-python-a80e1a9a8863235102faf5250d3021065d1eea1f.tar.gz
libvt100-python-a80e1a9a8863235102faf5250d3021065d1eea1f.zip
start writing a c shim
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..f80af6f
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,32 @@
+from distutils.core import setup, Extension
+import subprocess
+
+# http://code.activestate.com/recipes/502261-python-distutils-pkg-config/
+def pkgconfig(*packages, **kw):
+ flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
+ args = ["pkg-config", "--libs", "--cflags"]
+ args.extend(packages)
+ for token in subprocess.check_output(args).split():
+ token = token.decode('utf-8')
+ kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
+ return kw
+
+setup(
+ name="vt100",
+ version="0.0.1",
+ description="an in-memory terminal parsing library",
+ author="Jesse Luehrs",
+ author_email="doy@tozt.net",
+ url="https://github.com/doy/vt100/",
+ ext_modules=[
+ Extension(
+ name="vt100",
+ sources=[
+ "vt100module.c",
+ "libvt100/src/screen.c",
+ "libvt100/src/parser.c"
+ ],
+ **pkgconfig('glib-2.0')
+ )
+ ],
+)