diff mbox

[08/30] jpeg: convert to a real package

Message ID 1362007582-14753-9-git-send-email-thomas.petazzoni@free-electrons.com
State Accepted
Commit 30c695ef01340855cb74a35bb465fb7408c0fb7e
Headers show

Commit Message

Thomas Petazzoni Feb. 27, 2013, 11:25 p.m. UTC
jpeg is a virtual package, but since it is listed in the dependencies
of other packages, it should obey to all the normal make rules for
packages. Notably, the jpeg-show-depends target is mandatory for the
graph-depends script to work.

Instead to implement such a make target manually, make jpeg a normal
generic-package, except that it doesn't have any source.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/jpeg/jpeg.mk |   22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

Comments

Samuel Martin Feb. 28, 2013, 10:13 p.m. UTC | #1
Hi Thomas, all,

2013/2/28 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> jpeg is a virtual package, but since it is listed in the dependencies
> of other packages, it should obey to all the normal make rules for
> packages. Notably, the jpeg-show-depends target is mandatory for the
> graph-depends script to work.
>
> Instead to implement such a make target manually, make jpeg a normal
> generic-package, except that it doesn't have any source.
Nice, it also prevents from fault positive match (about the
infrastructure) in the autobuilder stats :)

>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  package/jpeg/jpeg.mk |   22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/package/jpeg/jpeg.mk b/package/jpeg/jpeg.mk
> index 3caacaa..962908d 100644
> --- a/package/jpeg/jpeg.mk
> +++ b/package/jpeg/jpeg.mk
> @@ -1,10 +1,24 @@
>  #############################################################
>  #
> -# jpeg
> +# Virtual jpeg package
>  #
>  #############################################################
>
> -jpeg: $(if $(BR2_PACKAGE_JPEG_TURBO),jpeg-turbo,libjpeg)
> +JPEG_SOURCE =
>
> -host-jpeg: host-libjpeg
Does this change break few packages?
AFAICS, libeet and libevas seem depend on host-jpeg.

> -host-jpeg-source: host-libjpeg-source
> +ifeq ($(BR2_PACKAGE_JPEG_TURBO),y)
> +JPEG_DEPENDENCIES += jpeg-turbo
> +endif
> +
> +ifeq ($(BR2_PACKAGE_LIBJPEG),y)
> +JPEG_DEPENDENCIES += libjpeg
> +endif
> +
> +ifeq ($(JPEG_DEPENDENCIES),)
> +define JPEG_CONFIGURE_CMDS
> +       echo "No JPEG implementation defined. Configuration error"
> +       exit 1
> +endef
> +endif
> +
> +$(eval $(generic-package))
> --

A bit off-topic: this is the first virtual package, it'd be good to
have a clean and known way of handling virtual packages.

Regards,
Thomas Petazzoni Feb. 28, 2013, 11:13 p.m. UTC | #2
Dear Samuel Martin,

On Thu, 28 Feb 2013 23:13:03 +0100, Samuel Martin wrote:

> > Instead to implement such a make target manually, make jpeg a normal
> > generic-package, except that it doesn't have any source.
> Nice, it also prevents from fault positive match (about the
> infrastructure) in the autobuilder stats :)

Yes, the point is that by re-using the package infrastructure, we are
much cleaner in terms of integration with the download stuff, the
licensing feature and so on.

> > diff --git a/package/jpeg/jpeg.mk b/package/jpeg/jpeg.mk
> > index 3caacaa..962908d 100644
> > --- a/package/jpeg/jpeg.mk
> > +++ b/package/jpeg/jpeg.mk
> > @@ -1,10 +1,24 @@
> >  #############################################################
> >  #
> > -# jpeg
> > +# Virtual jpeg package
> >  #
> >  #############################################################
> >
> > -jpeg: $(if $(BR2_PACKAGE_JPEG_TURBO),jpeg-turbo,libjpeg)
> > +JPEG_SOURCE =
> >
> > -host-jpeg: host-libjpeg
> Does this change break few packages?
> AFAICS, libeet and libevas seem depend on host-jpeg.

Looks like I miss a $(eval $(host-generic-package)) at the end of the
file, and maybe a few more things. I'll look into this. Good point,
thanks for raising it!

> A bit off-topic: this is the first virtual package, it'd be good to
> have a clean and known way of handling virtual packages.

Yes. I would maybe wait that we have a few of them to see what is the
real pattern between them, but then documenting it will definitely be
useful, of course.

Best regards,

Thomas
diff mbox

Patch

diff --git a/package/jpeg/jpeg.mk b/package/jpeg/jpeg.mk
index 3caacaa..962908d 100644
--- a/package/jpeg/jpeg.mk
+++ b/package/jpeg/jpeg.mk
@@ -1,10 +1,24 @@ 
 #############################################################
 #
-# jpeg
+# Virtual jpeg package
 #
 #############################################################
 
-jpeg: $(if $(BR2_PACKAGE_JPEG_TURBO),jpeg-turbo,libjpeg)
+JPEG_SOURCE =
 
-host-jpeg: host-libjpeg
-host-jpeg-source: host-libjpeg-source
+ifeq ($(BR2_PACKAGE_JPEG_TURBO),y)
+JPEG_DEPENDENCIES += jpeg-turbo
+endif
+
+ifeq ($(BR2_PACKAGE_LIBJPEG),y)
+JPEG_DEPENDENCIES += libjpeg
+endif
+
+ifeq ($(JPEG_DEPENDENCIES),)
+define JPEG_CONFIGURE_CMDS
+	echo "No JPEG implementation defined. Configuration error"
+	exit 1
+endef
+endif
+
+$(eval $(generic-package))