Code

Added i2c_detection.patch
authorMarc Fournier <marc@bl.uem.li>
Wed, 21 Feb 2018 16:30:29 +0000 (17:30 +0100)
committerMarc Fournier <marc@bl.uem.li>
Wed, 21 Feb 2018 16:30:29 +0000 (17:30 +0100)
This is needed to make the barometer plugin build on sid.

debian/changelog
debian/patches/i2c_detection.patch [new file with mode: 0644]
debian/patches/series

index 6e5d341c68aa521075e9a63b17778128e35cc166..776f93041ada8851c74018e3a99393f8780df9c3 100644 (file)
@@ -5,6 +5,8 @@ collectd (5.8.0-1) UNRELEASED; urgency=medium
   * Enable the intel_rdt plugin, libpqos is now available.
   * Re-enable the varnish plugin, support for varnish 5.2 now implemented.
   * debian/patches:
+    - Added i2c_detection.patch; needed to build against libi2c-4.0.
+      (Closes: #886920)
     - Added rd_kafka_last_error.patch; needed to build against
       librdkafka-0.11.0.
     - Removed dpdk-pkg-config.patch; included upstream.
diff --git a/debian/patches/i2c_detection.patch b/debian/patches/i2c_detection.patch
new file mode 100644 (file)
index 0000000..4ca7f0d
--- /dev/null
@@ -0,0 +1,45 @@
+Description: configure: barometer: fix i2c lib usage for 4.0
+Forwarded: https://github.com/collectd/collectd/issues/2646
+Author: Andreas Hasenack <andreas.hasenack@canonical.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1742691
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886920
+Last-Update: 2018-02-21
+
+diff --git Makefile.am Makefile.am
+index ae027a368..ef71be836 100644
+--- Makefile.am
++++ Makefile.am
+@@ -591,7 +591,7 @@ if BUILD_PLUGIN_BAROMETER
+ pkglib_LTLIBRARIES += barometer.la
+ barometer_la_SOURCES = src/barometer.c
+ barometer_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+-barometer_la_LIBADD = -lm
++barometer_la_LIBADD = -lm -li2c
+ endif
+ if BUILD_PLUGIN_BATTERY
+diff --git configure.ac configure.ac
+index e869a6a09..d9854d024 100644
+--- configure.ac
++++ configure.ac
+@@ -1883,7 +1883,7 @@ if test "x$ac_system" = "xLinux"; then
+     [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
+     [[
+       #include <stdlib.h>
+-      #include <linux/i2c-dev.h>
++      #include <i2c/smbus.h>
+     ]]
+   )
+ else
+diff --git src/barometer.c src/barometer.c
+index f698005ca..e3d418d2a 100644
+--- src/barometer.c
++++ src/barometer.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <linux/i2c-dev.h>
++#include <i2c/smbus.h>
+ #include <math.h>
+ #include <stdint.h>
+ #include <sys/ioctl.h>
index c795534bb94c00dd43d9c0ac7a3739b3ce60a8e4..8041789e28d092aba792ed5b790ca6a230b15a4f 100644 (file)
@@ -3,3 +3,4 @@ collection_conf_path.patch
 myplugin_includes.patch
 nagios-debian-paths.patch
 rd_kafka_last_error.patch
+i2c_detection.patch