Permalink
Browse files

Merge branch 'issue_6_python_refactor'

  • Loading branch information...
2 parents 14d74b5 + 0702266 commit 0ff3257b91342202c996be3db0547d453d47aa77 @mzsanford mzsanford committed Jan 12, 2012
@@ -0,0 +1,3 @@
+build
+dist
+MANIFEST
@@ -0,0 +1,3 @@
+include *.py
+include *.h
+include *.cc
View
@@ -0,0 +1,10 @@
+
+build:
+ python -u setup.py build
+
+install: build
+ sudo python -u setup.py install
+
+# Really? Can't test without install?
+test: install
+ python -u test.py
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,17 @@
+from distutils.core import setup, Extension
+import commands
+
+def pkgconfig(*packages, **kw):
+ flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
+ for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split():
+ kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
+ return kw
+
+module = Extension('cld',
+ ['pycldmodule.cc'],
+ **pkgconfig('cld'))
+
+setup(name='cld',
+ version='0.031415',
+ description='Python bindings around Google Chromium\'s embedded compact language detection library',
+ ext_modules = [module])
View
File renamed without changes.
File renamed without changes.
View
@@ -1,13 +0,0 @@
-from distutils.core import setup, Extension
-
-module = Extension('cld',
- language='c++',
- libraries=['cld'],
- include_dirs=['.'],
- library_dirs=['.'],
- sources=['pycldmodule.cc'])
-
-setup(name='cld',
- version='0.031415',
- description='Python bindings around Google Chromium\'s embedded compact language detection library',
- ext_modules = [module])

0 comments on commit 0ff3257

Please sign in to comment.