* [Buildroot] Patching Package Dependencies
@ 2022-06-09 21:21 Charles Steinkuehler
2022-06-11 17:38 ` Arnout Vandecappelle
0 siblings, 1 reply; 3+ messages in thread
From: Charles Steinkuehler @ 2022-06-09 21:21 UTC (permalink / raw)
To: buildroot
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?
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?
--
Charles Steinkuehler
charles@steinkuehler.net
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] Patching Package Dependencies
2022-06-09 21:21 [Buildroot] Patching Package Dependencies Charles Steinkuehler
@ 2022-06-11 17:38 ` Arnout Vandecappelle
2022-06-11 23:31 ` Charles Steinkuehler
0 siblings, 1 reply; 3+ messages in thread
From: Arnout Vandecappelle @ 2022-06-11 17:38 UTC (permalink / raw)
To: Charles Steinkuehler, buildroot
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@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] Patching Package Dependencies
2022-06-11 17:38 ` Arnout Vandecappelle
@ 2022-06-11 23:31 ` Charles Steinkuehler
0 siblings, 0 replies; 3+ messages in thread
From: Charles Steinkuehler @ 2022-06-11 23:31 UTC (permalink / raw)
To: buildroot
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@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
Charles Steinkuehler
charles@steinkuehler.net
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-11 23:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 21:21 [Buildroot] Patching Package Dependencies Charles Steinkuehler
2022-06-11 17:38 ` Arnout Vandecappelle
2022-06-11 23:31 ` Charles Steinkuehler
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.