Tue Nov 21 17:37:53 2023 UTC ()
nlohmann-json: Optionize tests to greatly cut down on build times.


(nia)
diff -r1.1 -r1.2 pkgsrc/textproc/nlohmann-json/Makefile
diff -r1.1 -r1.2 pkgsrc/textproc/nlohmann-json/PLIST
diff -r0 -r1.1 pkgsrc/textproc/nlohmann-json/options.mk

cvs diff -r1.1 -r1.2 pkgsrc/textproc/nlohmann-json/Makefile (expand / switch to context diff)
--- pkgsrc/textproc/nlohmann-json/Makefile 2022/12/28 20:18:21 1.1
+++ pkgsrc/textproc/nlohmann-json/Makefile 2023/11/21 17:37:52 1.2
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2022/12/28 20:18:21 nikita Exp $
+# $NetBSD: Makefile,v 1.2 2023/11/21 17:37:52 nia Exp $
 
 DISTNAME=	nlohmann-json-3.11.2
 CATEGORIES=	textproc
@@ -11,11 +11,8 @@
 COMMENT=	JSON library for Modern C++
 LICENSE=	mit
 
-USE_CMAKE=	yes
 USE_LANGUAGES=	c c++11
-# FIXME: Downloads test data from a fixed tag in a git repository,
-# package https://github.com/nlohmann/json_test_data to prevent downloads.
-# FIXME: A small number of tests assume that WRKSRC is a git checkout.
-TEST_TARGET=	test
 
+.include "options.mk"
+.include "../../devel/cmake/build.mk"
 .include "../../mk/bsd.pkg.mk"

cvs diff -r1.1 -r1.2 pkgsrc/textproc/nlohmann-json/PLIST (expand / switch to context diff)
--- pkgsrc/textproc/nlohmann-json/PLIST 2022/12/28 20:18:21 1.1
+++ pkgsrc/textproc/nlohmann-json/PLIST 2023/11/21 17:37:52 1.2
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.1 2022/12/28 20:18:21 nikita Exp $
+@comment $NetBSD: PLIST,v 1.2 2023/11/21 17:37:52 nia Exp $
 include/nlohmann/adl_serializer.hpp
 include/nlohmann/byte_container_with_subtype.hpp
 include/nlohmann/detail/abi_macros.hpp
@@ -43,7 +43,7 @@
 include/nlohmann/ordered_map.hpp
 include/nlohmann/thirdparty/hedley/hedley.hpp
 include/nlohmann/thirdparty/hedley/hedley_undef.hpp
-include/test_data.hpp
+${PLIST.tests}include/test_data.hpp
 share/cmake/nlohmann_json/nlohmann_jsonConfig.cmake
 share/cmake/nlohmann_json/nlohmann_jsonConfigVersion.cmake
 share/cmake/nlohmann_json/nlohmann_jsonTargets.cmake

File Added: pkgsrc/textproc/nlohmann-json/options.mk
# $NetBSD: options.mk,v 1.1 2023/11/21 17:37:52 nia Exp $

PKG_OPTIONS_VAR=	PKG_OPTIONS.nlohmann-json

PKG_SUPPORTED_OPTIONS=	tests

.include "../../mk/bsd.options.mk"

PLIST_VARS+=	tests
.if !empty(PKG_OPTIONS:Mtests)
# FIXME: Downloads test data from a fixed tag in a git repository,
# package https://github.com/nlohmann/json_test_data to prevent downloads.
# FIXME: A small number of tests assume that WRKSRC is a git checkout.
PLIST.tests=	yes
TEST_TARGET=	test
CMAKE_ARGS+=	-DJSON_BuildTests=ON
.else
CMAKE_ARGS+=	-DJSON_BuildTests=OFF
.endif