git: 5e673607f9d8 - main - graphics/py-pillow-heif: Add py-pillow-heif 0.13.0

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sat, 30 Sep 2023 23:33:39 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5e673607f9d83fa60e72b7b16ce1d79894cd971c

commit 5e673607f9d83fa60e72b7b16ce1d79894cd971c
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-09-30 23:26:33 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-09-30 23:26:33 +0000

    graphics/py-pillow-heif: Add py-pillow-heif 0.13.0
    
    Python bindings to libheif for working with HEIF images and plugin for Pillow.
    
    Features:
    - Decoding of 8, 10, 12 bit HEIC and AVIF files.
    - Encoding of 8, 10, 12 bit HEIC and AVIF files.
    - EXIF, XMP, IPTC read & write support.
    - Support of multiple images in one file and a PrimaryImage attribute.
    - Adding & removing thumbnails.
    - Reading of Depth Images.
    - Adding HEIF support to Pillow in one line of code as a plugin.
---
 graphics/Makefile                                  |  1 +
 graphics/py-pillow-heif/Makefile                   | 28 ++++++++++++++++++++++
 graphics/py-pillow-heif/distinfo                   |  3 +++
 graphics/py-pillow-heif/files/patch-pyproject.toml | 10 ++++++++
 graphics/py-pillow-heif/files/patch-setup.py       |  9 +++++++
 graphics/py-pillow-heif/pkg-descr                  | 10 ++++++++
 6 files changed, 61 insertions(+)

diff --git a/graphics/Makefile b/graphics/Makefile
index d4f82d7ba9e8..8b22d6ad2ad0 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -917,6 +917,7 @@
     SUBDIR += py-photocollage
     SUBDIR += py-piexif
     SUBDIR += py-pillow
+    SUBDIR += py-pillow-heif
     SUBDIR += py-pivy
     SUBDIR += py-plotly
     SUBDIR += py-png
diff --git a/graphics/py-pillow-heif/Makefile b/graphics/py-pillow-heif/Makefile
new file mode 100644
index 000000000000..52d788016ec1
--- /dev/null
+++ b/graphics/py-pillow-heif/Makefile
@@ -0,0 +1,28 @@
+PORTNAME=	pillow-heif
+PORTVERSION=	0.13.0
+CATEGORIES=	graphics python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+DISTNAME=	pillow_heif-${PORTVERSION}
+
+MAINTAINER=	sunpoet@FreeBSD.org
+COMMENT=	Python interface for libheif library
+WWW=		https://github.com/bigcat88/pillow_heif
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE.txt
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools>=61:devel/py-setuptools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
+LIB_DEPENDS=	libheif.so:graphics/libheif
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pillow>=9.1.1:graphics/py-pillow@${PY_FLAVOR}
+
+USES=		localbase python
+USE_PYTHON=	autoplist concurrent pep517
+
+LDFLAGS+=	-lheif
+
+post-install:
+	${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +
+
+.include <bsd.port.mk>
diff --git a/graphics/py-pillow-heif/distinfo b/graphics/py-pillow-heif/distinfo
new file mode 100644
index 000000000000..5f8031c6e241
--- /dev/null
+++ b/graphics/py-pillow-heif/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1696048422
+SHA256 (pillow_heif-0.13.0.tar.gz) = be337495d0be5accf4d6ea6614f61293c40c86dc8d3e5e6eb63661f90f472362
+SIZE (pillow_heif-0.13.0.tar.gz) = 14891825
diff --git a/graphics/py-pillow-heif/files/patch-pyproject.toml b/graphics/py-pillow-heif/files/patch-pyproject.toml
new file mode 100644
index 000000000000..732bb191a5f9
--- /dev/null
+++ b/graphics/py-pillow-heif/files/patch-pyproject.toml
@@ -0,0 +1,10 @@
+--- pyproject.toml.orig	2023-08-09 12:11:06 UTC
++++ pyproject.toml
+@@ -1,6 +1,6 @@
+ [build-system]
+ requires = [
+-  "setuptools>=67.8",
++  "setuptools>=61",
+   "wheel",
+ ]
+ 
diff --git a/graphics/py-pillow-heif/files/patch-setup.py b/graphics/py-pillow-heif/files/patch-setup.py
new file mode 100644
index 000000000000..bc5bfc34ffb2
--- /dev/null
+++ b/graphics/py-pillow-heif/files/patch-setup.py
@@ -0,0 +1,9 @@
+--- setup.py.orig	2023-08-09 12:11:06 UTC
++++ setup.py
+@@ -142,6 +142,5 @@ if getenv("READTHEDOCS", "False") == "True":
+ else:
+     setup(
+         version=get_version(),
+-        cmdclass={"build_ext": PillowHeifBuildExt},
+         ext_modules=[Extension("_pillow_heif", ["pillow_heif/_pillow_heif.c"])],
+     )
diff --git a/graphics/py-pillow-heif/pkg-descr b/graphics/py-pillow-heif/pkg-descr
new file mode 100644
index 000000000000..f1bc6fc8c111
--- /dev/null
+++ b/graphics/py-pillow-heif/pkg-descr
@@ -0,0 +1,10 @@
+Python bindings to libheif for working with HEIF images and plugin for Pillow.
+
+Features:
+- Decoding of 8, 10, 12 bit HEIC and AVIF files.
+- Encoding of 8, 10, 12 bit HEIC and AVIF files.
+- EXIF, XMP, IPTC read & write support.
+- Support of multiple images in one file and a PrimaryImage attribute.
+- Adding & removing thumbnails.
+- Reading of Depth Images.
+- Adding HEIF support to Pillow in one line of code as a plugin.