[Buildroot] Patching Package Dependencies

Charles Steinkuehler charles at steinkuehler.net
Sat Jun 11 23:31:08 UTC 2022


Thanks!

That's pretty much what I'd figured out, but I wanted to check and make 
sure I didn't miss anything.  I've currently got a fork of Buildroot 
with just the one dependency change, but I'll probably switch to 
defining the "myavrdude" package in my BR2_EXTERNAL with the changes I need.

Playing around with local.mk and AVRDUDE_EXTRACT_DEPENDENCIES just seems 
like a recipe for eventual disaster.  :-)

On 6/11/2022 12:38 PM, Arnout Vandecappelle wrote:
>   Hi Charles,
> 
> On 09/06/2022 23:21, Charles Steinkuehler wrote:
>> I am using Buildroot (2022.02.2) with a couple BR2_EXERNAL directories 
>> and I need to modify a package provided with Buildroot (avrdude).  I 
>> can easily patch the code by adding a patch file to my 
>> BR2_EXTERNAL_FOO_PATH/patches directory which is added to 
>> BR2_GLOBAL_PATCH_DIR.  The problem is my code changes require a new 
>> library (libgpiod) which is part of my configuration but is not listed 
>> as a package dependency for avrdude by Buildroot, so builds fail.
>>
>> Is there a way to extend the files under Buildroot/package using a 
>> BR2_External directory?
> 
>   Officially, no there isn't. If you want to override an existing 
> package (other than patching it), the only thing you can do is to create 
> an entirely new package with a different name.
> 
>   This is just a technical limitation because everything is included 
> together in one big `make` database, and `make` doesn't have a way to 
> override everything from a previously included makefile. In addition, 
> some of the variables are used immediately to define dependencies, so if 
> you would override them in the external, that doesn't have the desired 
> effect. This is the case for _VERSION and _DEPENDENCIES. So you're out 
> of luck.
> 
>   There is one hack you could to, and that is to abuse local.mk (the 
> BR2_PACKAGE_OVERRIDE_FILE, normally used for setting OVERRIDE_SRCDIR). 
> This file is read before the package makefile. Of course, avrdude.mk 
> already defines AVRDUDE_DEPENDENCIES, so if you'd set something in 
> local.mk, it would just get lost. But you could (again) abuse 
> AVRDUDE_EXTRACT_DEPENDENCIES which is not set by avrdude.mk.
> 
>   However, since no package depends on avrdude, it's much simpler and 
> cleaner to simply add a new package myavrdude to your external.
> 
>   Regards,
>   Arnout
> 
> 
>>
>> Alternately, is defining a package in my BR2_External directory with 
>> the same name as an official Buildroot package allowed/recommended?
>>
>> ...or are there any other suggestions for modifying a Buildroot 
>> package without making a local branch and applying my needed changes?
>>
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
Charles Steinkuehler
charles at steinkuehler.net



More information about the buildroot mailing list