Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jun 2026 06:44:04 +0000
From:      Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav <des@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 654a7a02bb47 - main - net/samba416: Fix build with newer Python
Message-ID:  <6a38d9b4.38654.6dc02b2@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by des:

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

commit 654a7a02bb473e1a9879da1ec010f77cf8945679
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-06-22 06:43:09 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-06-22 06:43:09 +0000

    net/samba416: Fix build with newer Python
    
    PyEval_CallObjectWithKeywords() has been deprecated since Python 3.9 and
    was removed in Python 3.13.  Add an upstream patch that replaces it with
    PyObject_Call() and bump the upper Python version limit to 3.14.
    
    Reviewed by:    kiwi
    Differential Revision:  https://reviews.freebsd.org/D57713
---
 net/samba416/Makefile                              |  6 +--
 net/samba416/files/patch-source4_param_provision.c | 48 ++++++++++++++++++++++
 2 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/net/samba416/Makefile b/net/samba416/Makefile
index 4db389e5ff8b..a3c17470560f 100644
--- a/net/samba416/Makefile
+++ b/net/samba416/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=			${SAMBA4_BASENAME}416
 PORTVERSION=			${SAMBA4_VERSION}
-PORTREVISION=			10
+PORTREVISION=			11
 CATEGORIES?=			net
 MASTER_SITES=			SAMBA/samba/stable SAMBA/samba/rc
 DISTNAME=			${SAMBA4_DISTNAME}
@@ -463,10 +463,10 @@ SAMBA4_MODULES+=		auth_skel pdb_test gpext_security gpext_registry \
 # Python bindings
 BUILD_DEPENDS+=			${PY_SETUPTOOLS}
 .if ! ${PORT_OPTIONS:MPYTHON3} || defined(NO_PYTHON)
-USES+=				python:build,test,3.11-3.12
+USES+=				python:build,test,3.11-3.14
 CONFIGURE_ARGS+=		--disable-python
 .else
-USES+=				python:3.11-3.12
+USES+=				python:3.11-3.14
 PLIST+=				${PKGDIR}/pkg-plist.python
 # Don't cache Python modules
 CONFIGURE_ARGS+=		--nopycache
diff --git a/net/samba416/files/patch-source4_param_provision.c b/net/samba416/files/patch-source4_param_provision.c
new file mode 100644
index 000000000000..d2cbc5c66b5f
--- /dev/null
+++ b/net/samba416/files/patch-source4_param_provision.c
@@ -0,0 +1,48 @@
+--- source4/param/provision.c.orig	2022-01-24 10:26:59 UTC
++++ source4/param/provision.c
+@@ -101,6 +101,18 @@ static PyObject *PyLdb_FromLdbContext(struct ldb_conte
+ 	return (PyObject *)ret;
+ }
+ 
++static PyObject *call_wrapper(PyObject *callable, PyObject *kwargs)
++{
++	/*
++	 * Helper for calls with zero non-keyword arguments.
++	 */
++	PyObject *empty = PyTuple_New(0), *result = NULL;
++	SMB_ASSERT(empty);
++	result = PyObject_Call(callable, empty, kwargs);
++	Py_XDECREF(empty);
++	return result;
++}
++
+ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
+ 			struct provision_settings *settings, 
+ 			struct provision_result *result)
+@@ -265,7 +277,7 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct lo
+ 		goto out;
+ 	}
+ 
+-	py_result = PyEval_CallObjectWithKeywords(provision_fn, NULL, parameters);
++	py_result = call_wrapper(provision_fn, parameters);
+ 
+ 	if (py_result == NULL) {
+ 		status = NT_STATUS_UNSUCCESSFUL;
+@@ -453,7 +465,7 @@ NTSTATUS provision_store_self_join(TALLOC_CTX *mem_ctx
+ 		goto out;
+ 	}
+ 
+-	py_result = PyEval_CallObjectWithKeywords(provision_fn, NULL, parameters);
++	py_result = call_wrapper(provision_fn, parameters);
+ 
+ 	if (py_result == NULL) {
+ 		ldb_transaction_cancel(ldb);
+@@ -538,7 +550,7 @@ struct ldb_context *provision_get_schema(TALLOC_CTX *m
+ 		}
+ 	}
+ 
+-	py_result = PyEval_CallObjectWithKeywords(schema_fn, NULL, parameters);
++	py_result = call_wrapper(schema_fn, parameters);
+ 
+ 	Py_DECREF(parameters);
+ 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a38d9b4.38654.6dc02b2>