git: 9bdadd2ec970 - main - security/cryptopp-modern: Add TOOLS option
Nuno Teixeira <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.cvs.ports |
|---|---|
| Message-ID | <[email protected]> |
The branch main has been updated by eduardo: URL: https://cgit.FreeBSD.org/ports/commit/?id=9bdadd2ec97025b8d949fe39df30d97b4046242e commit 9bdadd2ec97025b8d949fe39df30d97b4046242e Author: Nuno Teixeira <[email protected]> AuthorDate: 2026-08-17 10:06:39 +0000 Commit: Nuno Teixeira <[email protected]> CommitDate: 2026-08-17 11:21:57 +0000 security/cryptopp-modern: Add TOOLS option TOOLS option will install cryptest toguether with TestData and TestVectors, allowing the installed binary to run cryptest v and cryptest tv as post-install checks. PR: 297278 --- security/cryptopp-modern/Makefile | 12 ++ security/cryptopp-modern/files/patch-pull76 | 162 +++++++++++++++++++++++++++ security/cryptopp-modern/pkg-plist | 164 ++++++++++++++++++++++++++++ 3 files changed, 338 insertions(+) diff --git a/security/cryptopp-modern/Makefile b/security/cryptopp-modern/Makefile index 351c901ca0b5..32db1b52a342 100644 --- a/security/cryptopp-modern/Makefile +++ b/security/cryptopp-modern/Makefile @@ -1,5 +1,6 @@ PORTNAME= cryptopp-modern DISTVERSION= 2026.8.1 +PORTREVISION= 1 CATEGORIES= security MASTER_SITES= https://github.com/cryptopp-modern/${PORTNAME}/releases/download/${DISTVERSION}/ @@ -21,4 +22,15 @@ CONFLICTS_INSTALL= cryptopp PLIST_SUB= SOVERSION=${DISTVERSION} +OPTIONS_DEFINE= TOOLS +OPTIONS_DEFAULT= TOOLS +OPTIONS_SUB= yes + +TOOLS_DESC= Install encryption/decryption tools + +TOOLS_CMAKE_BOOL= CRYPTOPP_INSTALL_CRYPTEST + +post-install-TOOLS-on: + ${MV} ${STAGEDIR}${PREFIX}/bin/cryptest.exe ${STAGEDIR}${PREFIX}/bin/cryptest + .include <bsd.port.mk> diff --git a/security/cryptopp-modern/files/patch-pull76 b/security/cryptopp-modern/files/patch-pull76 new file mode 100644 index 000000000000..b2fa8ff67c4c --- /dev/null +++ b/security/cryptopp-modern/files/patch-pull76 @@ -0,0 +1,162 @@ +From ab7b7d29f68298ae17f412220b92054c6806695e Mon Sep 17 00:00:00 2001 +From: CoraleSoft <[email protected]> +Date: Sun, 16 Aug 2026 15:43:54 +1200 +Subject: [PATCH 1/2] Fix cryptest's compiled-in data path + +Load GNUInstallDirs before defining CRYPTOPP_DATA_DIR and use its full data-root path. This lets cryptest invoked through PATH find its installed data on FreeBSD when executable-relative lookup is unavailable. +--- + CMakeLists.txt | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git CMakeLists.txt CMakeLists.txt +index 8c37f6ae..2cffbb79 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -1495,6 +1495,9 @@ target_link_libraries( + # Tests + # ============================================================================ + ++# CRYPTOPP_DATA_DIR below depends on CMAKE_INSTALL_FULL_DATAROOTDIR. ++include(GNUInstallDirs) ++ + if(CRYPTOPP_BUILD_TESTING) + add_executable(cryptest ${cryptopp_SOURCES_TEST}) + target_link_libraries(cryptest PRIVATE cryptopp::cryptopp) +@@ -1534,7 +1537,7 @@ if(CRYPTOPP_BUILD_TESTING) + ${cryptopp_SOURCE_DIR}/src/test/validat9.cpp + APPEND PROPERTY + COMPILE_DEFINITIONS +- CRYPTOPP_DATA_DIR="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/cryptopp/" ++ CRYPTOPP_DATA_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/cryptopp/" + ) + + add_test( +@@ -1580,8 +1583,6 @@ endif() + # Deployment instructions + # ============================================================================== + +-include(GNUInstallDirs) +- + if(CRYPTOPP_INSTALL) + set(TARGETS_EXPORT_NAME "cryptopp-modern_Targets") + set(runtime "cryptopp-modern_runtime") + +From 835ac5f82b813dc5f3a9cb852afd188a1b15df60 Mon Sep 17 00:00:00 2001 +From: CoraleSoft <[email protected]> +Date: Sun, 16 Aug 2026 15:45:07 +1200 +Subject: [PATCH 2/2] Add a CRYPTOPP_INSTALL_CRYPTEST option + +Allow cryptest and its data to be installed without registering the CTest suite. The default follows CRYPTOPP_BUILD_TESTING, preserving the existing install contents for fresh configurations. + +Install cryptest and its data as part of the runtime component. +--- + .github/workflows/branch-build-and-test.yml | 26 +++++++++++++++++++++ + .github/workflows/build-and-test.yml | 26 +++++++++++++++++++++ + CMAKE.md | 9 ++++--- + CMakeLists.txt | 26 +++++++++++++++++---- + 4 files changed, 80 insertions(+), 7 deletions(-) + +diff --git CMAKE.md CMAKE.md +index d517165f..0a59c8af 100644 +--- CMAKE.md ++++ CMAKE.md +@@ -91,12 +91,15 @@ cmake --build --preset=debug + + | Option | Default | Description | + |--------|---------|-------------| +-| `CRYPTOPP_BUILD_TESTING` | `ON` | Build the test executable (cryptest.exe) | ++| `CRYPTOPP_BUILD_TESTING` | `ON` | Build the test executable (cryptest.exe) and register the CTest suite | + | `CRYPTOPP_INSTALL` | `ON` | Generate install targets | ++| `CRYPTOPP_INSTALL_CRYPTEST` | `CRYPTOPP_BUILD_TESTING` | Install cryptest.exe with its TestData and TestVectors. Set explicitly to install cryptest without the test suite, or to run the suite without installing cryptest | + | `CRYPTOPP_BUILD_SHARED` | `OFF` | Build a shared library (Unix-like platforms only; not supported on Windows) | + | `CRYPTOPP_USE_OPENMP` | `OFF` | Enable OpenMP for parallel algorithms | + | `CRYPTOPP_INCLUDE_PREFIX` | `cryptopp` | Header installation directory name | + ++`CRYPTOPP_INSTALL_CRYPTEST` takes its default from `CRYPTOPP_BUILD_TESTING` on the first configure of a build directory. Like all CMake options the value is then cached, so changing `CRYPTOPP_BUILD_TESTING` in an existing build directory does not re-derive it; set it explicitly or start from a fresh build directory. Installing cryptest also requires `CRYPTOPP_INSTALL` (which is `ON` by default). ++ + ### x86/x64 SIMD Options + + | Option | Default | Description | +@@ -227,8 +230,8 @@ cmake --install build + | `lib/` | Static library (`libcryptopp.a` or `cryptopp.lib`) | + | `lib/pkgconfig/` | pkg-config files (`libcryptopp.pc` and the `cryptopp-modern.pc` alias) | + | `lib/cmake/cryptopp-modern/` | CMake config files for `find_package()` | +-| `share/cryptopp/` | TestData and TestVectors | +-| `bin/` | Test executable (`cryptest.exe`) | ++| `share/cryptopp/` | TestData and TestVectors (with `CRYPTOPP_INSTALL_CRYPTEST`) | ++| `bin/` | Test executable (`cryptest.exe`, with `CRYPTOPP_INSTALL_CRYPTEST`) | + + ## SIMD Auto-Detection + +diff --git CMakeLists.txt CMakeLists.txt +index 2cffbb79..91a5b8a0 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -111,6 +111,12 @@ option(CRYPTOPP_DISABLE_POWER9 "Disable POWER9" OFF) + + option(CRYPTOPP_BUILD_TESTING "Build library tests" ON) + ++# Keep this after CRYPTOPP_BUILD_TESTING because its default follows that option. ++option(CRYPTOPP_INSTALL_CRYPTEST ++ "Install the cryptest tool and its test data" ++ "${CRYPTOPP_BUILD_TESTING}" ++) ++ + # Override the CRYPTOPP_INSTALL option to ON/OFF to respectively force + # install/no-install behavior for cryptopp module. + option(CRYPTOPP_INSTALL "Generate the install target for this project." ON) +@@ -1498,7 +1504,10 @@ target_link_libraries( + # CRYPTOPP_DATA_DIR below depends on CMAKE_INSTALL_FULL_DATAROOTDIR. + include(GNUInstallDirs) + +-if(CRYPTOPP_BUILD_TESTING) ++if( ++ CRYPTOPP_BUILD_TESTING ++ OR (CRYPTOPP_INSTALL AND CRYPTOPP_INSTALL_CRYPTEST) ++) + add_executable(cryptest ${cryptopp_SOURCES_TEST}) + target_link_libraries(cryptest PRIVATE cryptopp::cryptopp) + +@@ -1514,7 +1523,7 @@ if(CRYPTOPP_BUILD_TESTING) + ) + endif() + +- # Copy TestData and TestVectors to build directory so tests can run from there ++ # Keep build-tree cryptest runnable without relying on the source tree. + add_custom_command( + TARGET cryptest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory +@@ -1540,6 +1549,9 @@ if(CRYPTOPP_BUILD_TESTING) + CRYPTOPP_DATA_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/cryptopp/" + ) + ++endif() ++ ++if(CRYPTOPP_BUILD_TESTING) + add_test( + NAME cryptopp-modern-build_cryptest + COMMAND +@@ -1640,15 +1652,21 @@ if(CRYPTOPP_INSTALL) + ) + + # Tests +- if(CRYPTOPP_BUILD_TESTING) +- install(TARGETS cryptest DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ if(CRYPTOPP_INSTALL_CRYPTEST) ++ install( ++ TARGETS cryptest ++ DESTINATION ${CMAKE_INSTALL_BINDIR} ++ COMPONENT ${runtime} ++ ) + install( + DIRECTORY ${cryptopp_SOURCE_DIR}/TestData + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cryptopp ++ COMPONENT ${runtime} + ) + install( + DIRECTORY ${cryptopp_SOURCE_DIR}/TestVectors + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cryptopp ++ COMPONENT ${runtime} + ) + endif() + endif() diff --git a/security/cryptopp-modern/pkg-plist b/security/cryptopp-modern/pkg-plist index 8214e51777d7..f59d3abf39ed 100644 --- a/security/cryptopp-modern/pkg-plist +++ b/security/cryptopp-modern/pkg-plist @@ -1,3 +1,4 @@ +%%TOOLS%%bin/cryptest include/cryptopp/3way.h include/cryptopp/adler32.h include/cryptopp/adv_simd.h @@ -205,3 +206,166 @@ lib/libcryptopp.so.%%SOVERSION%% lib/libcryptopp.so.9 libdata/pkgconfig/cryptopp-modern.pc libdata/pkgconfig/libcryptopp.pc +%%TOOLS%%share/cryptopp/TestData/3desval.dat +%%TOOLS%%share/cryptopp/TestData/3wayval.dat +%%TOOLS%%share/cryptopp/TestData/aria.dat +%%TOOLS%%share/cryptopp/TestData/camellia.dat +%%TOOLS%%share/cryptopp/TestData/cast128v.dat +%%TOOLS%%share/cryptopp/TestData/cast256v.dat +%%TOOLS%%share/cryptopp/TestData/defdmac1.bin +%%TOOLS%%share/cryptopp/TestData/defdmac2.bin +%%TOOLS%%share/cryptopp/TestData/descert.dat +%%TOOLS%%share/cryptopp/TestData/dh1024.dat +%%TOOLS%%share/cryptopp/TestData/dh2048.dat +%%TOOLS%%share/cryptopp/TestData/dlie1024.dat +%%TOOLS%%share/cryptopp/TestData/dlie2048.dat +%%TOOLS%%share/cryptopp/TestData/dsa1024.dat +%%TOOLS%%share/cryptopp/TestData/dsa1024b.dat +%%TOOLS%%share/cryptopp/TestData/dsa512.dat +%%TOOLS%%share/cryptopp/TestData/ecies_p160.dat +%%TOOLS%%share/cryptopp/TestData/ecies_t163.dat +%%TOOLS%%share/cryptopp/TestData/ed25519.dat +%%TOOLS%%share/cryptopp/TestData/ed25519v0.dat +%%TOOLS%%share/cryptopp/TestData/ed25519v1.dat +%%TOOLS%%share/cryptopp/TestData/elgc1024.dat +%%TOOLS%%share/cryptopp/TestData/esig1023.dat +%%TOOLS%%share/cryptopp/TestData/esig1536.dat +%%TOOLS%%share/cryptopp/TestData/esig2046.dat +%%TOOLS%%share/cryptopp/TestData/fhmqv160.dat +%%TOOLS%%share/cryptopp/TestData/fhmqv256.dat +%%TOOLS%%share/cryptopp/TestData/fhmqv384.dat +%%TOOLS%%share/cryptopp/TestData/fhmqv512.dat +%%TOOLS%%share/cryptopp/TestData/gostval.dat +%%TOOLS%%share/cryptopp/TestData/hmqv160.dat +%%TOOLS%%share/cryptopp/TestData/hmqv256.dat +%%TOOLS%%share/cryptopp/TestData/hmqv384.dat +%%TOOLS%%share/cryptopp/TestData/hmqv512.dat +%%TOOLS%%share/cryptopp/TestData/ideaval.dat +%%TOOLS%%share/cryptopp/TestData/luc1024.dat +%%TOOLS%%share/cryptopp/TestData/luc2048.dat +%%TOOLS%%share/cryptopp/TestData/lucc1024.dat +%%TOOLS%%share/cryptopp/TestData/lucc512.dat +%%TOOLS%%share/cryptopp/TestData/lucd1024.dat +%%TOOLS%%share/cryptopp/TestData/lucd512.dat +%%TOOLS%%share/cryptopp/TestData/lucs1024.dat +%%TOOLS%%share/cryptopp/TestData/lucs512.dat +%%TOOLS%%share/cryptopp/TestData/marsval.dat +%%TOOLS%%share/cryptopp/TestData/mqv1024.dat +%%TOOLS%%share/cryptopp/TestData/mqv2048.dat +%%TOOLS%%share/cryptopp/TestData/nr1024.dat +%%TOOLS%%share/cryptopp/TestData/nr2048.dat +%%TOOLS%%share/cryptopp/TestData/rabi1024.dat +%%TOOLS%%share/cryptopp/TestData/rabi2048.dat +%%TOOLS%%share/cryptopp/TestData/rc2val.dat +%%TOOLS%%share/cryptopp/TestData/rc5val.dat +%%TOOLS%%share/cryptopp/TestData/rc6val.dat +%%TOOLS%%share/cryptopp/TestData/rijndael.dat +%%TOOLS%%share/cryptopp/TestData/rsa1024.dat +%%TOOLS%%share/cryptopp/TestData/rsa2048.dat +%%TOOLS%%share/cryptopp/TestData/rsa2048a.dat +%%TOOLS%%share/cryptopp/TestData/rsa400pb.dat +%%TOOLS%%share/cryptopp/TestData/rsa400pv.dat +%%TOOLS%%share/cryptopp/TestData/rsa512a.dat +%%TOOLS%%share/cryptopp/TestData/rw1024.dat +%%TOOLS%%share/cryptopp/TestData/rw2048.dat +%%TOOLS%%share/cryptopp/TestData/saferval.dat +%%TOOLS%%share/cryptopp/TestData/serpentv.dat +%%TOOLS%%share/cryptopp/TestData/shacal2v.dat +%%TOOLS%%share/cryptopp/TestData/sharkval.dat +%%TOOLS%%share/cryptopp/TestData/skipjack.dat +%%TOOLS%%share/cryptopp/TestData/squareva.dat +%%TOOLS%%share/cryptopp/TestData/twofishv.dat +%%TOOLS%%share/cryptopp/TestData/usage.dat +%%TOOLS%%share/cryptopp/TestData/x25519.dat +%%TOOLS%%share/cryptopp/TestData/x25519v0.dat +%%TOOLS%%share/cryptopp/TestData/x25519v1.dat +%%TOOLS%%share/cryptopp/TestData/xtrdh171.dat +%%TOOLS%%share/cryptopp/TestData/xtrdh342.dat +%%TOOLS%%share/cryptopp/TestVectors/Readme.txt +%%TOOLS%%share/cryptopp/TestVectors/aead.txt +%%TOOLS%%share/cryptopp/TestVectors/aes.txt +%%TOOLS%%share/cryptopp/TestVectors/all.txt +%%TOOLS%%share/cryptopp/TestVectors/argon2.txt +%%TOOLS%%share/cryptopp/TestVectors/aria.txt +%%TOOLS%%share/cryptopp/TestVectors/blake2.txt +%%TOOLS%%share/cryptopp/TestVectors/blake2b.txt +%%TOOLS%%share/cryptopp/TestVectors/blake2s.txt +%%TOOLS%%share/cryptopp/TestVectors/blake3.txt +%%TOOLS%%share/cryptopp/TestVectors/camellia.txt +%%TOOLS%%share/cryptopp/TestVectors/ccm.txt +%%TOOLS%%share/cryptopp/TestVectors/chacha.txt +%%TOOLS%%share/cryptopp/TestVectors/chacha20poly1305.txt +%%TOOLS%%share/cryptopp/TestVectors/chacha_tls.txt +%%TOOLS%%share/cryptopp/TestVectors/cham.txt +%%TOOLS%%share/cryptopp/TestVectors/cmac.txt +%%TOOLS%%share/cryptopp/TestVectors/dlies.txt +%%TOOLS%%share/cryptopp/TestVectors/dsa.txt +%%TOOLS%%share/cryptopp/TestVectors/dsa_1363.txt +%%TOOLS%%share/cryptopp/TestVectors/dsa_rfc6979.txt +%%TOOLS%%share/cryptopp/TestVectors/eax.txt +%%TOOLS%%share/cryptopp/TestVectors/esign.txt +%%TOOLS%%share/cryptopp/TestVectors/gcm.txt +%%TOOLS%%share/cryptopp/TestVectors/hc128.txt +%%TOOLS%%share/cryptopp/TestVectors/hc256.txt +%%TOOLS%%share/cryptopp/TestVectors/hight.txt +%%TOOLS%%share/cryptopp/TestVectors/hkdf.txt +%%TOOLS%%share/cryptopp/TestVectors/hmac.txt +%%TOOLS%%share/cryptopp/TestVectors/kalyna.txt +%%TOOLS%%share/cryptopp/TestVectors/keccak.txt +%%TOOLS%%share/cryptopp/TestVectors/lea.txt +%%TOOLS%%share/cryptopp/TestVectors/lsh.txt +%%TOOLS%%share/cryptopp/TestVectors/lsh256.txt +%%TOOLS%%share/cryptopp/TestVectors/lsh512.txt +%%TOOLS%%share/cryptopp/TestVectors/lsh512_256.txt +%%TOOLS%%share/cryptopp/TestVectors/mars.txt +%%TOOLS%%share/cryptopp/TestVectors/mldsa.txt +%%TOOLS%%share/cryptopp/TestVectors/mlkem.txt +%%TOOLS%%share/cryptopp/TestVectors/nr.txt +%%TOOLS%%share/cryptopp/TestVectors/ocb.txt +%%TOOLS%%share/cryptopp/TestVectors/panama.txt +%%TOOLS%%share/cryptopp/TestVectors/poly1305_tls.txt +%%TOOLS%%share/cryptopp/TestVectors/poly1305aes.txt +%%TOOLS%%share/cryptopp/TestVectors/rabbit.txt +%%TOOLS%%share/cryptopp/TestVectors/rsa_oaep.txt +%%TOOLS%%share/cryptopp/TestVectors/rsa_pkcs1_1_5.txt +%%TOOLS%%share/cryptopp/TestVectors/rsa_pss.txt +%%TOOLS%%share/cryptopp/TestVectors/rw.txt +%%TOOLS%%share/cryptopp/TestVectors/salsa.txt +%%TOOLS%%share/cryptopp/TestVectors/seal.txt +%%TOOLS%%share/cryptopp/TestVectors/seed.txt +%%TOOLS%%share/cryptopp/TestVectors/sha.txt +%%TOOLS%%share/cryptopp/TestVectors/sha1_160_fips_180.txt +%%TOOLS%%share/cryptopp/TestVectors/sha1_fips_180.txt +%%TOOLS%%share/cryptopp/TestVectors/sha2.txt +%%TOOLS%%share/cryptopp/TestVectors/sha2_224_fips_180.txt +%%TOOLS%%share/cryptopp/TestVectors/sha2_256_fips_180.txt +%%TOOLS%%share/cryptopp/TestVectors/sha2_384_fips_180.txt +%%TOOLS%%share/cryptopp/TestVectors/sha2_512_fips_180.txt +%%TOOLS%%share/cryptopp/TestVectors/sha2_fips_180.txt +%%TOOLS%%share/cryptopp/TestVectors/sha3.txt +%%TOOLS%%share/cryptopp/TestVectors/sha3_224_fips_202.txt +%%TOOLS%%share/cryptopp/TestVectors/sha3_256_fips_202.txt +%%TOOLS%%share/cryptopp/TestVectors/sha3_384_fips_202.txt +%%TOOLS%%share/cryptopp/TestVectors/sha3_512_fips_202.txt +%%TOOLS%%share/cryptopp/TestVectors/sha3_fips_202.txt +%%TOOLS%%share/cryptopp/TestVectors/shacal2.txt +%%TOOLS%%share/cryptopp/TestVectors/shake.txt +%%TOOLS%%share/cryptopp/TestVectors/simeck.txt +%%TOOLS%%share/cryptopp/TestVectors/simon.txt +%%TOOLS%%share/cryptopp/TestVectors/siphash.txt +%%TOOLS%%share/cryptopp/TestVectors/skipjack.txt +%%TOOLS%%share/cryptopp/TestVectors/slhdsa.txt +%%TOOLS%%share/cryptopp/TestVectors/sm3.txt +%%TOOLS%%share/cryptopp/TestVectors/sm4.txt +%%TOOLS%%share/cryptopp/TestVectors/sosemanuk.txt +%%TOOLS%%share/cryptopp/TestVectors/speck.txt +%%TOOLS%%share/cryptopp/TestVectors/tea.txt +%%TOOLS%%share/cryptopp/TestVectors/threefish.txt +%%TOOLS%%share/cryptopp/TestVectors/ttmac.txt +%%TOOLS%%share/cryptopp/TestVectors/vmac.txt +%%TOOLS%%share/cryptopp/TestVectors/wake.txt +%%TOOLS%%share/cryptopp/TestVectors/whrlpool.txt +%%TOOLS%%share/cryptopp/TestVectors/xaes_256_gcm.txt +%%TOOLS%%share/cryptopp/TestVectors/xchacha.txt +%%TOOLS%%share/cryptopp/TestVectors/xts.txt +%%TOOLS%%share/cryptopp/TestVectors/xwing.txt