Skip to contentSkip to conversation

i2c-tools: py-smbus linker issue in arch

PATCH New Michael Göhler 1 participant 1 message Mar 5, 2015 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c-tools: py-smbus linker issue in arch

Hi,

this fixes a linker issue in py-smbus for Arch-Linux (https://aur.archlinux.org/packages/python-smbus/) and makes it possible to run setup.py independently again.

Thanks!

Module.mk +1 -1
Index: py-smbus/Module.mk
===================================================================
@@ -12,7 +12,7 @@
 PYTHON ?= python
 DISTUTILS := \
 	cd $(PY_SMBUS_DIR) && \
-	CPPFLAGS="$(CPPFLAGS) -I../include" LDFLAGS="$(LDFLAGS) -Llib -li2c" $(PYTHON) setup.py
+	$(PYTHON) setup.py
 
 all-python: $(INCLUDE_DIR)/i2c/smbus.h
 	$(DISTUTILS) build
setup.py +7 -1
Index: py-smbus/setup.py
===================================================================
@@ -11,4 +11,10 @@
 	maintainer_email="[email protected]",
 	license="GPLv2",
 	url="http://lm-sensors.org/",
-	ext_modules=[Extension("smbus", ["smbusmodule.c"])])
+	ext_modules=[Extension(
+		"smbus",
+		["smbusmodule.c"],
+		extra_compile_args=['-I../include'],
+		extra_link_args=['-li2c']
+	)]
+)