summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-03-21 22:56:23 -0700
committerKhem Raj <raj.khem@gmail.com>2025-03-22 09:31:26 -0700
commit09b6a82dbf94eb39d9d47692318f4df49aacfbe3 (patch)
tree5c3fd96126afe6bcf9a9870163437dcbd401126a /meta-python/recipes-devtools/python
parentc71f8ef024b5f9743191e4f039176c1ddbd54ce6 (diff)
downloadmeta-openembedded-09b6a82dbf94eb39d9d47692318f4df49aacfbe3.tar.gz
python3-pybind11-json: Specify -DPYBIND11_USE_CROSSCOMPILING=ON to support pybind11 13.x
Add support for pkgconfig Use python-native during build to avoid host variability Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python')
-rw-r--r--meta-python/recipes-devtools/python/python3-pybind11-json/d72ad4df929bc9d0882298fc1f85ecf589456ff6.patch59
-rw-r--r--meta-python/recipes-devtools/python/python3-pybind11-json_0.2.15.bb6
2 files changed, 63 insertions, 2 deletions
diff --git a/meta-python/recipes-devtools/python/python3-pybind11-json/d72ad4df929bc9d0882298fc1f85ecf589456ff6.patch b/meta-python/recipes-devtools/python/python3-pybind11-json/d72ad4df929bc9d0882298fc1f85ecf589456ff6.patch
new file mode 100644
index 0000000000..c216ce66cb
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pybind11-json/d72ad4df929bc9d0882298fc1f85ecf589456ff6.patch
@@ -0,0 +1,59 @@
1From d72ad4df929bc9d0882298fc1f85ecf589456ff6 Mon Sep 17 00:00:00 2001
2From: Daniel Lundberg Pedersen <dlp@qtec.com>
3Date: Thu, 23 Jan 2025 11:48:16 +0100
4Subject: [PATCH] CMakeLists.txt: Add support for pkg-config
5
6Create and install pkg-config (.pc) file for dependency detection.
7Upstream-Status: Submitted [https://github.com/pybind/pybind11_json/pull/75]
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 CMakeLists.txt | 24 ++++++++++++++++++++++++
11 pybind11_json.pc.in | 7 +++++++
12 2 files changed, 31 insertions(+)
13 create mode 100644 pybind11_json.pc.in
14
15diff --git a/CMakeLists.txt b/CMakeLists.txt
16index c0ef675..a92240a 100644
17--- a/CMakeLists.txt
18+++ b/CMakeLists.txt
19@@ -133,3 +133,27 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}Config.cmake
20 install(EXPORT ${PROJECT_NAME}-targets
21 FILE ${PROJECT_NAME}Targets.cmake
22 DESTINATION ${PYBIND11_JSON_CMAKECONFIG_INSTALL_DIR})
23+
24+# pkg-config support
25+if(NOT prefix_for_pc_file)
26+if(IS_ABSOLUTE "${CMAKE_INSTALL_DATAROOTDIR}")
27+ set(prefix_for_pc_file "${CMAKE_INSTALL_PREFIX}")
28+else()
29+ set(pc_datarootdir "${CMAKE_INSTALL_DATAROOTDIR}")
30+ if(CMAKE_VERSION VERSION_LESS 3.20)
31+ set(prefix_for_pc_file "\${pcfiledir}/..")
32+ while(pc_datarootdir)
33+ get_filename_component(pc_datarootdir "${pc_datarootdir}" DIRECTORY)
34+ string(APPEND prefix_for_pc_file "/..")
35+ endwhile()
36+ else()
37+ cmake_path(RELATIVE_PATH CMAKE_INSTALL_PREFIX BASE_DIRECTORY CMAKE_INSTALL_DATAROOTDIR
38+ OUTPUT_VARIABLE prefix_for_pc_file)
39+ endif()
40+endif()
41+endif()
42+set(includedir_for_pc_file "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
43+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pybind11_json.pc.in"
44+ "${CMAKE_CURRENT_BINARY_DIR}/pybind11_json.pc" @ONLY)
45+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pybind11_json.pc"
46+ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig/")
47diff --git a/pybind11_json.pc.in b/pybind11_json.pc.in
48new file mode 100644
49index 0000000..da5bfde
50--- /dev/null
51+++ b/pybind11_json.pc.in
52@@ -0,0 +1,7 @@
53+prefix=@prefix_for_pc_file@
54+includedir=@includedir_for_pc_file@
55+
56+Name: @PROJECT_NAME@
57+Description: Using nlohmann::json with pybind11
58+Version: @PROJECT_VERSION@
59+Cflags: -I${includedir}
diff --git a/meta-python/recipes-devtools/python/python3-pybind11-json_0.2.15.bb b/meta-python/recipes-devtools/python/python3-pybind11-json_0.2.15.bb
index 3667ba872c..bb2ccae794 100644
--- a/meta-python/recipes-devtools/python/python3-pybind11-json_0.2.15.bb
+++ b/meta-python/recipes-devtools/python/python3-pybind11-json_0.2.15.bb
@@ -3,10 +3,12 @@ LICENSE = "BSD-3-Clause"
3LIC_FILES_CHKSUM = "file://LICENSE;md5=0e25ff0ec476d06d366439e1120cce98" 3LIC_FILES_CHKSUM = "file://LICENSE;md5=0e25ff0ec476d06d366439e1120cce98"
4 4
5SRCREV = "32043f433ed987b2c2ce99d689ec337bcbd4ba95" 5SRCREV = "32043f433ed987b2c2ce99d689ec337bcbd4ba95"
6SRC_URI = "git://github.com/pybind/pybind11_json;branch=master;protocol=https" 6SRC_URI = "git://github.com/pybind/pybind11_json;branch=master;protocol=https \
7 file://d72ad4df929bc9d0882298fc1f85ecf589456ff6.patch"
7 8
8DEPENDS += "nlohmann-json python3-pybind11" 9DEPENDS += "nlohmann-json python3-pybind11"
9 10
11EXTRA_OECMAKE += "-DPYBIND11_USE_CROSSCOMPILING=ON"
10S = "${WORKDIR}/git" 12S = "${WORKDIR}/git"
11 13
12inherit cmake 14inherit cmake python3native python3targetconfig