From ad4719c10c6a401a30784c2bfc83345b1af60b31 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 30 May 2023 15:01:33 +0300 Subject: py: Move to mainline pybind11 version We are using pybind11 'smart_holder' branch to solve the Camera destructor issue (see the comment in this patch, or the commit that originally added Python bindings support). As it would be very nice to use the mainline pybind11 (which is packaged in distributions), this patch adds a workaround allowing us to move to the mainline pybind11 version. The workaround is simply creating a custom holder class (PyCameraSmartPtr), used only for the Camera, which wraps around the shared_ptr. This makes the compiler happy. Moving to mainline pybind11 is achieved with: - Change the pybind11 wrap to point to the mainline pybdind11 version - Tell pybind11 to always use shared_ptr<> as the holder for PyCameraManager, as we use the singleton pattern for the PyCameraManager, and using shared_ptr<> to manage it is a requirement - Tell pybind11 to always use PyCameraSmartPtr<> as the holder for Camera - Change the meson.build file to use a system-installed pybind11 Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- subprojects/.gitignore | 2 +- subprojects/pybind11.wrap | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 subprojects/pybind11.wrap (limited to 'subprojects') diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 0a8fd3a6..ebe59479 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -4,4 +4,4 @@ /libyaml /libyuv /packagecache -/pybind11 +/pybind11-* diff --git a/subprojects/pybind11.wrap b/subprojects/pybind11.wrap deleted file mode 100644 index dd02687b..00000000 --- a/subprojects/pybind11.wrap +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-License-Identifier: CC0-1.0 - -[wrap-git] -url = https://github.com/pybind/pybind11.git -# This is the head of 'smart_holder' branch -revision = aebdf00cd060b871c5a1e0c2cf4a333503dd0431 -depth = 1 -patch_directory = pybind11 - -[provide] -pybind11 = pybind11_dep -- cgit v1.2.1