From 29c26448113c49a2133ff1410f242bf1aeb6e1dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= <jeremy@asynk.ch>
Date: Sun, 5 Jun 2011 08:35:13 +0200
Subject: fix pyk8055/setup.py

---
 pyk8055/setup.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/pyk8055/setup.py b/pyk8055/setup.py
index 9b68581..a59e981 100644
--- a/pyk8055/setup.py
+++ b/pyk8055/setup.py
@@ -3,20 +3,23 @@
 import os,sys,string
 from distutils.core import setup, Extension
 
-__revision__ = "$Id: setup.py,v 1.3 2007/03/28 10:17:57 pjetur Exp $"
-
 if 'VERSION' in os.environ:
     version=os.environ['VERSION']
 else:
     from subprocess import *
     try:
-        version = Popen(["grep ^VERSION ../Makefile | cut -d '=' -f 2 | tr -d '\n'"], stdout=PIPE, shell=True).communicate()[0]
+        major = Popen(["grep '(VERSION_MAJOR' ../CMakeLists.txt  | cut -d '\"' -f 2 | tr -d '\n'"], stdout=PIPE, shell=True).communicate()[0]
+        minor = Popen(["grep '(VERSION_MINOR' ../CMakeLists.txt  | cut -d '\"' -f 2 | tr -d '\n'"], stdout=PIPE, shell=True).communicate()[0]
+        patch = Popen(["grep '(VERSION_PATCH' ../CMakeLists.txt  | cut -d '\"' -f 2 | tr -d '\n'"], stdout=PIPE, shell=True).communicate()[0]
+        version = "%s.%s.%s" % (major,minor,patch)
     except:
         version='?.?'
 
 build_modules = [Extension('_pyk8055',
     define_macros = [('VERSION', "\"%s\"" % str(version))],
     libraries=["usb"],
+    extra_compile_args=['-std=c99'],
+    include_dirs=["/usr/include/libusb-1.0","/usr/local/include/libusb-1.0"],
     sources=['libk8055.i',"../libk8055/libk8055.c"])]
 
 setup(
-- 
cgit v1.1-2-g2b99