pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/py-pybind11



Module Name:    pkgsrc
Committed By:   tnn
Date:           Sun Mar 15 16:55:56 UTC 2026

Modified Files:
        pkgsrc/devel/py-pybind11: Makefile distinfo
Added Files:
        pkgsrc/devel/py-pybind11/patches:
            patch-include_pybind11_detail_holder__caster__foreign__helpers.h

Log Message:
pybind11: work around 3.0.1 to 3.0.2 regression

Add link to upstream PR.
This workaround seems to at least fix the test case from the PR and
makes gnuradio build. Should hopefully avoid having to revert
the upgrade to 3.0.2 while waiting for a proper fix from upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 pkgsrc/devel/py-pybind11/Makefile
cvs rdiff -u -r1.26 -r1.27 pkgsrc/devel/py-pybind11/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/devel/py-pybind11/patches/patch-include_pybind11_detail_holder__caster__foreign__helpers.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/py-pybind11/Makefile
diff -u pkgsrc/devel/py-pybind11/Makefile:1.30 pkgsrc/devel/py-pybind11/Makefile:1.31
--- pkgsrc/devel/py-pybind11/Makefile:1.30      Tue Feb 17 06:36:11 2026
+++ pkgsrc/devel/py-pybind11/Makefile   Sun Mar 15 16:55:55 2026
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.30 2026/02/17 06:36:11 adam Exp $
+# $NetBSD: Makefile,v 1.31 2026/03/15 16:55:55 tnn Exp $
 
 DISTNAME=      pybind11-3.0.2
+PKGREVISION=   1
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=    devel python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=p/pybind11/}
@@ -15,6 +16,9 @@ TOOL_DEPENDS+=        cmake>=3.15:../../devel/c
 
 USE_LANGUAGES= c c++
 
+pre-build:
+       ${RM} -f ${WRKSRC}/include/pybind11/detail/holder_caster_foreign_helpers.h.orig
+
 post-install:
        cd ${DESTDIR}${PREFIX}/bin && \
        ${MV} pybind11-config pybind11-config-${PYVERSSUFFIX} || ${TRUE}

Index: pkgsrc/devel/py-pybind11/distinfo
diff -u pkgsrc/devel/py-pybind11/distinfo:1.26 pkgsrc/devel/py-pybind11/distinfo:1.27
--- pkgsrc/devel/py-pybind11/distinfo:1.26      Tue Feb 17 06:36:11 2026
+++ pkgsrc/devel/py-pybind11/distinfo   Sun Mar 15 16:55:56 2026
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.26 2026/02/17 06:36:11 adam Exp $
+$NetBSD: distinfo,v 1.27 2026/03/15 16:55:56 tnn Exp $
 
 BLAKE2s (pybind11-3.0.2.tar.gz) = 91f3b8aa7c305299d3db1c1e496af473cd0b35962649742b8ed51e8ea0799625
 SHA512 (pybind11-3.0.2.tar.gz) = 45ca5adef8c56ee1b2dcd66f973e4d17f647ea9359a84777a1ef60ddce471a2e3d5d8b9e20e36b5e5e6f60eb21f43b5ae332ebfac62e242c1b02952e7572c7b7
 Size (pybind11-3.0.2.tar.gz) = 577131 bytes
+SHA1 (patch-include_pybind11_detail_holder__caster__foreign__helpers.h) = 247f489935bf3ef51129d4280c37dee97379da56

Added files:

Index: pkgsrc/devel/py-pybind11/patches/patch-include_pybind11_detail_holder__caster__foreign__helpers.h
diff -u /dev/null pkgsrc/devel/py-pybind11/patches/patch-include_pybind11_detail_holder__caster__foreign__helpers.h:1.1
--- /dev/null   Sun Mar 15 16:55:56 2026
+++ pkgsrc/devel/py-pybind11/patches/patch-include_pybind11_detail_holder__caster__foreign__helpers.h   Sun Mar 15 16:55:56 2026
@@ -0,0 +1,20 @@
+$NetBSD: patch-include_pybind11_detail_holder__caster__foreign__helpers.h,v 1.1 2026/03/15 16:55:56 tnn Exp $
+
+Try to work around https://github.com/pybind/pybind11/issues/5989
+which broke ham/gnuradio-digital and maybe others.
+
+--- include/pybind11/detail/holder_caster_foreign_helpers.h.orig       2026-03-15 11:32:29.275064052 +0000
++++ include/pybind11/detail/holder_caster_foreign_helpers.h
+@@ -37,7 +37,11 @@ struct holder_caster_foreign_helpers {
+         // object derives from enable_shared_from_this;
+         // try to reuse an existing shared_ptr if one is known
+         if (auto existing = try_get_shared_from_this(value)) {
+-            *holder_out = std::static_pointer_cast<type>(existing);
++            auto tmp = std::dynamic_pointer_cast<type>(existing);
++            if (!tmp) {
++                return false;
++            }
++            *holder_out = std::move(tmp);
+             return true;
+         }
+         return false;



Home | Main Index | Thread Index | Old Index