git: a8ff01e6965a - main - sysutils/py-ansible-core221: Add new port
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 20 May 2026 14:12:21 UTC
The branch main has been updated by cy:
URL: https://cgit.FreeBSD.org/ports/commit/?id=a8ff01e6965a045baf330e4f0ae0c08a389545e1
commit a8ff01e6965a045baf330e4f0ae0c08a389545e1
Author: Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2026-05-20 12:47:26 +0000
Commit: Cy Schubert <cy@FreeBSD.org>
CommitDate: 2026-05-20 14:12:15 +0000
sysutils/py-ansible-core221: Add new port
As with sysutils/py-ansible-core220, python 3.12 is required.
---
sysutils/Makefile | 1 +
sysutils/py-ansible-core221/Makefile | 97 ++++++++++++++++++++++
sysutils/py-ansible-core221/distinfo | 3 +
.../py-ansible-core221/files/patch-pyproject.toml | 21 +++++
sysutils/py-ansible-core221/pkg-descr | 5 ++
5 files changed, 127 insertions(+)
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 80d395aa2603..cb3a857c8e0d 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -1044,6 +1044,7 @@
SUBDIR += py-ansible-core218
SUBDIR += py-ansible-core219
SUBDIR += py-ansible-core220
+ SUBDIR += py-ansible-core221
SUBDIR += py-ansible-lint
SUBDIR += py-ansible-runner
SUBDIR += py-appjail-gui
diff --git a/sysutils/py-ansible-core221/Makefile b/sysutils/py-ansible-core221/Makefile
new file mode 100644
index 000000000000..88dd61af67fe
--- /dev/null
+++ b/sysutils/py-ansible-core221/Makefile
@@ -0,0 +1,97 @@
+# XXX Note to users:
+# XXX To build this port one must add DEFAULT_VERSIONS+=python=3.12
+# XXX to /etc/make.conf and rebuild all one's python ports. Use this
+# XXX workaround until Python 3.12 becomes the default.
+
+PORTNAME= ansible-core
+DISTVERSION= 2.21.0
+CATEGORIES= sysutils python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+DISTFILES= ${PORTNAME:R:S/-/_/}-${DISTVERSION}${EXTRACT_SUFX}
+.if !defined(MASTERDIR)
+PKGNAMESUFFIX= 221
+.endif
+
+MAINTAINER= cy@FreeBSD.org
+COMMENT= Radically simple IT automation
+WWW= https://www.ansible.com/
+
+CONFLICTS_INSTALL= py*-ansible-core-* py*-ansible-core219-* py*-ansible-core220-*
+
+WRKSRC= ${WRKDIR}/${PORTNAME:R:S/-/_/}-${DISTVERSION}
+
+LICENSE= GPLv3+
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+BUILD_DEPENDS= ${PY_SETUPTOOLS} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Jinja2>=3.0.0:devel/py-Jinja2@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}packaging>=0:devel/py-packaging@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}resolvelib>=0.5.3<1.1.0:devel/py-resolvelib@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}toml>0:textproc/py-toml@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}passlib>0:security/py-passlib@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pyyaml>=5.1:devel/py-pyyaml@${PY_FLAVOR}
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}bcrypt>=0:security/py-bcrypt@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}boto3>0:www/py-boto3@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}mock>0:devel/py-mock@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}nose>0:devel/py-nose@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}passlib>0:security/py-passlib@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pycryptodome>=0:security/py-pycryptodome@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pytest-mock>0:devel/py-pytest-mock@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pytest-xdist>0:devel/py-pytest-xdist@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \
+ git:devel/git
+
+USES= ansible:env cpe python shebangfix
+CPE_VENDOR= redhat
+CPE_PRODUCT= ansible
+USE_PYTHON= autoplist concurrent cryptography pep517
+
+SHEBANG_REGEX= [.]/test/.*[.]py
+
+# Pass MAKE_ENV to TEST_ENV so that binary aliases via an updated PATH.
+TEST_ENV= ${MAKE_ENV}
+
+# The "python" binary alias is needed for the tests.
+BINARY_ALIAS= python=${PYTHON_CMD}
+NO_ARCH= yes
+
+post-patch:
+# Preserve the original paths in
+# test/units/cli/galaxy/test_execute_list_collection.py.
+# Replacing /usr/share/ansible breaks tests.
+ ${FIND} ${WRKSRC} -not -regex '${WRKSRC}/test/units/cli/galaxy/test_execute_list_collection.py' -type f -print0 | \
+ ${XARGS} -0 ${REINPLACE_CMD} \
+ -e 's|/etc/ansible|${ETCDIR}|g' \
+ -e 's|/usr/share/ansible|${DATADIR}|g'
+ ${FIND} ${WRKSRC} -type f -name "*.bak" -delete
+
+post-stage:
+ ${FIND} ${STAGEDIR}${PREFIX}/bin -type l -name ansible-\* -lname ansible \
+ -execdir ${RLN} ansible-${PYTHON_VER} {} \;
+# USE_PYTHON=autoplist doesn't add this file to pkg-plist.
+ ${RM} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/ansible_test/_data/injector/ansible-inventory
+
+pre-test:
+# This one file does not get its paths replaced correctly in post-patch.
+ ${REINPLACE_CMD} 's|"/etc"|"${ETCDIR:H}"|g' \
+ ${WRKSRC}/test/units/playbook/test_helpers.py
+# This test constructs a Python script inline and uses an invalid path to it.
+ ${REINPLACE_CMD} 's|/usr/bin/python|${PYTHON_CMD}|' \
+ ${WRKSRC}/test/units/modules/test_async_wrapper.py
+# Skip the SELinux tests, it's not present on FreeBSD.
+ ${RM} ${WRKSRC}/test/units/module_utils/basic/test_selinux.py
+# Disable some failing tests. They fail to detect that emoji are of width 2 istead of 1.
+ ${RM} ${WRKSRC}/test/units/utils/test_display.py
+
+do-test:
+ @cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ./bin/ansible-test units -v --python ${PYTHON_VER}
+
+.include <bsd.port.mk>
+
+# Make sure that we override the unique DATADIR and ETCDIR set
+# by the implicit USES=uniquefiles.
+DATADIR= ${ANSIBLE_DATADIR}
+ETCDIR= ${ANSIBLE_ETCDIR}
diff --git a/sysutils/py-ansible-core221/distinfo b/sysutils/py-ansible-core221/distinfo
new file mode 100644
index 000000000000..3ffdd47f5680
--- /dev/null
+++ b/sysutils/py-ansible-core221/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1779220506
+SHA256 (ansible_core-2.21.0.tar.gz) = 28ccd0e2d1849f1c7272cec39a74a8a5c83f3d51314658fa5ca57ea85a87f454
+SIZE (ansible_core-2.21.0.tar.gz) = 3387206
diff --git a/sysutils/py-ansible-core221/files/patch-pyproject.toml b/sysutils/py-ansible-core221/files/patch-pyproject.toml
new file mode 100644
index 000000000000..2dfe2b9da74c
--- /dev/null
+++ b/sysutils/py-ansible-core221/files/patch-pyproject.toml
@@ -0,0 +1,21 @@
+--- pyproject.toml.orig 2026-05-19 14:23:57.112598000 -0700
++++ pyproject.toml 2026-05-19 14:25:15.952696000 -0700
+@@ -1,5 +1,5 @@
+ [build-system]
+-requires = ["setuptools >= 77.0.3, <= 82.0.1"] # lower bound to support license/license-files (PEP 639), upper bound for latest version tested at release
++requires = ["setuptools >= 63.1.0, <= 82.0.1"] # lower bound to support license/license-files (PEP 639), upper bound for latest version tested at release
+ build-backend = "setuptools.build_meta"
+
+ [project]
+@@ -10,11 +10,6 @@
+ ]
+ description = "Radically simple IT automation"
+ readme = "README.md"
+-license = "GPL-3.0-or-later"
+-license-files = [
+- "COPYING",
+- "licenses/*.txt",
+-]
+ classifiers = [
+ "Development Status :: 5 - Production/Stable",
+ "Environment :: Console",
diff --git a/sysutils/py-ansible-core221/pkg-descr b/sysutils/py-ansible-core221/pkg-descr
new file mode 100644
index 000000000000..12dcf10983b9
--- /dev/null
+++ b/sysutils/py-ansible-core221/pkg-descr
@@ -0,0 +1,5 @@
+Ansible is a radically simple configuration-management, deployment,
+task-execution, and multinode orchestration framework.
+
+ansible-core contains the core engine, modules and plugins. It does not contain
+community and partner supported Ansible Collections of modules and plugins.