diff options
Diffstat (limited to 'meta-oe/recipes-bsp/i2cdev')
-rw-r--r-- | meta-oe/recipes-bsp/i2cdev/i2cdev/fix-lsi2c-makefile.patch | 28 | ||||
-rw-r--r-- | meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch | 110 | ||||
-rw-r--r-- | meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb | 26 |
3 files changed, 164 insertions, 0 deletions
diff --git a/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-lsi2c-makefile.patch b/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-lsi2c-makefile.patch new file mode 100644 index 0000000000..820d4bb447 --- /dev/null +++ b/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-lsi2c-makefile.patch @@ -0,0 +1,28 @@ +From 57c09727220e00ab961325a2c85f5611bd1770d6 Mon Sep 17 00:00:00 2001 +Message-Id: <57c09727220e00ab961325a2c85f5611bd1770d6.1701984646.git.joerg.sommer@navimatix.de> +From: =?UTF-8?q?J=C3=B6rg=20Sommer?= <joerg.sommer@navimatix.de> +Date: Thu, 7 Dec 2023 22:29:40 +0100 +Subject: [PATCH] lsi2c/Makefile: Use builddir to refer to libi2cdev.a + +Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de> +Upstream-Status: Submitted [https://github.com/costad2/i2cdev/pull/2/commits/43f15e97d869797dbfeaacafa13216aaaf353426] +--- + lsi2c/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lsi2c/Makefile.am b/lsi2c/Makefile.am +index 6defc1f..0d81d01 100644 +--- a/lsi2c/Makefile.am ++++ b/lsi2c/Makefile.am +@@ -14,7 +14,7 @@ bin_PROGRAMS=lsi2c + lsi2c_SOURCES = lsi2c.c + + # Linker options for lsi2c +-lsi2c_LDADD = $(top_srcdir)/libi2cdev/libi2cdev.a ++lsi2c_LDADD = $(top_builddir)/libi2cdev/libi2cdev.a + + # Compiler options for lsi2c + lsi2c_CFLAGS = -I$(top_srcdir)/include -std=c99 -fPIC +-- +2.34.1 + diff --git a/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch b/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch new file mode 100644 index 0000000000..a15514bafe --- /dev/null +++ b/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch @@ -0,0 +1,110 @@ +From ce3affeb45a65649dda1edc9a4f0586e9db47ada Mon Sep 17 00:00:00 2001 +Message-Id: <ce3affeb45a65649dda1edc9a4f0586e9db47ada.1705064898.git.joerg.sommer@navimatix.de> +From: =?UTF-8?q?J=C3=B6rg=20Sommer?= <joerg.sommer@navimatix.de> +Date: Fri, 12 Jan 2024 13:59:51 +0100 +Subject: [PATCH] lsi2c: Replace error() by fprintf, drop error.h + +The MUSL C library doesn't support error.h. Because the only usage of this +is the *error* function in lsi2c.c, this gets replaced by a *fprintf*. This +doesn't print the program name, but keeps the message and the error +description. + +Upstream-Status: Submitted [https://github.com/costad2/i2cdev/pull/5] +--- + libi2cdev/access.c | 1 - + libi2cdev/i2c-bus-parser.c | 1 - + libi2cdev/i2c-dev-path.c | 1 - + libi2cdev/i2c-error.c | 1 - + libi2cdev/init.c | 2 -- + libi2cdev/sysfs.c | 1 - + lsi2c/lsi2c.c | 4 ++-- + 7 files changed, 2 insertions(+), 9 deletions(-) + +--- a/libi2cdev/access.c ++++ b/libi2cdev/access.c +@@ -16,7 +16,6 @@ + + #include "busses.h" + #include "data.h" +-#include "error.h" + #include "sysfs.h" + + #include "i2cdiscov.h" +--- a/libi2cdev/i2c-bus-parser.c ++++ b/libi2cdev/i2c-bus-parser.c +@@ -27,9 +27,9 @@ + #include <dirent.h> + #include <fcntl.h> + #include <errno.h> +-#include <error.h> + #include <alloca.h> + #include <search.h> ++#include <libgen.h> + + #include "common.h" + #include "sysfs.h" +--- a/libi2cdev/i2c-dev-path.c ++++ b/libi2cdev/i2c-dev-path.c +@@ -11,7 +11,6 @@ + #include <string.h> + #include <errno.h> + #include <stdio.h> +-#include <error.h> + + #include <linux/limits.h> + +--- a/libi2cdev/i2c-error.c ++++ b/libi2cdev/i2c-error.c +@@ -9,7 +9,6 @@ + + #include <stdlib.h> + #include <stdio.h> +-#include <error.h> + #include <errno.h> + #include <stdbool.h> + #include <stdarg.h> +--- a/libi2cdev/init.c ++++ b/libi2cdev/init.c +@@ -16,10 +16,8 @@ + #include <errno.h> + #include <dirent.h> + #include <unistd.h> +-#include <error.h> + #include <limits.h> + #include <ctype.h> +-#include <error.h> + #include <fcntl.h> + #include <assert.h> + +--- a/libi2cdev/sysfs.c ++++ b/libi2cdev/sysfs.c +@@ -17,8 +17,8 @@ + #include <assert.h> + #include <string.h> + #include <fcntl.h> +-#include <error.h> + #include <errno.h> ++#include <libgen.h> + + #include <sys/types.h> + #include <sys/stat.h> +--- a/lsi2c/lsi2c.c ++++ b/lsi2c/lsi2c.c +@@ -38,7 +38,6 @@ + #include <stdlib.h> + #include <string.h> + #include <errno.h> +-#include <error.h> + #include <getopt.h> + #include <stdbool.h> + +@@ -205,7 +204,8 @@ static int read_config_file(const char * + if (err < 0) { + err = -err; + } +- error(0, err, "Failed to initialize i2cdevices"); ++ fflush(stdout); ++ fprintf(stderr, "Failed to initialize i2cdevices: %s", strerror(err)); + if (config_file) { + fclose(config_file); + } diff --git a/meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb b/meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb new file mode 100644 index 0000000000..57057c9bf5 --- /dev/null +++ b/meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb @@ -0,0 +1,26 @@ +SUMMARY = "i2c dev tools for Linux" +DESCRIPTION = "\ + This package contains an I2C dev library and the i2c bus scanning \ + utility lsi2c. \ +" +HOMEPAGE = "https://github.com/costad2/i2cdev" +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "\ + file://COPYING;md5=768997ba510a952bef1775c50bc22b00 \ + file://include/libi2cdev.h;beginline=12;endline=25;md5=72486a5e192d6ac5c7e55a4a95e380a6 \ + file://libi2cdev/smbus.c;beginline=9;endline=22;md5=d9a0de5a611b960fa75912ded6c60096 \ + file://lsi2c/lsi2c.c;beginline=11;endline=24;md5=72486a5e192d6ac5c7e55a4a95e380a6 \ +" + +PV = "0.7.0+git" + +SRC_URI = "\ + git://github.com/costad2/i2cdev.git;protocol=https;branch=master \ + file://fix-lsi2c-makefile.patch \ + file://fix-musl.patch \ +" +SRCREV = "ed9ad777d842880e7ac6ca5e0de4bd2d3b4d02dc" + +S = "${WORKDIR}/git" + +inherit autotools |