diff mbox series

package/python-pillow: fix host package build

Message ID 20220713115851.620731-1-thomas.petazzoni@bootlin.com
State Accepted
Headers show
Series package/python-pillow: fix host package build | expand

Commit Message

Thomas Petazzoni July 13, 2022, 11:58 a.m. UTC
In commit
d8c5d9b53437741c79cd3d759de1fe81af9055fd ("package/python-pillow:
enable host variant"), when support for the host variant of
python-pillow was added, the fact that python-pillow has optional
dependencies was not handled, and left python-pillow to autodetect its
optional dependencies.

Unfortunately, without some config options, some of its dependencies
are made mandatory, such as the JPEG library. Since for now such
support is not needed in the host variant of python-pillow, we simply
disable all optional dependencies.

To be consistent with the target variant, we also ensure to have
host-pkgconf as a dependency of the host variant.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/python-pillow/python-pillow.mk | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Yann E. MORIN July 17, 2022, 9:20 a.m. UTC | #1
Thomas, All,

On 2022-07-13 13:58 +0200, Thomas Petazzoni via buildroot spake thusly:
> In commit
> d8c5d9b53437741c79cd3d759de1fe81af9055fd ("package/python-pillow:
> enable host variant"), when support for the host variant of
> python-pillow was added, the fact that python-pillow has optional
> dependencies was not handled, and left python-pillow to autodetect its
> optional dependencies.
> 
> Unfortunately, without some config options, some of its dependencies
> are made mandatory, such as the JPEG library. Since for now such
> support is not needed in the host variant of python-pillow, we simply
> disable all optional dependencies.

Well, if some package needs host-python-pillow, that's most probably
because they are going to do some image manipulation at biuld time.

Disabling all image processing options (that require an external
library, but that's most of them?) is not so nice. It would maybe make
sense to enable all the image options for which we have host libraries.

Köry, what does your optee-os need from python-pillow? Would this patch
still work for it?

Regards,
Yann E. MORIN.

> To be consistent with the target variant, we also ensure to have
> host-pkgconf as a dependency of the host variant.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  package/python-pillow/python-pillow.mk | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/package/python-pillow/python-pillow.mk b/package/python-pillow/python-pillow.mk
> index 8c9cb86863..0d189ac0ca 100644
> --- a/package/python-pillow/python-pillow.mk
> +++ b/package/python-pillow/python-pillow.mk
> @@ -71,5 +71,18 @@ else
>  PYTHON_PILLOW_BUILD_OPTS += --disable-webp --disable-webpmux
>  endif
>  
> +HOST_PYTHON_PILLOW_DEPENDENCIES = host-pkgconf
> +HOST_PYTHON_PILLOW_BUILD_OPTS = \
> +	build_ext \
> +	--disable-freetype \
> +	--disable-jpeg \
> +	--disable-lcms \
> +	--disable-xcb \
> +	--disable-jpeg2000 \
> +	--disable-tiff \
> +	--disable-webp \
> +	--disable-webpmux
> +HOST_PYTHON_PILLOW_INSTALL_OPTS = $(HOST_PYTHON_PILLOW_BUILD_OPTS)
> +
>  $(eval $(python-package))
>  $(eval $(host-python-package))
> -- 
> 2.36.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Thomas Petazzoni July 17, 2022, 4:26 p.m. UTC | #2
On Sun, 17 Jul 2022 11:20:20 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> Well, if some package needs host-python-pillow, that's most probably
> because they are going to do some image manipulation at biuld time.
> 
> Disabling all image processing options (that require an external
> library, but that's most of them?) is not so nice. It would maybe make
> sense to enable all the image options for which we have host libraries.
> 
> Köry, what does your optee-os need from python-pillow? Would this patch
> still work for it?

Before submitting, I did test the optee-os build in the configuration
used by Köry to validate that the minimal host-python-pillow that I
proposed was sufficient, and it was.

That being said, grepping through the optee_os code from ST, I no
longer see where python-pillow is used. I've started a test build to
check this (but I'm pretty sure it was needed at some point, as I
looked into this with Köry).

Thomas
Thomas Petazzoni July 17, 2022, 4:47 p.m. UTC | #3
On Sun, 17 Jul 2022 18:26:32 +0200
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> That being said, grepping through the optee_os code from ST, I no
> longer see where python-pillow is used. I've started a test build to
> check this (but I'm pretty sure it was needed at some point, as I
> looked into this with Köry).

Seems like this whole python-pillow dance is in fact no longer
needed... at least I can build the latest OPTEE-OS from ST without
host-python-pillow installed (in a clean, minimal Ubuntu Docker
container).

Thomas
Yann E. MORIN July 17, 2022, 6:05 p.m. UTC | #4
Thomas, All,

On 2022-07-17 18:47 +0200, Thomas Petazzoni via buildroot spake thusly:
> On Sun, 17 Jul 2022 18:26:32 +0200
> Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> > That being said, grepping through the optee_os code from ST, I no
> > longer see where python-pillow is used. I've started a test build to
> > check this (but I'm pretty sure it was needed at some point, as I
> > looked into this with Köry).
> Seems like this whole python-pillow dance is in fact no longer
> needed... at least I can build the latest OPTEE-OS from ST without
> host-python-pillow installed (in a clean, minimal Ubuntu Docker
> container).

OK, so: applied to master, thanks.

Regards,
Yann E. MORIN.
Peter Korsgaard Aug. 10, 2022, 12:43 p.m. UTC | #5
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Thomas, All,
 > On 2022-07-17 18:47 +0200, Thomas Petazzoni via buildroot spake thusly:
 >> On Sun, 17 Jul 2022 18:26:32 +0200
 >> Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
 >> > That being said, grepping through the optee_os code from ST, I no
 >> > longer see where python-pillow is used. I've started a test build to
 >> > check this (but I'm pretty sure it was needed at some point, as I
 >> > looked into this with Köry).
 >> Seems like this whole python-pillow dance is in fact no longer
 >> needed... at least I can build the latest OPTEE-OS from ST without
 >> host-python-pillow installed (in a clean, minimal Ubuntu Docker
 >> container).

 > OK, so: applied to master, thanks.

If this was only needed for some older version of a ST vendor fork of
optee, perhaps we should just remove it again before it ends up in a
Buildroot release?
Kory Maincent Aug. 29, 2022, 9:07 a.m. UTC | #6
Hello,

On Wed, 10 Aug 2022 14:43:45 +0200
Peter Korsgaard <peter@korsgaard.com> wrote:

> >>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:  
> 
>  > Thomas, All,
>  > On 2022-07-17 18:47 +0200, Thomas Petazzoni via buildroot spake thusly:  
>  >> On Sun, 17 Jul 2022 18:26:32 +0200
>  >> Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:  
>  >> > That being said, grepping through the optee_os code from ST, I no
>  >> > longer see where python-pillow is used. I've started a test build to
>  >> > check this (but I'm pretty sure it was needed at some point, as I
>  >> > looked into this with Köry).  
>  >> Seems like this whole python-pillow dance is in fact no longer
>  >> needed... at least I can build the latest OPTEE-OS from ST without
>  >> host-python-pillow installed (in a clean, minimal Ubuntu Docker
>  >> container).  
> 
>  > OK, so: applied to master, thanks.  
> 
> If this was only needed for some older version of a ST vendor fork of
> optee, perhaps we should just remove it again before it ends up in a
> Buildroot release?

yes indeed.
Let me confirm that, I will send a patch afterwards.

Regard,

Köry
diff mbox series

Patch

diff --git a/package/python-pillow/python-pillow.mk b/package/python-pillow/python-pillow.mk
index 8c9cb86863..0d189ac0ca 100644
--- a/package/python-pillow/python-pillow.mk
+++ b/package/python-pillow/python-pillow.mk
@@ -71,5 +71,18 @@  else
 PYTHON_PILLOW_BUILD_OPTS += --disable-webp --disable-webpmux
 endif
 
+HOST_PYTHON_PILLOW_DEPENDENCIES = host-pkgconf
+HOST_PYTHON_PILLOW_BUILD_OPTS = \
+	build_ext \
+	--disable-freetype \
+	--disable-jpeg \
+	--disable-lcms \
+	--disable-xcb \
+	--disable-jpeg2000 \
+	--disable-tiff \
+	--disable-webp \
+	--disable-webpmux
+HOST_PYTHON_PILLOW_INSTALL_OPTS = $(HOST_PYTHON_PILLOW_BUILD_OPTS)
+
 $(eval $(python-package))
 $(eval $(host-python-package))