All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir
@ 2016-09-23 14:06 julien.boibessot at free.fr
  2016-09-23 21:18 ` Arnout Vandecappelle
  2016-09-24 14:18 ` Thomas Petazzoni
  0 siblings, 2 replies; 10+ messages in thread
From: julien.boibessot at free.fr @ 2016-09-23 14:06 UTC (permalink / raw)
  To: buildroot

From: Julien BOIBESSOT <julien.boibessot@armadeus.com>

On debian (and maybe other distribs), there is a package named libi2c-dev
that install a useful header from i2c-tools (for the one wanting to write
I2C applications). See https://packages.debian.org/fr/wheezy/libi2c-dev.
Do the same in Buildroot. Note that "install" target in i2c-tools Makefile
would do the job, but BR installs i2c-tools's stuff manualy.

Signed-off-by: Julien BOIBESSOT <julien.boibessot@armadeus.com>
---
 package/i2c-tools/i2c-tools.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/i2c-tools/i2c-tools.mk b/package/i2c-tools/i2c-tools.mk
index e16b940..5e095f3 100644
--- a/package/i2c-tools/i2c-tools.mk
+++ b/package/i2c-tools/i2c-tools.mk
@@ -8,6 +8,7 @@ I2C_TOOLS_VERSION = v3.1.2
 I2C_TOOLS_SITE = git://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git
 I2C_TOOLS_LICENSE = GPLv2+, GPLv2 (py-smbus)
 I2C_TOOLS_LICENSE_FILES = COPYING
+I2C_TOOLS_INSTALL_STAGING = YES
 
 ifeq ($(BR2_PACKAGE_PYTHON),y)
 I2C_TOOLS_DEPENDENCIES += python
@@ -50,6 +51,10 @@ define I2C_TOOLS_BUILD_CMDS
 	$(I2C_TOOLS_BUILD_PYSMBUS)
 endef
 
+define I2C_TOOLS_INSTALL_STAGING_CMDS
+	$(INSTALL) -m 644 -D $(@D)/include/linux/i2c-dev.h $(STAGING_DIR)/usr/include/linux
+endef
+
 define I2C_TOOLS_INSTALL_TARGET_CMDS
 	for i in i2cdump i2cget i2cset i2cdetect; \
 	do \
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir
  2016-09-23 14:06 [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir julien.boibessot at free.fr
@ 2016-09-23 21:18 ` Arnout Vandecappelle
  2016-09-26 20:19   ` Peter Korsgaard
  2016-09-24 14:18 ` Thomas Petazzoni
  1 sibling, 1 reply; 10+ messages in thread
From: Arnout Vandecappelle @ 2016-09-23 21:18 UTC (permalink / raw)
  To: buildroot



On 23-09-16 16:06, julien.boibessot at free.fr wrote:
> From: Julien BOIBESSOT <julien.boibessot@armadeus.com>
> 
> On debian (and maybe other distribs), there is a package named libi2c-dev
> that install a useful header from i2c-tools (for the one wanting to write
> I2C applications). See https://packages.debian.org/fr/wheezy/libi2c-dev.
> Do the same in Buildroot. Note that "install" target in i2c-tools Makefile
> would do the job, but BR installs i2c-tools's stuff manualy.

 Have you considered commit 41711cfdeda6f5fd9b2531f538f3643854d7d3ea?

    Revert "i2c-tools: Add i2c-dev.h to staging directory for userspace i2c
drivers."

    This reverts commit ff673f9a22b1467878f1a117f2c6198e9683d5c7, as the
    modified i2c-dev.h from i2c-tools has some definitions that conflict
    with the i2c.h from the kernel headers. This means that a userspace
    program or library that includes both will fail to build, as is the
    case with libsoc.

If the issue has been fixed now, please mention it in the commit log.


 Also, I would prefer to use the install target. The manual install was there
from the very first commit in 2008, I don't think it's still relevant. Peter?
Anyway, for staging the install target can definitely be used.


 Regards,
 Arnout


> 
> Signed-off-by: Julien BOIBESSOT <julien.boibessot@armadeus.com>
> ---
>  package/i2c-tools/i2c-tools.mk | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/package/i2c-tools/i2c-tools.mk b/package/i2c-tools/i2c-tools.mk
> index e16b940..5e095f3 100644
> --- a/package/i2c-tools/i2c-tools.mk
> +++ b/package/i2c-tools/i2c-tools.mk
> @@ -8,6 +8,7 @@ I2C_TOOLS_VERSION = v3.1.2
>  I2C_TOOLS_SITE = git://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git
>  I2C_TOOLS_LICENSE = GPLv2+, GPLv2 (py-smbus)
>  I2C_TOOLS_LICENSE_FILES = COPYING
> +I2C_TOOLS_INSTALL_STAGING = YES
>  
>  ifeq ($(BR2_PACKAGE_PYTHON),y)
>  I2C_TOOLS_DEPENDENCIES += python
> @@ -50,6 +51,10 @@ define I2C_TOOLS_BUILD_CMDS
>  	$(I2C_TOOLS_BUILD_PYSMBUS)
>  endef
>  
> +define I2C_TOOLS_INSTALL_STAGING_CMDS
> +	$(INSTALL) -m 644 -D $(@D)/include/linux/i2c-dev.h $(STAGING_DIR)/usr/include/linux
> +endef
> +
>  define I2C_TOOLS_INSTALL_TARGET_CMDS
>  	for i in i2cdump i2cget i2cset i2cdetect; \
>  	do \
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir
  2016-09-23 14:06 [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir julien.boibessot at free.fr
  2016-09-23 21:18 ` Arnout Vandecappelle
@ 2016-09-24 14:18 ` Thomas Petazzoni
  2016-09-26  8:56   ` Julien Boibessot
  1 sibling, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2016-09-24 14:18 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 23 Sep 2016 16:06:44 +0200, julien.boibessot at free.fr wrote:
> From: Julien BOIBESSOT <julien.boibessot@armadeus.com>
> 
> On debian (and maybe other distribs), there is a package named libi2c-dev
> that install a useful header from i2c-tools (for the one wanting to write
> I2C applications). See https://packages.debian.org/fr/wheezy/libi2c-dev.
> Do the same in Buildroot. Note that "install" target in i2c-tools Makefile
> would do the job, but BR installs i2c-tools's stuff manualy.
> 
> Signed-off-by: Julien BOIBESSOT <julien.boibessot@armadeus.com>

We already merged exactly the same patch in commit
ff673f9a22b1467878f1a117f2c6198e9683d5c7, and finally reverted it in
41711cfdeda6f5fd9b2531f538f3643854d7d3ea, with the following commit log:

commit 41711cfdeda6f5fd9b2531f538f3643854d7d3ea
Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date:   Tue Mar 4 19:14:26 2014 +0100

    Revert "i2c-tools: Add i2c-dev.h to staging directory for userspace i2c drivers."
    
    This reverts commit ff673f9a22b1467878f1a117f2c6198e9683d5c7, as the
    modified i2c-dev.h from i2c-tools has some definitions that conflict
    with the i2c.h from the kernel headers. This means that a userspace
    program or library that includes both will fail to build, as is the
    case with libsoc.
    
    Fixes:
    
      http://autobuild.buildroot.org/results/1f4/1f451a338487a2a3c8a8f9b18540d41b90ee5aac/
    
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

So, if we are going to merge the same patch again, I'd like to be sure
that we won't fall into the exact same problems we had the previous
time. Could you check this?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir
  2016-09-24 14:18 ` Thomas Petazzoni
@ 2016-09-26  8:56   ` Julien Boibessot
  2016-09-26 10:21     ` Arnout Vandecappelle
  0 siblings, 1 reply; 10+ messages in thread
From: Julien Boibessot @ 2016-09-26  8:56 UTC (permalink / raw)
  To: buildroot

Hello,

Arnout, Thomas,
thanks for reviewing.

On 24/09/2016 16:18, Thomas Petazzoni wrote:
> Hello,
>
> On Fri, 23 Sep 2016 16:06:44 +0200, julien.boibessot at free.fr wrote:
>> From: Julien BOIBESSOT <julien.boibessot@armadeus.com>
>>
>> On debian (and maybe other distribs), there is a package named libi2c-dev
>> that install a useful header from i2c-tools (for the one wanting to write
>> I2C applications). See https://packages.debian.org/fr/wheezy/libi2c-dev.
>> Do the same in Buildroot. Note that "install" target in i2c-tools Makefile
>> would do the job, but BR installs i2c-tools's stuff manualy.
>>
>> Signed-off-by: Julien BOIBESSOT <julien.boibessot@armadeus.com>
> We already merged exactly the same patch in commit
> ff673f9a22b1467878f1a117f2c6198e9683d5c7, and finally reverted it in
> 41711cfdeda6f5fd9b2531f538f3643854d7d3ea, with the following commit log:
>
> commit 41711cfdeda6f5fd9b2531f538f3643854d7d3ea
> Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Date:   Tue Mar 4 19:14:26 2014 +0100
>
>     Revert "i2c-tools: Add i2c-dev.h to staging directory for userspace i2c drivers."
>     
>     This reverts commit ff673f9a22b1467878f1a117f2c6198e9683d5c7, as the
>     modified i2c-dev.h from i2c-tools has some definitions that conflict
>     with the i2c.h from the kernel headers. This means that a userspace
>     program or library that includes both will fail to build, as is the
>     case with libsoc.
>     
>     Fixes:
>     
>       http://autobuild.buildroot.org/results/1f4/1f451a338487a2a3c8a8f9b18540d41b90ee5aac/
>     
>     Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>
> So, if we are going to merge the same patch again, I'd like to be sure
> that we won't fall into the exact same problems we had the previous
> time. Could you check this?

Sorry for having missed that one ! Sadly, the same problem will occur
with my patch.
I have currently no idea how to solve that and still trying to figure
out how it can works on debian systems with libi2c-dev package installed.
So meanwhile you can forget about my patch.

Best regards,
Julien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir
  2016-09-26  8:56   ` Julien Boibessot
@ 2016-09-26 10:21     ` Arnout Vandecappelle
  2016-09-26 20:17       ` Peter Korsgaard
  0 siblings, 1 reply; 10+ messages in thread
From: Arnout Vandecappelle @ 2016-09-26 10:21 UTC (permalink / raw)
  To: buildroot



On 26-09-16 10:56, Julien Boibessot wrote:
> Hello,
> 
> Arnout, Thomas,
> thanks for reviewing.
> 
> On 24/09/2016 16:18, Thomas Petazzoni wrote:
[snip]
>>     This reverts commit ff673f9a22b1467878f1a117f2c6198e9683d5c7, as the
>>     modified i2c-dev.h from i2c-tools has some definitions that conflict
>>     with the i2c.h from the kernel headers. This means that a userspace
>>     program or library that includes both will fail to build, as is the
>>     case with libsoc.
>>     
>>     Fixes:
>>     
>>       http://autobuild.buildroot.org/results/1f4/1f451a338487a2a3c8a8f9b18540d41b90ee5aac/
>>     
>>     Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>>
>> So, if we are going to merge the same patch again, I'd like to be sure
>> that we won't fall into the exact same problems we had the previous
>> time. Could you check this?
> 
> Sorry for having missed that one ! Sadly, the same problem will occur
> with my patch.
> I have currently no idea how to solve that and still trying to figure
> out how it can works on debian systems with libi2c-dev package installed.
> So meanwhile you can forget about my patch.

 I guess Debian doesn't have packages that include both i2c.h and i2c-dev.h.
libsoc, for example, doesn't exist in Debian.

 I guess the solution would be for i2c-tools to #include or #include_next the
relevant kernel headers, instead of redefining. Or to have both i2c.h and
i2c-dev.h so that both kernel headers end up being overwritten.

 Regards,
 Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir
  2016-09-26 10:21     ` Arnout Vandecappelle
@ 2016-09-26 20:17       ` Peter Korsgaard
  2016-09-27  3:57         ` Baruch Siach
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Korsgaard @ 2016-09-26 20:17 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

 >> Sorry for having missed that one ! Sadly, the same problem will occur
 >> with my patch.
 >> I have currently no idea how to solve that and still trying to figure
 >> out how it can works on debian systems with libi2c-dev package installed.
 >> So meanwhile you can forget about my patch.

 >  I guess Debian doesn't have packages that include both i2c.h and i2c-dev.h.
 > libsoc, for example, doesn't exist in Debian.

 >  I guess the solution would be for i2c-tools to #include or #include_next the
 > relevant kernel headers, instead of redefining. Or to have both i2c.h and
 > i2c-dev.h so that both kernel headers end up being overwritten.

Does the i2c-tools version of this file add anything important on top of
the Linux headers? The i2c /dev interface afaik hasn't changed in MANY
years.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir
  2016-09-23 21:18 ` Arnout Vandecappelle
@ 2016-09-26 20:19   ` Peter Korsgaard
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Korsgaard @ 2016-09-26 20:19 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

Hi,

 >  Also, I would prefer to use the install target. The manual install was there
 > from the very first commit in 2008, I don't think it's still relevant. Peter?
 > Anyway, for staging the install target can definitely be used.

Sorry, I don't remember. I *THINK* it installed a number of unneeded
stuff.

Changing to make install is fine by me if it nowadays does something sensible.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir
  2016-09-26 20:17       ` Peter Korsgaard
@ 2016-09-27  3:57         ` Baruch Siach
  2016-09-28  8:24           ` Julien Boibessot
  0 siblings, 1 reply; 10+ messages in thread
From: Baruch Siach @ 2016-09-27  3:57 UTC (permalink / raw)
  To: buildroot

Hi Peter,

On Mon, Sep 26, 2016 at 10:17:50PM +0200, Peter Korsgaard wrote:
> >>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
> 
>  >> Sorry for having missed that one ! Sadly, the same problem will occur
>  >> with my patch.
>  >> I have currently no idea how to solve that and still trying to figure
>  >> out how it can works on debian systems with libi2c-dev package installed.
>  >> So meanwhile you can forget about my patch.
> 
>  >  I guess Debian doesn't have packages that include both i2c.h and i2c-dev.h.
>  > libsoc, for example, doesn't exist in Debian.
> 
>  >  I guess the solution would be for i2c-tools to #include or #include_next the
>  > relevant kernel headers, instead of redefining. Or to have both i2c.h and
>  > i2c-dev.h so that both kernel headers end up being overwritten.
> 
> Does the i2c-tools version of this file add anything important on top of
> the Linux headers? The i2c /dev interface afaik hasn't changed in MANY
> years.

The i2c-tools version of i2c-dev.h adds a number of convenient i2c_smbus_*() 
routines, that wrap around the I2C_SMBUS ioctl.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir
  2016-09-27  3:57         ` Baruch Siach
@ 2016-09-28  8:24           ` Julien Boibessot
  2016-09-28  8:52             ` Peter Korsgaard
  0 siblings, 1 reply; 10+ messages in thread
From: Julien Boibessot @ 2016-09-28  8:24 UTC (permalink / raw)
  To: buildroot

Hello,

On 27/09/2016 05:57, Baruch Siach wrote:
> Hi Peter,
>
> On Mon, Sep 26, 2016 at 10:17:50PM +0200, Peter Korsgaard wrote:
>>>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
>>  >> Sorry for having missed that one ! Sadly, the same problem will occur
>>  >> with my patch.
>>  >> I have currently no idea how to solve that and still trying to figure
>>  >> out how it can works on debian systems with libi2c-dev package installed.
>>  >> So meanwhile you can forget about my patch.
>>
>>  >  I guess Debian doesn't have packages that include both i2c.h and i2c-dev.h.
>>  > libsoc, for example, doesn't exist in Debian.
>>
>>  >  I guess the solution would be for i2c-tools to #include or #include_next the
>>  > relevant kernel headers, instead of redefining. Or to have both i2c.h and
>>  > i2c-dev.h so that both kernel headers end up being overwritten.
>>
>> Does the i2c-tools version of this file add anything important on top of
>> the Linux headers? The i2c /dev interface afaik hasn't changed in MANY
>> years.
> The i2c-tools version of i2c-dev.h adds a number of convenient i2c_smbus_*() 
> routines, that wrap around the I2C_SMBUS ioctl.

These i2c_smbus_*() routines are used by some userspace I2C drivers (not
yet in BR), that's why I sent the patch to re-install i2c-dev.h

Regards,
Julien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir
  2016-09-28  8:24           ` Julien Boibessot
@ 2016-09-28  8:52             ` Peter Korsgaard
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Korsgaard @ 2016-09-28  8:52 UTC (permalink / raw)
  To: buildroot

>>>>> "Julien" == Julien Boibessot <julien.boibessot@free.fr> writes:

 >>> Does the i2c-tools version of this file add anything important on top of
 >>> the Linux headers? The i2c /dev interface afaik hasn't changed in MANY
 >>> years.
 >> The i2c-tools version of i2c-dev.h adds a number of convenient i2c_smbus_*() 
 >> routines, that wrap around the I2C_SMBUS ioctl.

 > These i2c_smbus_*() routines are used by some userspace I2C drivers (not
 > yet in BR), that's why I sent the patch to re-install i2c-dev.h

It is quite painful to have multiple incompatible versions of the same
header file, and i2c-tools imho shouldn't overwrite kernel headers.

Have this issue been discussed with upstream?

-- 
Venlig hilsen,
Peter Korsgaard 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-09-28  8:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-23 14:06 [Buildroot] [PATCH] i2c-tools: install devt headers to staging dir julien.boibessot at free.fr
2016-09-23 21:18 ` Arnout Vandecappelle
2016-09-26 20:19   ` Peter Korsgaard
2016-09-24 14:18 ` Thomas Petazzoni
2016-09-26  8:56   ` Julien Boibessot
2016-09-26 10:21     ` Arnout Vandecappelle
2016-09-26 20:17       ` Peter Korsgaard
2016-09-27  3:57         ` Baruch Siach
2016-09-28  8:24           ` Julien Boibessot
2016-09-28  8:52             ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.