diff mbox series

i2cdev: New recipe with i2c tools

Message ID 80fad6f6fdc85ee3b2ad7ab81f1f4c574c42b53c.1703679576.git.joerg.sommer@navimatix.de
State Not Applicable
Headers show
Series i2cdev: New recipe with i2c tools | expand

Commit Message

Jörg Sommer Dec. 27, 2023, 12:19 p.m. UTC
From: Jörg Sommer <joerg.sommer@navimatix.de>

The main part is the tool lsi2c to scan the i2c bus, like lspci and lsusb
do.

This recipe also ships a static library *libi2cdev.a*. Because this library
contains the file *smbus.c* which is *GPL v2+,* and a static library can't
be linked dynamically to satisfy the LGPL, the whole recipe is marked
as *GPL-2.0-or-later.*

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
---
 .../i2cdev/i2cdev/fix-lsi2c-makefile.patch    | 28 +++++++++++++++++++
 meta/recipes-bsp/i2cdev/i2cdev_git.bb         | 26 +++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 meta/recipes-bsp/i2cdev/i2cdev/fix-lsi2c-makefile.patch
 create mode 100644 meta/recipes-bsp/i2cdev/i2cdev_git.bb

Comments

Alexander Kanavin Dec. 27, 2023, 12:39 p.m. UTC | #1
This doesn’t seem core enough, perhaps meta-oe is a better home for the
recipe?

Alex

On Wed 27. Dec 2023 at 14.20, Jörg Sommer via lists.openembedded.org
<joerg.sommer=navimatix.de@lists.openembedded.org> wrote:

> From: Jörg Sommer <joerg.sommer@navimatix.de>
>
> The main part is the tool lsi2c to scan the i2c bus, like lspci and lsusb
> do.
>
> This recipe also ships a static library *libi2cdev.a*. Because this library
> contains the file *smbus.c* which is *GPL v2+,* and a static library can't
> be linked dynamically to satisfy the LGPL, the whole recipe is marked
> as *GPL-2.0-or-later.*
>
> Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
> ---
>  .../i2cdev/i2cdev/fix-lsi2c-makefile.patch    | 28 +++++++++++++++++++
>  meta/recipes-bsp/i2cdev/i2cdev_git.bb         | 26 +++++++++++++++++
>  2 files changed, 54 insertions(+)
>  create mode 100644 meta/recipes-bsp/i2cdev/i2cdev/fix-lsi2c-makefile.patch
>  create mode 100644 meta/recipes-bsp/i2cdev/i2cdev_git.bb
>
> diff --git a/meta/recipes-bsp/i2cdev/i2cdev/fix-lsi2c-makefile.patch
> b/meta/recipes-bsp/i2cdev/i2cdev/fix-lsi2c-makefile.patch
> new file mode 100644
> index 0000000000..4df7527205
> --- /dev/null
> +++ b/meta/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/recipes-bsp/i2cdev/i2cdev_git.bb
> b/meta/recipes-bsp/i2cdev/i2cdev_git.bb
> new file mode 100644
> index 0000000000..b1f8a7f805
> --- /dev/null
> +++ b/meta/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. \
> +"
> +AUTHOR = "Danielle Costantino"
> +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
> \
> +"
> +
> +PR = "git${SRCPV}"
> +
> +SRC_URI = "\
> +    git://github.com/costad2/i2cdev.git;protocol=https;branch=master \
> +    file://fix-lsi2c-makefile.patch \
> +"
> +SRCREV = "ed9ad777d842880e7ac6ca5e0de4bd2d3b4d02dc"
> +
> +S = "${WORKDIR}/git"
> +
> +inherit autotools
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#192939):
> https://lists.openembedded.org/g/openembedded-core/message/192939
> Mute This Topic: https://lists.openembedded.org/mt/103383581/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/meta/recipes-bsp/i2cdev/i2cdev/fix-lsi2c-makefile.patch b/meta/recipes-bsp/i2cdev/i2cdev/fix-lsi2c-makefile.patch
new file mode 100644
index 0000000000..4df7527205
--- /dev/null
+++ b/meta/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/recipes-bsp/i2cdev/i2cdev_git.bb b/meta/recipes-bsp/i2cdev/i2cdev_git.bb
new file mode 100644
index 0000000000..b1f8a7f805
--- /dev/null
+++ b/meta/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. \
+"
+AUTHOR = "Danielle Costantino"
+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 \
+"
+
+PR = "git${SRCPV}"
+
+SRC_URI = "\
+    git://github.com/costad2/i2cdev.git;protocol=https;branch=master \
+    file://fix-lsi2c-makefile.patch \
+"
+SRCREV = "ed9ad777d842880e7ac6ca5e0de4bd2d3b4d02dc"
+
+S = "${WORKDIR}/git"
+
+inherit autotools