git: db42cb71f2a4 - main - devel/py-standard-imghdr: new port, backport of stdlib imghdr module

From: Xin LI <delphij_at_FreeBSD.org>
Date: Sat, 11 Apr 2026 03:07:00 UTC
The branch main has been updated by delphij:

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

commit db42cb71f2a4f4bd6dba031a11b6bf843158f223
Author:     Xin LI <delphij@FreeBSD.org>
AuthorDate: 2026-04-11 02:33:48 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2026-04-11 03:03:49 +0000

    devel/py-standard-imghdr: new port, backport of stdlib imghdr module
    
    Provides the imghdr module removed from the Python standard library
    in Python 3.13, for packages that depend on it.
    
    WWW: https://github.com/youknowone/python-deadlib
    
    Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
 devel/Makefile                                     |  1 +
 devel/py-standard-imghdr/Makefile                  | 23 ++++++++++++++++++++++
 devel/py-standard-imghdr/distinfo                  |  3 +++
 .../py-standard-imghdr/files/patch-pyproject.toml  |  9 +++++++++
 devel/py-standard-imghdr/pkg-descr                 |  3 +++
 5 files changed, 39 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 5cbe2757e67b..eac31dfd23d8 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -6091,6 +6091,7 @@
     SUBDIR += py-stack-data
     SUBDIR += py-statgrab
     SUBDIR += py-statsd
+    SUBDIR += py-standard-imghdr
     SUBDIR += py-stdlib-list
     SUBDIR += py-stdlibs
     SUBDIR += py-stdnum
diff --git a/devel/py-standard-imghdr/Makefile b/devel/py-standard-imghdr/Makefile
new file mode 100644
index 000000000000..843be20f2fbe
--- /dev/null
+++ b/devel/py-standard-imghdr/Makefile
@@ -0,0 +1,23 @@
+PORTNAME=	standard-imghdr
+PORTVERSION=	3.13.0
+CATEGORIES=	devel python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+DISTNAME=	standard_imghdr-${PORTVERSION}
+
+MAINTAINER=	python@FreeBSD.org
+COMMENT=	Backport of the standard library imghdr module
+WWW=		https://github.com/youknowone/python-deadlib
+
+LICENSE=	PSFL
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
+
+USES=		python:3.13+
+USE_PYTHON=	autoplist concurrent pep517
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/devel/py-standard-imghdr/distinfo b/devel/py-standard-imghdr/distinfo
new file mode 100644
index 000000000000..0dcb879bbc4f
--- /dev/null
+++ b/devel/py-standard-imghdr/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1775864214
+SHA256 (standard_imghdr-3.13.0.tar.gz) = 8d9c68058d882f6fc3542a8d39ef9ff94d2187dc90bd0c851e0902776b7b7a42
+SIZE (standard_imghdr-3.13.0.tar.gz) = 5511
diff --git a/devel/py-standard-imghdr/files/patch-pyproject.toml b/devel/py-standard-imghdr/files/patch-pyproject.toml
new file mode 100644
index 000000000000..01d1696f3e5a
--- /dev/null
+++ b/devel/py-standard-imghdr/files/patch-pyproject.toml
@@ -0,0 +1,9 @@
+--- pyproject.toml.orig	2024-01-01 00:00:00 UTC
++++ pyproject.toml
+@@ -21,5 +21,5 @@
+ "Homepage" = "https://github.com/youknowone/python-deadlib"
+
+ [build-system]
+-requires = ["setuptools>=75.0"]
++requires = ["setuptools>=43.0.0"]
+ build-backend = "setuptools.build_meta"
diff --git a/devel/py-standard-imghdr/pkg-descr b/devel/py-standard-imghdr/pkg-descr
new file mode 100644
index 000000000000..1e8d256d63d6
--- /dev/null
+++ b/devel/py-standard-imghdr/pkg-descr
@@ -0,0 +1,3 @@
+Backport of the standard library imghdr module for Python 3.13+, where
+it was removed ("dead battery").  Provides imghdr.what() and imghdr.tests
+for packages that depend on the module.