diff --git a/www/py-html5lib/Makefile b/www/py-html5lib/Makefile
index 510b856b2268..0c673849efaf 100644
--- a/www/py-html5lib/Makefile
+++ b/www/py-html5lib/Makefile
@@ -1,22 +1,28 @@
PORTNAME= html5lib
PORTVERSION= 1.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= www python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+PATCH_SITES= https://github.com/html5lib/html5lib-python/commit/
+PATCHFILES= b90dafff1bf342d34d539098013d0b9f318c7641.patch:-p1 \
+ 2ba10ae9c0852318aee4dfece8cd8b49bfe48682.patch:-p1
+
MAINTAINER= rm@FreeBSD.org
COMMENT= Python based HTML parser based on the HTML5 spec
WWW= https://github.com/html5lib/html5lib-python
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}webencodings>0:converters/py-webencodings@${PY_FLAVOR}
NO_ARCH= yes
USES= cpe python
-USE_PYTHON= autoplist distutils
+USE_PYTHON= autoplist pep517
.include
diff --git a/www/py-html5lib/distinfo b/www/py-html5lib/distinfo
index e49c5e6d5e3b..469e878ab50a 100644
--- a/www/py-html5lib/distinfo
+++ b/www/py-html5lib/distinfo
@@ -1,3 +1,7 @@
-TIMESTAMP = 1681809284
+TIMESTAMP = 1773329494
SHA256 (html5lib-1.1.tar.gz) = b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f
SIZE (html5lib-1.1.tar.gz) = 272215
+SHA256 (b90dafff1bf342d34d539098013d0b9f318c7641.patch) = 293065ee2c2592ff2536c43dc1aabb5e2f0753b0f986d26a3075d4650a1628b7
+SIZE (b90dafff1bf342d34d539098013d0b9f318c7641.patch) = 1465
+SHA256 (2ba10ae9c0852318aee4dfece8cd8b49bfe48682.patch) = 8c020776667b58f2306f16861ae3821c7172b564aeacc99fdfbbcf9170f9c9da
+SIZE (2ba10ae9c0852318aee4dfece8cd8b49bfe48682.patch) = 2238
diff --git a/www/py-html5lib/files/patch-setup.py b/www/py-html5lib/files/patch-setup.py
deleted file mode 100644
index 1dea77f968f7..000000000000
--- a/www/py-html5lib/files/patch-setup.py
+++ /dev/null
@@ -1,13 +0,0 @@
---- setup.py.orig 2020-06-22 23:23:02 UTC
-+++ setup.py
-@@ -90,8 +90,8 @@ with open(join(here, "html5lib", "__init__.py"), "rb")
- if (len(a.targets) == 1 and
- isinstance(a.targets[0], ast.Name) and
- a.targets[0].id == "__version__" and
-- isinstance(a.value, ast.Str)):
-- version = a.value.s
-+ isinstance(a.value, ast.Constant)):
-+ version = a.value
-
- setup(name='html5lib',
- version=version,