aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2024-09-05 05:24:53 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2024-09-05 06:17:45 +0000
commitba4f0c871a3d0b885b1995ffd2f565fb4e9acc01 (patch)
tree3f68d576836856aac9b919a63d2ae3a3f6254386
parentfffd9fe9c8159cbb2641a5f50ce1a8257dd5ded5 (diff)
devel/pybind11_protobuf: Add make test
-rw-r--r--devel/pybind11_protobuf/Makefile4
-rw-r--r--devel/pybind11_protobuf/files/patch-pybind11_protobuf-tests-CMakeLists.txt14
2 files changed, 17 insertions, 1 deletions
diff --git a/devel/pybind11_protobuf/Makefile b/devel/pybind11_protobuf/Makefile
index 88cd22cc3eb7..ffb3f5236fde 100644
--- a/devel/pybind11_protobuf/Makefile
+++ b/devel/pybind11_protobuf/Makefile
@@ -13,8 +13,9 @@ BUILD_DEPENDS= abseil>=20230125:devel/abseil \
pybind11>=2.11.1:devel/pybind11
LIB_DEPENDS= libabsl_base.so:devel/abseil \
libprotobuf.so:devel/protobuf
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}absl-py>=0:devel/py-absl-py@${PY_FLAVOR}
-USES= cmake compiler:c++17-lang python
+USES= cmake:testing compiler:c++17-lang localbase python
CFLAGS+= -I${WRKSRC}
CMAKE_ARGS= -DCMAKE_INSTALL_PYDIR=${PYTHON_SITELIBDIR}
@@ -22,6 +23,7 @@ CMAKE_OFF= BUILD_TESTING
CMAKE_ON= USE_SYSTEM_ABSEIL \
USE_SYSTEM_PROTOBUF \
USE_SYSTEM_PYBIND
+CMAKE_TESTING_ON= BUILD_TESTING
USE_GITHUB= yes
GH_ACCOUNT= pybind
diff --git a/devel/pybind11_protobuf/files/patch-pybind11_protobuf-tests-CMakeLists.txt b/devel/pybind11_protobuf/files/patch-pybind11_protobuf-tests-CMakeLists.txt
new file mode 100644
index 000000000000..97096ac5e577
--- /dev/null
+++ b/devel/pybind11_protobuf/files/patch-pybind11_protobuf-tests-CMakeLists.txt
@@ -0,0 +1,14 @@
+--- pybind11_protobuf/tests/CMakeLists.txt.orig 2024-08-09 17:15:35 UTC
++++ pybind11_protobuf/tests/CMakeLists.txt
+@@ -2,10 +2,9 @@
+ # Evaluate if Protobuf uses the system package, otherwise explicitly include the
+ # required macro
+ #
+-FetchContent_GetProperties(Protobuf SOURCE_DIR Protobuf_SOURCE_DIR)
+ if(Protobuf_SOURCE_DIR)
+ # Use macros from content made available by FetchContent
+- include(${Protobuf_SOURCE_DIR}/cmake/protobuf-generate.cmake)
++ include(${Protobuf_SOURCE_DIR}/lib/cmake/protobuf/protobuf-generate.cmake)
+ endif()
+
+ # cmake-format: off