Skip to contentSkip to conversation

python3-pillow-heif: Add recipe

PATCH In review Leon Anavi 3 participants 5 messages May 8, 2025 – May 22, 2025

lore
Share & tools
lore

Leon Anavi

author
#0 lore raw

PATCH v2 1/1 python3-pillow-heif: Add recipe

Add recipe for release 0.22.0:

- Boolean pillow_heif.options.DISABLE_SECURITY_LIMITS to bypass security limit of libheif for the image size.
- libx265 library was updated to the latest 4.1 version.
- libheif was updated from the 1.19.5 to 1.19.7 version.
- AVIF format marked as deprecated and pending for the removal.

This work was sponsored by GOVCERT.LU.

---
 ...001-setup.py-support-cross-compiling.patch | 56 +++++++++++++++++++
 .../python/python3-pillow-heif_0.22.0.bb      | 20 +++++++
 2 files changed, 76 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +56 -0
new file mode 100644
index 0000000000..66cf7a9244
@@ -0,0 +1,56 @@
+From 98e6831754712221ce030ce8b27e100a3926c543 Mon Sep 17 00:00:00 2001
+From: Leon Anavi <[email protected]>
+Date: Mon, 5 May 2025 16:08:37 +0000
+Subject: [PATCH] setup.py: support cross compiling
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Leon Anavi <[email protected]>
+---
+ setup.py | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 68945e4..67566e8 100644
+--- a/setup.py
++++ b/setup.py
+@@ -125,12 +125,12 @@ class PillowHeifBuildExt(build_ext):
+                     self._add_directory(library_dirs, match.group(1))
+ 
+         # include, rpath, if set as environment variables
+-        for k in ("C_INCLUDE_PATH", "CPATH", "INCLUDE"):
++        for k in ("C_INCLUDE_PATH", "CPATH", "INCLUDE", "STAGING_INCDIR"):
+             if k in os.environ:
+                 for d in os.environ[k].split(os.path.pathsep):
+                     self._add_directory(include_dirs, d)
+ 
+-        for k in ("LD_RUN_PATH", "LIBRARY_PATH", "LIB"):
++        for k in ("LD_RUN_PATH", "LIBRARY_PATH", "LIB", "STAGING_LIBDIR"):
+             if k in os.environ:
+                 for d in os.environ[k].split(os.path.pathsep):
+                     self._add_directory(library_dirs, d)
+@@ -199,12 +199,15 @@ class PillowHeifBuildExt(build_ext):
+             self._update_extension("_pillow_heif", ["heif"], extra_compile_args=["-O3", "-Werror"])
+         else:  # let's assume it's some kind of linux
+             # this old code waiting for refactoring, when time comes.
+-            self._add_directory(include_dirs, "/usr/local/include")
+-            self._add_directory(include_dirs, "/usr/include")
+-            self._add_directory(library_dirs, "/usr/local/lib")
+-            self._add_directory(library_dirs, "/usr/lib64")
+-            self._add_directory(library_dirs, "/usr/lib")
+-            self._add_directory(library_dirs, "/lib")
++            include_os_path = os.environ.get("STAGING_INCDIR")
++            if include_os_path:
++                for path in include_os_path.split(os.pathsep):
++                    self._add_directory(include_dirs, path)
++
++            lib_os_path = os.environ.get("STAGING_LIBDIR")
++            if lib_os_path:
++                for path in lib_os_path.split(os.pathsep):
++                    self._add_directory(library_dirs, path)
+ 
+             self._update_extension("_pillow_heif", ["heif"], extra_compile_args=["-O3", "-Werror"])
+ 
+-- 
+2.39.5
+
meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb new file +20 -0
new file mode 100644
index 0000000000..7f5dfac702
@@ -0,0 +1,20 @@
+DESCRIPTION = "Python interface for libheif library"
+HOMEPAGE = "https://github.com/bigcat88/pillow_heif"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b6c07a92aed67c33bc346748d7c7e991"
+
+# While this item does not require it, it depends on libheif which does
+LICENSE_FLAGS = "commercial"
+
+PYPI_PACKAGE = "pillow_heif"
+
+inherit pypi python_setuptools_build_meta
+
+SRC_URI += "file://0001-setup.py-support-cross-compiling.patch"
+SRC_URI[sha256sum] = "61d473929340d3073722f6316b7fbbdb11132faa6bac0242328e8436cc55b39a"
+
+DEPENDS += "libheif"
+
+RDEPENDS:${PN} += "python3-pillow"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.39.5
#1 lore raw
Quoted 8 lines · Leon Anavi via lists.openembedded.org

Add recipe for release 0.22.0:

- Boolean pillow_heif.options.DISABLE_SECURITY_LIMITS to bypass security limit of libheif for the image size.
- libx265 library was updated to the latest 4.1 version.
- libheif was updated from the 1.19.5 to 1.19.7 version.
- AVIF format marked as deprecated and pending for the removal.

Quoted 4 lines

This work was sponsored by GOVCERT.LU.

Hello,

This recipe triggers build failures when doing a meta-python world build :
libheif is in meta-multimedia but meta-python does not depend on meta-multimedia.
https://autobuilder.yoctoproject.org/valkyrie/#/builders/87/builds/46/steps/41/logs/stdio
(line 74)

Maybe this recipe should be moved to meta-multimedia?

NB: meta-multimedia does depends on meta-python

Regards,

Quoted 123 lines
---
 ...001-setup.py-support-cross-compiling.patch | 56 +++++++++++++++++++
 .../python/python3-pillow-heif_0.22.0.bb      | 20 +++++++
 2 files changed, 76 insertions(+)
 create mode 100644
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch
 create mode 100644 meta-python/recipes-devtools/python/

python3-pillow-heif_0.22.0.bb

diff --git a/meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch b/meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file mode 100644
index 0000000000..66cf7a9244
--- /dev/null
+++
b/meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +22 -0
@@ -0,0 +1,56 @@
+From 98e6831754712221ce030ce8b27e100a3926c543 Mon Sep 17 00:00:00 2001
+From: Leon Anavi <[email protected]>
+Date: Mon, 5 May 2025 16:08:37 +0000
+Subject: [PATCH] setup.py: support cross compiling
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Leon Anavi <[email protected]>
+---
+ setup.py | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 68945e4..67566e8 100644
+--- a/setup.py
++++ b/setup.py
+@@ -125,12 +125,12 @@ class PillowHeifBuildExt(build_ext):
+                     self._add_directory(library_dirs, match.group(1))
+
+         # include, rpath, if set as environment variables
+-        for k in ("C_INCLUDE_PATH", "CPATH", "INCLUDE"):
++        for k in ("C_INCLUDE_PATH", "CPATH", "INCLUDE",

"STAGING_INCDIR"):

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +6 -0
+             if k in os.environ:
+                 for d in os.environ[k].split(os.path.pathsep):
+                     self._add_directory(include_dirs, d)
+
+-        for k in ("LD_RUN_PATH", "LIBRARY_PATH", "LIB"):
++        for k in ("LD_RUN_PATH", "LIBRARY_PATH", "LIB",

"STAGING_LIBDIR"):

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +5 -0
+             if k in os.environ:
+                 for d in os.environ[k].split(os.path.pathsep):
+                     self._add_directory(library_dirs, d)
+@@ -199,12 +199,15 @@ class PillowHeifBuildExt(build_ext):
+             self._update_extension("_pillow_heif", ["heif"],

extra_compile_args=["-O3", "-Werror"])

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +19 -0
+         else:  # let's assume it's some kind of linux
+             # this old code waiting for refactoring, when time comes.
+-            self._add_directory(include_dirs, "/usr/local/include")
+-            self._add_directory(include_dirs, "/usr/include")
+-            self._add_directory(library_dirs, "/usr/local/lib")
+-            self._add_directory(library_dirs, "/usr/lib64")
+-            self._add_directory(library_dirs, "/usr/lib")
+-            self._add_directory(library_dirs, "/lib")
++            include_os_path = os.environ.get("STAGING_INCDIR")
++            if include_os_path:
++                for path in include_os_path.split(os.pathsep):
++                    self._add_directory(include_dirs, path)
++
++            lib_os_path = os.environ.get("STAGING_LIBDIR")
++            if lib_os_path:
++                for path in lib_os_path.split(os.pathsep):
++                    self._add_directory(library_dirs, path)
+
+             self._update_extension("_pillow_heif", ["heif"],

extra_compile_args=["-O3", "-Werror"])

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +4 -0
+
+--
+2.39.5
+
(quoted diff) +0 -0

python3-pillow-heif_0.22.0.bb b/meta-python/recipes-devtools/python/ python3-pillow-heif_0.22.0.bb
new file mode 100644
index 0000000000..7f5dfac702

meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb new file +4 -0
@@ -0,0 +1,20 @@
+DESCRIPTION = "Python interface for libheif library"
+HOMEPAGE = "https://github.com/bigcat88/pillow_heif"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM =

"file://LICENSE.txt;md5=b6c07a92aed67c33bc346748d7c7e991"

meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb new file +10 -0
+
+# While this item does not require it, it depends on libheif which does
+LICENSE_FLAGS = "commercial"
+
+PYPI_PACKAGE = "pillow_heif"
+
+inherit pypi python_setuptools_build_meta
+
+SRC_URI += "file://0001-setup.py-support-cross-compiling.patch"
+SRC_URI[sha256sum] =

"61d473929340d3073722f6316b7fbbdb11132faa6bac0242328e8436cc55b39a"

meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb new file +6 -1
+
+DEPENDS += "libheif"
+
+RDEPENDS:${PN} += "python3-pillow"
+
+BBCLASSEXTEND = "native nativesdk"
--

2.39.5

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#117361):
https://lists.openembedded.org/g/openembedded-devel/message/117361
Mute This Topic: https://lists.openembedded.org/mt/112783025/4316185
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
Yoann Congal
Smile ECS
#2 lore raw
Quoted 18 lines · Yoann Congal via lists.openembedded.org
Quoted 9 lines · Leon Anavi via lists.openembedded.org

Add recipe for release 0.22.0:

- Boolean pillow_heif.options.DISABLE_SECURITY_LIMITS to bypass security limit of libheif for the image size.
- libx265 library was updated to the latest 4.1 version.
- libheif was updated from the 1.19.5 to 1.19.7 version.
- AVIF format marked as deprecated and pending for the removal.

Quoted 3 lines

This work was sponsored by GOVCERT.LU.

Quoted 9 lines

Hello,

This recipe triggers build failures when doing a meta-python world build : libheif is in meta-multimedia but meta-python does not depend on meta-multimedia.
https://autobuilder.yoctoproject.org/valkyrie/#/builders/87/builds/46/steps/41/logs/stdio (line 74)

Maybe this recipe should be moved to meta-multimedia?

NB: meta-multimedia does depends on meta-python

Seems good to me. Please send a patch

Quoted 117 lines

Regards,

Quoted 97 lines
---
 ...001-setup.py-support-cross-compiling.patch | 56 +++++++++++++++++++
 .../python/python3-pillow-heif_0.22.0.bb      | 20 +++++++
 2 files changed, 76 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +56 -0
new file mode 100644
index 0000000000..66cf7a9244
@@ -0,0 +1,56 @@
+From 98e6831754712221ce030ce8b27e100a3926c543 Mon Sep 17 00:00:00 2001
+From: Leon Anavi <[email protected]>
+Date: Mon, 5 May 2025 16:08:37 +0000
+Subject: [PATCH] setup.py: support cross compiling
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Leon Anavi <[email protected]>
+---
+ setup.py | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 68945e4..67566e8 100644
+--- a/setup.py
++++ b/setup.py
+@@ -125,12 +125,12 @@ class PillowHeifBuildExt(build_ext):
+                     self._add_directory(library_dirs, match.group(1))
+
+         # include, rpath, if set as environment variables
+-        for k in ("C_INCLUDE_PATH", "CPATH", "INCLUDE"):
++        for k in ("C_INCLUDE_PATH", "CPATH", "INCLUDE", "STAGING_INCDIR"):
+             if k in os.environ:
+                 for d in os.environ[k].split(os.path.pathsep):
+                     self._add_directory(include_dirs, d)
+
+-        for k in ("LD_RUN_PATH", "LIBRARY_PATH", "LIB"):
++        for k in ("LD_RUN_PATH", "LIBRARY_PATH", "LIB", "STAGING_LIBDIR"):
+             if k in os.environ:
+                 for d in os.environ[k].split(os.path.pathsep):
+                     self._add_directory(library_dirs, d)
+@@ -199,12 +199,15 @@ class PillowHeifBuildExt(build_ext):
+             self._update_extension("_pillow_heif", ["heif"], extra_compile_args=["-O3", "-Werror"])
+         else:  # let's assume it's some kind of linux
+             # this old code waiting for refactoring, when time comes.
+-            self._add_directory(include_dirs, "/usr/local/include")
+-            self._add_directory(include_dirs, "/usr/include")
+-            self._add_directory(library_dirs, "/usr/local/lib")
+-            self._add_directory(library_dirs, "/usr/lib64")
+-            self._add_directory(library_dirs, "/usr/lib")
+-            self._add_directory(library_dirs, "/lib")
++            include_os_path = os.environ.get("STAGING_INCDIR")
++            if include_os_path:
++                for path in include_os_path.split(os.pathsep):
++                    self._add_directory(include_dirs, path)
++
++            lib_os_path = os.environ.get("STAGING_LIBDIR")
++            if lib_os_path:
++                for path in lib_os_path.split(os.pathsep):
++                    self._add_directory(library_dirs, path)
+
+             self._update_extension("_pillow_heif", ["heif"], extra_compile_args=["-O3", "-Werror"])
+
+--
+2.39.5
+
meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb new file +20 -1
new file mode 100644
index 0000000000..7f5dfac702
@@ -0,0 +1,20 @@
+DESCRIPTION = "Python interface for libheif library"
+HOMEPAGE = "https://github.com/bigcat88/pillow_heif"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b6c07a92aed67c33bc346748d7c7e991"
+
+# While this item does not require it, it depends on libheif which does
+LICENSE_FLAGS = "commercial"
+
+PYPI_PACKAGE = "pillow_heif"
+
+inherit pypi python_setuptools_build_meta
+
+SRC_URI += "file://0001-setup.py-support-cross-compiling.patch"
+SRC_URI[sha256sum] = "61d473929340d3073722f6316b7fbbdb11132faa6bac0242328e8436cc55b39a"
+
+DEPENDS += "libheif"
+
+RDEPENDS:${PN} += "python3-pillow"
+
+BBCLASSEXTEND = "native nativesdk"
--
Quoted 5 lines

2.39.5

--
Yoann Congal
Smile ECS

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#117464): https://lists.openembedded.org/g/openembedded-devel/message/117464
Mute This Topic: https://lists.openembedded.org/mt/112783025/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#3 lore raw

Hi Yoann, Khem,

Quoted 31 lines · Khem Raj
Quoted 4 lines · Yoann Congal via lists.openembedded.org

Le jeu. 8 mai 2025 à 08:33, Leon Anavi via lists.openembedded.org

Quoted 9 lines · <[email protected]> a écrit :
Quoted 9 lines

Add recipe for release 0.22.0:

- Boolean pillow_heif.options.DISABLE_SECURITY_LIMITS to bypass security limit of libheif for the image size.
- libx265 library was updated to the latest 4.1 version.
- libheif was updated from the 1.19.5 to 1.19.7 version.
- AVIF format marked as deprecated and pending for the removal.

Quoted 8 lines
Quoted 3 lines

This work was sponsored by GOVCERT.LU.

Hello,

This recipe triggers build failures when doing a meta-python world build

: libheif is in meta-multimedia but meta-python does not depend on meta-multimedia.

Quoted 1 line

https://autobuilder.yoctoproject.org/valkyrie/#/builders/87/builds/46/steps/41/logs/stdio
(line 74)

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

Maybe this recipe should be moved to meta-multimedia?

NB: meta-multimedia does depends on meta-python

Seems good to me. Please send a patch

Thank you for the suggestion. As you recommended, I have just sent a patch to move python3-pillow-heif to meta-multimedia:
https://lists.openembedded.org/g/openembedded-devel/topic/meta_multimedia_patch/113245750

Best regards,
Leon

Quoted 134 lines
Quoted 8 lines

Regards,

Quoted 6 lines
---
 ...001-setup.py-support-cross-compiling.patch | 56 +++++++++++++++++++
 .../python/python3-pillow-heif_0.22.0.bb      | 20 +++++++
 2 files changed, 76 insertions(+)
 create mode 100644

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 1 line
Quoted 1 line
 create mode 100644 meta-python/recipes-devtools/python/

python3-pillow-heif_0.22.0.bb

Quoted 2 lines
Quoted 2 lines

diff --git

a/meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch b/meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 4 lines
Quoted 4 lines

new file mode 100644
index 0000000000..66cf7a9244
--- /dev/null
+++

b/meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 15 lines
Quoted 15 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +14 -0
@@ -0,0 +1,56 @@
+From 98e6831754712221ce030ce8b27e100a3926c543 Mon Sep 17 00:00:00 2001
+From: Leon Anavi <[email protected]>
+Date: Mon, 5 May 2025 16:08:37 +0000
+Subject: [PATCH] setup.py: support cross compiling
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Leon Anavi <[email protected]>
+---
+ setup.py | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 68945e4..67566e8 100644
Quoted 8 lines

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 8 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +8 -0
+--- a/setup.py
++++ b/setup.py
+@@ -125,12 +125,12 @@ class PillowHeifBuildExt(build_ext):
+                     self._add_directory(library_dirs, match.group(1))
+
+         # include, rpath, if set as environment variables
+-        for k in ("C_INCLUDE_PATH", "CPATH", "INCLUDE"):
++        for k in ("C_INCLUDE_PATH", "CPATH", "INCLUDE",

"STAGING_INCDIR"):

Quoted 6 lines

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 6 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +6 -0
+             if k in os.environ:
+                 for d in os.environ[k].split(os.path.pathsep):
+                     self._add_directory(include_dirs, d)
+
+-        for k in ("LD_RUN_PATH", "LIBRARY_PATH", "LIB"):
++        for k in ("LD_RUN_PATH", "LIBRARY_PATH", "LIB",

"STAGING_LIBDIR"):

Quoted 5 lines

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 5 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +5 -0
+             if k in os.environ:
+                 for d in os.environ[k].split(os.path.pathsep):
+                     self._add_directory(library_dirs, d)
+@@ -199,12 +199,15 @@ class PillowHeifBuildExt(build_ext):
+             self._update_extension("_pillow_heif", ["heif"],

extra_compile_args=["-O3", "-Werror"])

Quoted 11 lines
Quoted 11 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +11 -0
+         else:  # let's assume it's some kind of linux
+             # this old code waiting for refactoring, when time comes.
+-            self._add_directory(include_dirs, "/usr/local/include")
+-            self._add_directory(include_dirs, "/usr/include")
+-            self._add_directory(library_dirs, "/usr/local/lib")
+-            self._add_directory(library_dirs, "/usr/lib64")
+-            self._add_directory(library_dirs, "/usr/lib")
+-            self._add_directory(library_dirs, "/lib")
++            include_os_path = os.environ.get("STAGING_INCDIR")
++            if include_os_path:
++                for path in include_os_path.split(os.pathsep):
Quoted 8 lines

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 8 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +8 -0
++                    self._add_directory(include_dirs, path)
++
++            lib_os_path = os.environ.get("STAGING_LIBDIR")
++            if lib_os_path:
++                for path in lib_os_path.split(os.pathsep):
++                    self._add_directory(library_dirs, path)
+
+             self._update_extension("_pillow_heif", ["heif"],

extra_compile_args=["-O3", "-Werror"])

Quoted 5 lines

Review

Quoted 5 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +4 -0
+
+--
+2.39.5
+
(quoted diff) +0 -0

python3-pillow-heif_0.22.0.bb b/meta-python/recipes-devtools/python/ python3-pillow-heif_0.22.0.bb

Quoted 9 lines

meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb line 4

Quoted 9 lines

new file mode 100644
index 0000000000..7f5dfac702

meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb new file +4 -0
@@ -0,0 +1,20 @@
+DESCRIPTION = "Python interface for libheif library"
+HOMEPAGE = "https://github.com/bigcat88/pillow_heif"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM =

"file://LICENSE.txt;md5=b6c07a92aed67c33bc346748d7c7e991"

Quoted 10 lines

meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb

Quoted 10 lines
meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb new file +10 -0
+
+# While this item does not require it, it depends on libheif which does
+LICENSE_FLAGS = "commercial"
+
+PYPI_PACKAGE = "pillow_heif"
+
+inherit pypi python_setuptools_build_meta
+
+SRC_URI += "file://0001-setup.py-support-cross-compiling.patch"
+SRC_URI[sha256sum] =

"61d473929340d3073722f6316b7fbbdb11132faa6bac0242328e8436cc55b39a"

Quoted 18 lines
Quoted 7 lines
meta-python/recipes-devtools/python/python3-pillow-heif_0.22.0.bb new file +6 -1
+
+DEPENDS += "libheif"
+
+RDEPENDS:${PN} += "python3-pillow"
+
+BBCLASSEXTEND = "native nativesdk"
--
Quoted 5 lines

2.39.5

--
Yoann Congal
Smile ECS

Quoted 3 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#117464):

https://lists.openembedded.org/g/openembedded-devel/message/117464

Quoted 3 lines

Mute This Topic: https://lists.openembedded.org/mt/112783025/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [

[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
Quoted 40 lines · Leon Anavi

Hi Yoann, Khem,

Quoted 36 lines · Khem Raj
Quoted 4 lines · Yoann Congal via lists.openembedded.org

Le jeu. 8 mai 2025 à 08:33, Leon Anavi via lists.openembedded.org

Quoted 9 lines · <[email protected]> a écrit :
Quoted 9 lines

Add recipe for release 0.22.0:

- Boolean pillow_heif.options.DISABLE_SECURITY_LIMITS to bypass security limit of libheif for the image size.
- libx265 library was updated to the latest 4.1 version.
- libheif was updated from the 1.19.5 to 1.19.7 version.
- AVIF format marked as deprecated and pending for the removal.

Quoted 8 lines
Quoted 3 lines

This work was sponsored by GOVCERT.LU.

Hello,

This recipe triggers build failures when doing a meta-python world

build : libheif is in meta-multimedia but meta-python does not depend on meta-multimedia.

Quoted 1 line

https://autobuilder.yoctoproject.org/valkyrie/#/builders/87/builds/46/steps/41/logs/stdio
(line 74)

Quoted 5 lines

Maybe this recipe should be moved to meta-multimedia?

NB: meta-multimedia does depends on meta-python

Quoted 8 lines
Quoted 2 lines

Seems good to me. Please send a patch

Thank you for the suggestion. As you recommended, I have just sent a patch to move python3-pillow-heif to meta-multimedia:

https://lists.openembedded.org/g/openembedded-devel/topic/meta_multimedia_patch/113245750

Thanks a lot for the patch :-)

Quoted 142 lines

Best regards,
Leon

Quoted 136 lines
Quoted 8 lines

Regards,

Quoted 6 lines
---
 ...001-setup.py-support-cross-compiling.patch | 56 +++++++++++++++++++
 .../python/python3-pillow-heif_0.22.0.bb      | 20 +++++++
 2 files changed, 76 insertions(+)
 create mode 100644

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 1 line
Quoted 1 line
 create mode 100644 meta-python/recipes-devtools/python/

python3-pillow-heif_0.22.0.bb

Quoted 2 lines
Quoted 2 lines

diff --git

a/meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch b/meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 4 lines
Quoted 4 lines

new file mode 100644
index 0000000000..66cf7a9244
--- /dev/null
+++

b/meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 15 lines
Quoted 15 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +14 -0
@@ -0,0 +1,56 @@
+From 98e6831754712221ce030ce8b27e100a3926c543 Mon Sep 17 00:00:00 2001
+From: Leon Anavi <[email protected]>
+Date: Mon, 5 May 2025 16:08:37 +0000
+Subject: [PATCH] setup.py: support cross compiling
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Leon Anavi <[email protected]>
+---
+ setup.py | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 68945e4..67566e8 100644
Quoted 8 lines

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 8 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +8 -0
+--- a/setup.py
++++ b/setup.py
+@@ -125,12 +125,12 @@ class PillowHeifBuildExt(build_ext):
+                     self._add_directory(library_dirs, match.group(1))
+
+         # include, rpath, if set as environment variables
+-        for k in ("C_INCLUDE_PATH", "CPATH", "INCLUDE"):
++        for k in ("C_INCLUDE_PATH", "CPATH", "INCLUDE",

"STAGING_INCDIR"):

Quoted 6 lines

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 6 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +6 -0
+             if k in os.environ:
+                 for d in os.environ[k].split(os.path.pathsep):
+                     self._add_directory(include_dirs, d)
+
+-        for k in ("LD_RUN_PATH", "LIBRARY_PATH", "LIB"):
++        for k in ("LD_RUN_PATH", "LIBRARY_PATH", "LIB",

"STAGING_LIBDIR"):

Quoted 5 lines

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 5 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +5 -0
+             if k in os.environ:
+                 for d in os.environ[k].split(os.path.pathsep):
+                     self._add_directory(library_dirs, d)
+@@ -199,12 +199,15 @@ class PillowHeifBuildExt(build_ext):
+             self._update_extension("_pillow_heif", ["heif"],

extra_compile_args=["-O3", "-Werror"])

Quoted 11 lines
Quoted 11 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +11 -0
+         else:  # let's assume it's some kind of linux
+             # this old code waiting for refactoring, when time comes.
+-            self._add_directory(include_dirs, "/usr/local/include")
+-            self._add_directory(include_dirs, "/usr/include")
+-            self._add_directory(library_dirs, "/usr/local/lib")
+-            self._add_directory(library_dirs, "/usr/lib64")
+-            self._add_directory(library_dirs, "/usr/lib")
+-            self._add_directory(library_dirs, "/lib")
++            include_os_path = os.environ.get("STAGING_INCDIR")
++            if include_os_path:
++                for path in include_os_path.split(os.pathsep):
Quoted 8 lines

meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch

Quoted 8 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +8 -0
++                    self._add_directory(include_dirs, path)
++
++            lib_os_path = os.environ.get("STAGING_LIBDIR")
++            if lib_os_path:
++                for path in lib_os_path.split(os.pathsep):
++                    self._add_directory(library_dirs, path)
+
+             self._update_extension("_pillow_heif", ["heif"],

extra_compile_args=["-O3", "-Werror"])

Quoted 5 lines

Review

Quoted 5 lines
meta-python/recipes-devtools/python/python3-pillow-heif/0001-setup.py-support-cross-compiling.patch new file +4 -0
+
+--
+2.39.5
+
(quoted diff) +0 -0

python3-pillow-heif_0.22.0.bb b/meta-python/recipes-devtools/python/ python3-pillow-heif_0.22.0.bb

Quoted 4 lines

meta-python/recipes-devtools/python/

Quoted 4 lines

new file mode 100644
index 0000000000..7f5dfac702

meta-python/recipes-devtools/python/ new file +0 -0

python3-pillow-heif_0.22.0.bb

Quoted 5 lines

meta-python/recipes-devtools/python/ line 4

Quoted 5 lines
meta-python/recipes-devtools/python/ new file +4 -0
@@ -0,0 +1,20 @@
+DESCRIPTION = "Python interface for libheif library"
+HOMEPAGE = "https://github.com/bigcat88/pillow_heif"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM =

"file://LICENSE.txt;md5=b6c07a92aed67c33bc346748d7c7e991"

Quoted 2 lines

meta-python/recipes-devtools/python/ line 6

Quoted 2 lines
meta-python/recipes-devtools/python/ new file +2 -0
+
+# While this item does not require it, it depends on libheif which

does

Quoted 8 lines

meta-python/recipes-devtools/python/ line 14

Quoted 8 lines
meta-python/recipes-devtools/python/ new file +8 -0
+LICENSE_FLAGS = "commercial"
+
+PYPI_PACKAGE = "pillow_heif"
+
+inherit pypi python_setuptools_build_meta
+
+SRC_URI += "file://0001-setup.py-support-cross-compiling.patch"
+SRC_URI[sha256sum] =

"61d473929340d3073722f6316b7fbbdb11132faa6bac0242328e8436cc55b39a"

Quoted 18 lines
Quoted 7 lines
meta-python/recipes-devtools/python/ new file +6 -1
+
+DEPENDS += "libheif"
+
+RDEPENDS:${PN} += "python3-pillow"
+
+BBCLASSEXTEND = "native nativesdk"
--
Quoted 5 lines

2.39.5

--
Yoann Congal
Smile ECS

Quoted 3 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#117464):

https://lists.openembedded.org/g/openembedded-devel/message/117464

Quoted 3 lines

Mute This Topic: https://lists.openembedded.org/mt/112783025/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub

[[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
Yoann Congal
Smile ECS