forked from pool/python-virtkey
Copy from home:vuntz/python-virtkey via accept of submit request 37115 revision 6. Request was accepted with message: Fine... OBS-URL: https://build.opensuse.org/request/show/37115 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-virtkey?expand=0&rev=1
31 lines
1.3 KiB
Diff
31 lines
1.3 KiB
Diff
Index: python-virtkey-0.50/setup.py
|
|
===================================================================
|
|
--- python-virtkey-0.50.orig/setup.py
|
|
+++ python-virtkey-0.50/setup.py
|
|
@@ -1,10 +1,23 @@
|
|
#!/usr/bin/python
|
|
|
|
from distutils.core import setup, Extension
|
|
+import commands
|
|
+
|
|
+# From http://code.activestate.com/recipes/502261-python-distutils-pkg-config/
|
|
+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():
|
|
+ if flag_map.has_key(token[:2]):
|
|
+ kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
|
|
+ else: # throw others to extra_link_args
|
|
+ kw.setdefault('extra_link_args', []).append(token)
|
|
+ for k, v in kw.iteritems(): # remove duplicated
|
|
+ kw[k] = list(set(v))
|
|
+ return kw
|
|
+
|
|
setup(name="virtkey",
|
|
ext_modules=[Extension("virtkey",
|
|
- ["python-virtkey.c","ucs2keysym.c"],include_dirs=['/usr/include/gtk-2.0', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include', '/usr/include/pango-1.0', '/usr/lib/gtk-2.0/include', '/usr/include/cairo'],
|
|
- libraries=["X11","Xtst","glib-2.0","gdk-x11-2.0"]
|
|
+ ["python-virtkey.c","ucs2keysym.c"], **pkgconfig('glib-2.0', 'gdk-2.0', 'x11', 'xtst')
|
|
)],
|
|
version="0.01"
|
|
)
|