[oe-commits] Darren Hart : i2c-tools: Add i2c-tools to the core

git at git.openembedded.org git at git.openembedded.org
Wed May 28 08:43:22 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: 32ac58819580d359e22161be1abf62215d202250
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=32ac58819580d359e22161be1abf62215d202250

Author: Darren Hart <dvhart at linux.intel.com>
Date:   Tue May 27 12:58:59 2014 -0700

i2c-tools: Add i2c-tools to the core

i2c-tools has been sitting outside of oe-core for long enough now. It is
a required tool for board validation, and many people are pulling it
into their builds and their own layers. Let's add it to the core.

This patch includes the i2c-tools recipe from meta-oe as of:

  commit 9df13b4140e8c6bfa0e4fb89107a6146981d2cdc
  Author: Khem Raj <raj.khem at gmail.com>
  Date:   2014-04-26

      i2c-tools: Fix build when S != B

Signed-off-by: Darren Hart <dvhart at linux.intel.com>
Cc: Richard Purdie <richard.purdie at linuxfoundation.org>
Cc: Khem Raj <raj.khem at gmail.com>
Cc: Martin Jansa <Martin.Jansa at gmail.com>
Cc: Matthieu Crapet <Matthieu.Crapet at ingenico.com>
Cc: Koen Kooi <koen at dominion.thruhere.net>
Signed-off-by: Darren Hart <dvhart at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 .../i2c-tools/i2c-tools-3.1.0/Module.mk            | 72 ++++++++++++++++++++++
 meta/recipes-devtools/i2c-tools/i2c-tools_3.1.0.bb | 26 ++++++++
 2 files changed, 98 insertions(+)

diff --git a/meta/recipes-devtools/i2c-tools/i2c-tools-3.1.0/Module.mk b/meta/recipes-devtools/i2c-tools/i2c-tools-3.1.0/Module.mk
new file mode 100644
index 0000000..fcaf72f
--- /dev/null
+++ b/meta/recipes-devtools/i2c-tools/i2c-tools-3.1.0/Module.mk
@@ -0,0 +1,72 @@
+# EEPROMER
+#
+# Licensed under the GNU General Public License.
+
+EEPROMER_DIR	:= eepromer
+
+EEPROMER_CFLAGS	:= -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \
+		   -Wcast-align -Wwrite-strings -Wnested-externs -Winline \
+		   -W -Wundef -Wmissing-prototypes -Iinclude
+
+EEPROMER_TARGETS	:= eepromer eeprom eeprog
+
+#
+# Programs
+#
+
+$(EEPROMER_DIR)/eepromer: $(EEPROMER_DIR)/eepromer.o
+	$(CC) $(LDFLAGS) -o $@ $^
+
+$(EEPROMER_DIR)/eeprom: $(EEPROMER_DIR)/eeprom.o
+	$(CC) $(LDFLAGS) -o $@ $^
+
+$(EEPROMER_DIR)/eeprog: $(EEPROMER_DIR)/eeprog.o $(EEPROMER_DIR)/24cXX.o 
+	$(CC) $(LDFLAGS) -o $@ $^
+
+#
+# Objects
+#
+
+$(EEPROMER_DIR)/eepromer.o: $(EEPROMER_DIR)/eepromer.c
+	$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/eeprom.o: $(EEPROMER_DIR)/eeprom.c
+	$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/eeprog.o: $(EEPROMER_DIR)/eeprog.c
+	$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/24cXX.o: $(EEPROMER_DIR)/24cXX.c
+	$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+#
+# Commands
+#
+
+all-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+
+strip-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+	strip $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+
+clean-eepromer:
+	$(RM) $(addprefix $(EEPROMER_DIR)/,*.o $(EEPROMER_TARGETS))
+
+install-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+	$(INSTALL_DIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
+	for program in $(EEPROMER_TARGETS) ; do \
+	$(INSTALL_PROGRAM) $(EEPROMER_DIR)/$$program $(DESTDIR)$(sbindir) ; done
+
+uninstall-eepromer:
+	for program in $(EEPROMER_TARGETS) ; do \
+	$(RM) $(DESTDIR)$(sbindir)/$$program ; \
+	$(RM) $(DESTDIR)$(man8dir)/$$program.8 ; done
+
+all: all-eepromer
+
+strip: strip-eepromer
+
+clean: clean-eepromer
+
+install: install-eepromer
+
+uninstall: uninstall-eepromer
diff --git a/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.0.bb b/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.0.bb
new file mode 100644
index 0000000..b8be9ed
--- /dev/null
+++ b/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.0.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Set of i2c tools for linux"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+RDEPENDS_${PN} += "perl"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/i2c-tools/i2c-tools-3.1.0.tar.bz2/f15019e559e378c6e9d5d6299a00df21/i2c-tools-${PV}.tar.bz2 \
+           file://Module.mk \
+"
+SRC_URI[md5sum] = "f15019e559e378c6e9d5d6299a00df21"
+SRC_URI[sha256sum] = "960023f61de292c6dd757fcedec4bffa7dd036e8594e24b26a706094ca4c142a"
+
+inherit autotools-brokensep
+
+do_compile_prepend() {
+    cp ${WORKDIR}/Module.mk ${S}/eepromer/
+    sed -i 's#/usr/local#/usr#' ${S}/Makefile
+    echo "include eepromer/Module.mk" >> ${S}/Makefile
+}
+
+do_install_append() {
+    install -d ${D}${includedir}/linux
+    install -m 0644 include/linux/i2c-dev.h ${D}${includedir}/linux/i2c-dev-user.h
+    rm -f ${D}${includedir}/linux/i2c-dev.h
+}



More information about the Openembedded-commits mailing list