Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2025/01
easyblock = 'CMakePythonPackage'

name = 'pybind11_abseil'
version = '202402.0'

homepage = 'https://github.com/pybind/pybind11_abseil'
description = """Pybind11 bindings for the Abseil C++ Common Libraries"""

toolchain = {'name': 'GCC', 'version': '13.3.0'}

source_urls = [GITHUB_SOURCE]
sources = ['v%(version)s.tar.gz']
patches = [
# disable FetchContent for abseil-cpp and pybind11, use find_package for abseil-cpp and pybind11,
# install header, and create cmake package config:
'pybind11_abseil-202402.0_cmake.patch'
]
checksums = [
{'v202402.0.tar.gz': '1496b112e86416e2dcf288569a3e7b64f3537f0b18132224f492266e9ff76c44'},
{'pybind11_abseil-202402.0_cmake.patch': '06ac281d0bad44a72479dcaa6be51a5062d1503b35c849e1c825926da0823f2f'},
]

github_account = 'pybind'

builddependencies = [
('CMake', '3.29.3'),
('pybind11', '2.12.0'),
]

dependencies = [
('Python', '3.12.3'),
('Abseil', '20240722.0'),
]

_confopts = [
'-DCMAKE_INSTALL_PYDIR="%(installdir)s/lib/python%(pyshortver)s/site-packages"',
'-DPYTHON_EXECUTABLE=$EBROOTPYTHON/bin/python',
'-DFETCHCONTENT_FULLY_DISCONNECTED=ON',
]

configopts = ' '.join(_confopts)

sanity_check_paths = {
'files': [],
'dirs': ['lib/cmake/pybind11_abseil', 'include/pybind11_abseil'],
}

sanity_check_commands = [
"python -c 'from pybind11_abseil import status'"
]
moduleclass = 'lib'
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2025/01
# - disable FetchContent for abseil-cpp and pybind11
# - use find_package for abseil-cpp and pybind11
# - install header
# - create cmake package config
diff -ruN pybind11_abseil-202402.0/CMakeLists.txt pybind11_abseil-202402.0_cmake/CMakeLists.txt
--- pybind11_abseil-202402.0/CMakeLists.txt 2024-02-16 18:39:49.000000000 +0100
+++ pybind11_abseil-202402.0_cmake/CMakeLists.txt 2025-01-14 09:47:44.015942965 +0100
@@ -26,8 +26,13 @@
pybind11
URL https://github.com/pybind/pybind11/archive/refs/heads/master.tar.gz)

-FetchContent_MakeAvailable(abseil-cpp pybind11)
-
+#FetchContent_MakeAvailable(abseil-cpp pybind11)
+find_package(
+ Python3
+ COMPONENTS Interpreter Development
+ REQUIRED)
+find_package(absl CONFIG REQUIRED)
+find_package(pybind11 CONFIG REQUIRED)
set(TOP_LEVEL_DIR ${CMAKE_CURRENT_LIST_DIR})
include_directories(${TOP_LEVEL_DIR} ${pybind11_INCLUDE_DIRS})

diff -ruN pybind11_abseil-202402.0/pybind11_abseil/CMakeLists.txt pybind11_abseil-202402.0_cmake/pybind11_abseil/CMakeLists.txt
--- pybind11_abseil-202402.0/pybind11_abseil/CMakeLists.txt 2024-02-16 18:39:49.000000000 +0100
+++ pybind11_abseil-202402.0_cmake/pybind11_abseil/CMakeLists.txt 2025-01-14 10:22:00.018008505 +0100
@@ -21,6 +21,26 @@
absl::optional
absl::span)

+install(TARGETS absl_casters
+ EXPORT absl_casters-targets
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+set(Headers
+ absl_casters.h
+)
+install(FILES ${Headers} DESTINATION include/pybind11_abseil/)
+
+install(EXPORT absl_casters-targets
+ NAMESPACE pybind11_abseil::
+ DESTINATION lib/cmake/pybind11_abseil)
+include(CMakePackageConfigHelpers)
+configure_package_config_file(
+ "pybind11_abseilConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/pybind11_abseilConfig.cmake"
+ INSTALL_DESTINATION "lib/cmake/pybind11_abseil"
+)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pybind11_abseilConfig.cmake" DESTINATION "lib/cmake/pybind11_abseil")
+
# ok_status_singleton_lib ======================================================

add_library(ok_status_singleton_lib STATIC ok_status_singleton_lib.cc)
diff -ruN pybind11_abseil-202402.0/pybind11_abseil/pybind11_abseilConfig.cmake.in pybind11_abseil-202402.0_cmake/pybind11_abseil/pybind11_abseilConfig.cmake.in
--- pybind11_abseil-202402.0/pybind11_abseil/pybind11_abseilConfig.cmake.in 1970-01-01 01:00:00.000000000 +0100
+++ pybind11_abseil-202402.0_cmake/pybind11_abseil/pybind11_abseilConfig.cmake.in 2025-01-14 09:54:09.337489273 +0100
@@ -0,0 +1,3 @@
+@PACKAGE_INIT@
+
+include("${CMAKE_CURRENT_LIST_DIR}/absl_casters-targets.cmake")