* [Buildroot] [PATCH v2 0/2] improve virtual package management
@ 2014-02-25 15:45 Eric Le Bihan
2014-02-25 15:45 ` [Buildroot] [PATCH v2 1/2] packages: improve dependency check in virtual packages Eric Le Bihan
2014-02-25 15:45 ` [Buildroot] [PATCH v2 2/2] manual: add virtual package tutorial Eric Le Bihan
0 siblings, 2 replies; 9+ messages in thread
From: Eric Le Bihan @ 2014-02-25 15:45 UTC (permalink / raw)
To: buildroot
This patch series improves virtual package management by:
- using make control functions in dependency check.
- adding a tutorial to the user manual.
Changes v1 -> v2:
- rebased on master.
- replaced 'infrastructure' by 'management' as this mechanism does not (yet?)
provide a "$(eval $(virtual-package))" helper
- converted code examples to plain sections (suggested by Yann E. Morin).
Best regards,
ELB
Eric Le Bihan (2):
packages: improve dependency check in virtual packages.
manual: add virtual package tutorial.
docs/manual/adding-packages-virtual.txt | 99 ++++++++++++++++++++++++++++++
docs/manual/adding-packages.txt | 2 +
package/luainterpreter/luainterpreter.mk | 6 ++
package/opengl/libegl/libegl.mk | 7 +--
package/opengl/libgles/libgles.mk | 7 +--
package/opengl/libopenmax/libopenmax.mk | 7 +--
package/opengl/libopenvg/libopenvg.mk | 7 +--
package/powervr/powervr.mk | 7 +--
8 files changed, 122 insertions(+), 20 deletions(-)
create mode 100644 docs/manual/adding-packages-virtual.txt
--
1.7.9.5
^ permalink raw reply [flat|nested] 9+ messages in thread* [Buildroot] [PATCH v2 1/2] packages: improve dependency check in virtual packages. 2014-02-25 15:45 [Buildroot] [PATCH v2 0/2] improve virtual package management Eric Le Bihan @ 2014-02-25 15:45 ` Eric Le Bihan 2014-02-25 16:07 ` Samuel Martin ` (2 more replies) 2014-02-25 15:45 ` [Buildroot] [PATCH v2 2/2] manual: add virtual package tutorial Eric Le Bihan 1 sibling, 3 replies; 9+ messages in thread From: Eric Le Bihan @ 2014-02-25 15:45 UTC (permalink / raw) To: buildroot The current version of dependency check for virtual package <foo> defines FOO_CONFIGURE_CMDS to print an error message if the dependencies are not met. This patch updates all the virtual packages to use the GNU Make control function $(error text...) instead. This makes the error happen at the beginning of the build, with a clearer message. Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> --- package/luainterpreter/luainterpreter.mk | 6 ++++++ package/opengl/libegl/libegl.mk | 7 +++---- package/opengl/libgles/libgles.mk | 7 +++---- package/opengl/libopenmax/libopenmax.mk | 7 +++---- package/opengl/libopenvg/libopenvg.mk | 7 +++---- package/powervr/powervr.mk | 7 +++---- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/package/luainterpreter/luainterpreter.mk b/package/luainterpreter/luainterpreter.mk index c37d621..5443477 100644 --- a/package/luainterpreter/luainterpreter.mk +++ b/package/luainterpreter/luainterpreter.mk @@ -9,4 +9,10 @@ LUAINTERPRETER_DEPENDENCIES = $(call qstrip,$(BR2_PACKAGE_PROVIDES_LUA_INTERPRET LUAINTERPRETER_ABIVER = $(call qstrip,$(BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION)) +ifeq ($(BR2_PACKAGE_HAS_LUA_INTERPRETER),y) +ifeq ($(LUAINTERPRETER_DEPENDENCIES),) +$(error No lua interpreter implementation selected. Configuration error.) +endif +endif + $(eval $(generic-package)) diff --git a/package/opengl/libegl/libegl.mk b/package/opengl/libegl/libegl.mk index b2b74f1..3311e50 100644 --- a/package/opengl/libegl/libegl.mk +++ b/package/opengl/libegl/libegl.mk @@ -7,11 +7,10 @@ LIBEGL_SOURCE = LIBEGL_DEPENDENCIES = $(call qstrip,$(BR2_PACKAGE_PROVIDES_OPENGL_EGL)) +ifeq ($(BR2_PACKAGE_HAS_OPENGL_EGL),y) ifeq ($(LIBEGL_DEPENDENCIES),) -define LIBEGL_CONFIGURE_CMDS - echo "No libEGL implementation selected. Configuration error." - exit 1 -endef +$(error No libEGL implementation selected. Configuration error.) +endif endif $(eval $(generic-package)) diff --git a/package/opengl/libgles/libgles.mk b/package/opengl/libgles/libgles.mk index 0dcbaa7..7a07e37 100644 --- a/package/opengl/libgles/libgles.mk +++ b/package/opengl/libgles/libgles.mk @@ -7,11 +7,10 @@ LIBGLES_SOURCE = LIBGLES_DEPENDENCIES = $(call qstrip,$(BR2_PACKAGE_PROVIDES_OPENGL_ES)) +ifeq ($(BR2_PACKAGE_HAS_OPENGL_ES),y) ifeq ($(LIBGLES_DEPENDENCIES),) -define LIBGLES_CONFIGURE_CMDS - echo "No libGLES implementation selected. Configuration error." - exit 1 -endef +$(error No libGLES implementation selected. Configuration error.) +endif endif $(eval $(generic-package)) diff --git a/package/opengl/libopenmax/libopenmax.mk b/package/opengl/libopenmax/libopenmax.mk index c4f1f71..a2bd23d 100644 --- a/package/opengl/libopenmax/libopenmax.mk +++ b/package/opengl/libopenmax/libopenmax.mk @@ -7,11 +7,10 @@ LIBOPENMAX_SOURCE = LIBOPENMAX_DEPENDENCIES = $(call qstrip,$(BR2_PACKAGE_PROVIDES_OPENMAX)) +ifeq ($(BR2_PACKAGE_HAS_OPENMAX),y) ifeq ($(LIBOPENMAX_DEPENDENCIES),) -define LIBOPENMAX_CONFIGURE_CMDS - echo "No libopenmax implementation selected. Configuration error." - exit 1 -endef +$(error No libopenmax implementation selected. Configuration error.) +endif endif $(eval $(generic-package)) diff --git a/package/opengl/libopenvg/libopenvg.mk b/package/opengl/libopenvg/libopenvg.mk index ffd9d68..f81db5e 100644 --- a/package/opengl/libopenvg/libopenvg.mk +++ b/package/opengl/libopenvg/libopenvg.mk @@ -7,11 +7,10 @@ LIBOPENVG_SOURCE = LIBOPENVG_DEPENDENCIES = $(call qstrip,$(BR2_PACKAGE_PROVIDES_OPENVG)) +ifeq ($(BR2_PACKAGE_HAS_OPENVG),y) ifeq ($(LIBOPENVG_DEPENDENCIES),) -define LIBOPENVG_CONFIGURE_CMDS - echo "No libOpenVG implementation selected. Configuration error." - exit 1 -endef +$(error No libOpenVG implementation selected. Configuration error.) +endif endif $(eval $(generic-package)) diff --git a/package/powervr/powervr.mk b/package/powervr/powervr.mk index 1f43505..b36eb16 100644 --- a/package/powervr/powervr.mk +++ b/package/powervr/powervr.mk @@ -7,11 +7,10 @@ POWERVR_SOURCE = POWERVR_DEPENDENCIES = $(call qstrip,$(BR2_PACKAGE_PROVIDES_POWERVR)) +ifeq ($(BR2_PACKAGE_HAS_POWERVR),y) ifeq ($(POWERVR_DEPENDENCIES),) -define POWERVR_CONFIGURE_CMDS - echo "No PowerVR implementation selected. Configuration error." - exit 1 -endef +$(error No PowerVR implementation selected. Configuration error.) +endif endif $(eval $(generic-package)) -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 1/2] packages: improve dependency check in virtual packages. 2014-02-25 15:45 ` [Buildroot] [PATCH v2 1/2] packages: improve dependency check in virtual packages Eric Le Bihan @ 2014-02-25 16:07 ` Samuel Martin 2014-02-25 20:30 ` Peter Korsgaard 2014-02-25 21:40 ` Yann E. MORIN 2 siblings, 0 replies; 9+ messages in thread From: Samuel Martin @ 2014-02-25 16:07 UTC (permalink / raw) To: buildroot On Tue, Feb 25, 2014 at 4:45 PM, Eric Le Bihan <eric.le.bihan.dev@free.fr> wrote: > The current version of dependency check for virtual package <foo> > defines FOO_CONFIGURE_CMDS to print an error message if the > dependencies are not met. > > This patch updates all the virtual packages to use the GNU Make control > function $(error text...) instead. > > This makes the error happen at the beginning of the build, with a clearer > message. > > Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr> > Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Regards, -- Samuel ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 1/2] packages: improve dependency check in virtual packages. 2014-02-25 15:45 ` [Buildroot] [PATCH v2 1/2] packages: improve dependency check in virtual packages Eric Le Bihan 2014-02-25 16:07 ` Samuel Martin @ 2014-02-25 20:30 ` Peter Korsgaard 2014-02-25 21:40 ` Yann E. MORIN 2 siblings, 0 replies; 9+ messages in thread From: Peter Korsgaard @ 2014-02-25 20:30 UTC (permalink / raw) To: buildroot >>>>> "Eric" == Eric Le Bihan <eric.le.bihan.dev@free.fr> writes: > The current version of dependency check for virtual package <foo> > defines FOO_CONFIGURE_CMDS to print an error message if the > dependencies are not met. > This patch updates all the virtual packages to use the GNU Make control > function $(error text...) instead. > This makes the error happen at the beginning of the build, with a clearer > message. > Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr> > Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Committed to next, thanks. -- Bye, Peter Korsgaard ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 1/2] packages: improve dependency check in virtual packages. 2014-02-25 15:45 ` [Buildroot] [PATCH v2 1/2] packages: improve dependency check in virtual packages Eric Le Bihan 2014-02-25 16:07 ` Samuel Martin 2014-02-25 20:30 ` Peter Korsgaard @ 2014-02-25 21:40 ` Yann E. MORIN 2 siblings, 0 replies; 9+ messages in thread From: Yann E. MORIN @ 2014-02-25 21:40 UTC (permalink / raw) To: buildroot Eric, All, On 2014-02-25 16:45 +0100, Eric Le Bihan spake thusly: > The current version of dependency check for virtual package <foo> > defines FOO_CONFIGURE_CMDS to print an error message if the > dependencies are not met. > > This patch updates all the virtual packages to use the GNU Make control > function $(error text...) instead. > > This makes the error happen at the beginning of the build, with a clearer > message. You missed two virtual packages in this change: - jpeg - cryptodev Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 2/2] manual: add virtual package tutorial. 2014-02-25 15:45 [Buildroot] [PATCH v2 0/2] improve virtual package management Eric Le Bihan 2014-02-25 15:45 ` [Buildroot] [PATCH v2 1/2] packages: improve dependency check in virtual packages Eric Le Bihan @ 2014-02-25 15:45 ` Eric Le Bihan 2014-02-25 20:01 ` Samuel Martin 2014-02-25 22:30 ` Yann E. MORIN 1 sibling, 2 replies; 9+ messages in thread From: Eric Le Bihan @ 2014-02-25 15:45 UTC (permalink / raw) To: buildroot The manual now features a new section with instructions about how to add a virtual package. Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr> --- docs/manual/adding-packages-virtual.txt | 99 +++++++++++++++++++++++++++++++ docs/manual/adding-packages.txt | 2 + 2 files changed, 101 insertions(+) create mode 100644 docs/manual/adding-packages-virtual.txt diff --git a/docs/manual/adding-packages-virtual.txt b/docs/manual/adding-packages-virtual.txt new file mode 100644 index 0000000..10459b8 --- /dev/null +++ b/docs/manual/adding-packages-virtual.txt @@ -0,0 +1,99 @@ +// -*- mode:doc; -*- +// vim: set syntax=asciidoc: + +[[virtual-package-tutorial]] + +Virtual package tutorial +~~~~~~~~~~~~~~~~~~~~~~~~ + +In Buildroot, a virtual package is a package whose functionalities are +provided by one or more packages, referred to as 'providers'. The virtual +package management is an extensible mechanism allowing the user to choose +the provider used in the rootfs. + +For example, 'OpenGL ES' is an API for 2D and 3D graphics on embedded systems. +The implementation of this API is different for the 'Allwinner Tech Sunxi' and +the 'Texas Instruments OMAP35xx' plaftorms. So +libgles+ will be a virtual +package and +sunxi-mali+ and +ti-gfx+ will be the providers. + +In the following example, we will explain how to add a new virtual package +('something-virtual') and a provider for it ('some-provider'). + +First, let's create the virtual package. + +Virtual package +Config.in+ file +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The +Config.in+ file of virtual package 'something-virtual' should contain: + +--------------------------- +01: config BR2_PACKAGE_HAS_SOMETHING_VIRTUAL +02: bool +03: +04: config BR2_PACKAGE_PROVIDES_SOMETHING_VIRTUAL +05: depends on BR2_PACKAGE_HAS_SOMETHING_VIRTUAL +06: string +--------------------------- + +In this file, we declare two options, +BR2_PACKAGE_HAS_SOMETHING_VIRTUAL+ and ++BR2_PACKAGE_PROVIDES_SOMETHING_VIRTUAL+, whose values will be used by the +providers. + +Virtual package +*.mk+ file +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The Makefile +package/something-virtual/something-virtual.mk+ should contain: + +--------------------------- +01: ################################################################################ +02: # +03: # something-virtual +04: # +05: ################################################################################ +06: +07: SOMETHING_VIRTUAL_SOURCE = +08: SOMETHING_VIRTUAL_DEPENDENCIES = $(call qstrip,$(BR2_PACKAGE_PROVIDES_SOMETHING_VIRTUAL)) +09: +10: ifeq ($(BR2_PACKAGE_HAS_SOMETHING_VIRTUAL),y) +11: ifeq ($(SOMETHING_VIRTUAL_DEPENDENCIES),) +12: $(error No something-virtual implementation selected. Configuration error.) +13: endif +14: endif +15: +16: $(eval $(generic-package)) +--------------------------- + +The Makefile is quite small as it will only check if a provider for the +virtual package has been selected. + +When adding a package as a provider, only the +Config.in+ file requires some +modifications. The +*.mk+ file should follow the Buildroot infrastructure with +no change at all. + +Provider +Config.in+ file +^^^^^^^^^^^^^^^^^^^^^^^^^ + +The +Config.in+ file of the package 'some-provider', which provides the +functionalities of 'something-virtual', should contain: + +--------------------------- +01: config BR2_PACKAGE_SOME_PROVIDER +02: bool "some-provider" +03: select BR2_PACKAGE_HAS_SOMETHING_VIRTUAL +04: help +05: This is a comment that explains what some-provider is. +06: +07: http://foosoftware.org/some-provider/ +08: +09: if BR2_PACKAGE_SOME_PROVIDER +10: config BR2_PACKAGE_PROVIDES_SOMETHING_VIRTUAL +11: default "some-provider" +12: endif +--------------------------- + +On line 3, we select +BR2_PACKAGE_HAS_SOMETHING_VIRTUAL+, and on line 11, we +set the value of +BR2_PACKAGE_PROVIDES_SOMETHING_VIRTUAL+ to the name of the +provider, but only if it is selected. + +Of course, do not forget to add the proper build and runtime dependencies for +this package! diff --git a/docs/manual/adding-packages.txt b/docs/manual/adding-packages.txt index cc86529..f763282 100644 --- a/docs/manual/adding-packages.txt +++ b/docs/manual/adding-packages.txt @@ -22,6 +22,8 @@ include::adding-packages-python.txt[] include::adding-packages-luarocks.txt[] +include::adding-packages-virtual.txt[] + include::adding-packages-hooks.txt[] include::adding-packages-gettext.txt[] -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 2/2] manual: add virtual package tutorial. 2014-02-25 15:45 ` [Buildroot] [PATCH v2 2/2] manual: add virtual package tutorial Eric Le Bihan @ 2014-02-25 20:01 ` Samuel Martin 2014-02-25 20:38 ` Eric Le Bihan 2014-02-25 22:30 ` Yann E. MORIN 1 sibling, 1 reply; 9+ messages in thread From: Samuel Martin @ 2014-02-25 20:01 UTC (permalink / raw) To: buildroot Hi Eric, On Tue, Feb 25, 2014 at 4:45 PM, Eric Le Bihan <eric.le.bihan.dev@free.fr> wrote: [...] > + > +Provider +Config.in+ file > +^^^^^^^^^^^^^^^^^^^^^^^^^ > + > +The +Config.in+ file of the package 'some-provider', which provides the > +functionalities of 'something-virtual', should contain: > + No word about the provider's *.mk file which does not need any change? > +--------------------------- > +01: config BR2_PACKAGE_SOME_PROVIDER > +02: bool "some-provider" > +03: select BR2_PACKAGE_HAS_SOMETHING_VIRTUAL > +04: help > +05: This is a comment that explains what some-provider is. > +06: > +07: http://foosoftware.org/some-provider/ > +08: > +09: if BR2_PACKAGE_SOME_PROVIDER > +10: config BR2_PACKAGE_PROVIDES_SOMETHING_VIRTUAL > +11: default "some-provider" > +12: endif > +--------------------------- > + > +On line 3, we select +BR2_PACKAGE_HAS_SOMETHING_VIRTUAL+, and on line 11, we > +set the value of +BR2_PACKAGE_PROVIDES_SOMETHING_VIRTUAL+ to the name of the > +provider, but only if it is selected. > + > +Of course, do not forget to add the proper build and runtime dependencies for > +this package! > diff --git a/docs/manual/adding-packages.txt b/docs/manual/adding-packages.txt > index cc86529..f763282 100644 > --- a/docs/manual/adding-packages.txt > +++ b/docs/manual/adding-packages.txt > @@ -22,6 +22,8 @@ include::adding-packages-python.txt[] > > include::adding-packages-luarocks.txt[] > > +include::adding-packages-virtual.txt[] > + > include::adding-packages-hooks.txt[] > > include::adding-packages-gettext.txt[] > -- Otherwise, it looks good! :) Regards, -- Samuel ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 2/2] manual: add virtual package tutorial. 2014-02-25 20:01 ` Samuel Martin @ 2014-02-25 20:38 ` Eric Le Bihan 0 siblings, 0 replies; 9+ messages in thread From: Eric Le Bihan @ 2014-02-25 20:38 UTC (permalink / raw) To: buildroot Hi! On Tue, Feb 25, 2014 at 09:01:54PM +0100, Samuel Martin wrote: > Hi Eric, > > On Tue, Feb 25, 2014 at 4:45 PM, Eric Le Bihan > <eric.le.bihan.dev@free.fr> wrote: > [...] > > + > > +Provider +Config.in+ file > > +^^^^^^^^^^^^^^^^^^^^^^^^^ > > + > > +The +Config.in+ file of the package 'some-provider', which provides the > > +functionalities of 'something-virtual', should contain: > > + > > No word about the provider's *.mk file which does not need any change? I added a line about it, but when I converted the example to plain section, I have not noticed that the line stayed above the targeted section ("D'Oh"^5)... Will fix. Thanks for your reviews! Best regards, ELB ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 2/2] manual: add virtual package tutorial. 2014-02-25 15:45 ` [Buildroot] [PATCH v2 2/2] manual: add virtual package tutorial Eric Le Bihan 2014-02-25 20:01 ` Samuel Martin @ 2014-02-25 22:30 ` Yann E. MORIN 1 sibling, 0 replies; 9+ messages in thread From: Yann E. MORIN @ 2014-02-25 22:30 UTC (permalink / raw) To: buildroot Eric, All, On 2014-02-25 16:45 +0100, Eric Le Bihan spake thusly: > The manual now features a new section with instructions about how to add a > virtual package. > > Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr> Same comment as Samuel. Otherwise, I agree with Arnout: we will soon have a virtual-package infrastructure (see my recent RFC series), and virtual packages are not something we expect to be added very often. I know I pushed you to repost an updated version of that patch, so we could get it in for 2014.02, but in restrospect, Arnout is right: we can well wait post-release to aply it. My apologies. Anyway, this patch is rather good, and will need only minor changes (ie. removals) to the .mk section once we have the virtual-package infra. Thank you for your work on this! :-) Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-02-25 22:30 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-02-25 15:45 [Buildroot] [PATCH v2 0/2] improve virtual package management Eric Le Bihan 2014-02-25 15:45 ` [Buildroot] [PATCH v2 1/2] packages: improve dependency check in virtual packages Eric Le Bihan 2014-02-25 16:07 ` Samuel Martin 2014-02-25 20:30 ` Peter Korsgaard 2014-02-25 21:40 ` Yann E. MORIN 2014-02-25 15:45 ` [Buildroot] [PATCH v2 2/2] manual: add virtual package tutorial Eric Le Bihan 2014-02-25 20:01 ` Samuel Martin 2014-02-25 20:38 ` Eric Le Bihan 2014-02-25 22:30 ` Yann E. MORIN
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox