A pkg package generated with the CPack FreeBSD generator will fail to install when CPACK_FREEBSD_PACKAGE_DEPS is non empty. To reproduce, ensure that the FreeBSD CPack generator is enabled in the port options. Run the following CMakeLists.txt script: cmake_minimum_required(VERSION 3.24) project(cpack_test) set(CPACK_PACKAGE_VENDOR "nobody") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "cpack freebsd generator test") set(CPACK_FREEBSD_PACKAGE_MAINTAINER "nodbody@no.where") set(CPACK_FREEBSD_PACKAGE_LICENSE "BSD") set(CPACK_FREEBSD_PACKAGE_DEPS "devel/spdlog devel/gpds") # Error when installing the resulting package: pkg: elx has a missing dependency: devel/spdlog devel/gpds include(CPack) Then, run CPack with the FreeBSD generator. The package builds fine but fails to install with: pkg: cpack_test has a missing dependency: devel/spdlog devel/gpds If the CPACK_FREEBSD_PACKAGE_DEPS variable is empty, the package installs just fine. There's a good chance that this is PEBKAC but I'm out of ideas.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=efaecf6690c4abad127e55e59e55b6c8722b2796 commit efaecf6690c4abad127e55e59e55b6c8722b2796 Author: Adriaan de Groot <adridg@FreeBSD.org> AuthorDate: 2022-12-23 22:42:16 +0000 Commit: Adriaan de Groot <adridg@FreeBSD.org> CommitDate: 2023-01-08 21:32:17 +0000 devel/cmake*: update to 3.25.1 While here, remove a stale patch (upstreamed in CMake 3.10 or so) and repair the CPack FreeBSD pkg generator. Prepared by lbartoletti@ Exp-runs by antoine@ PR: 267872, 267894 Mk/Uses/cmake.mk | 2 +- devel/cmake-core/Makefile | 4 +- devel/cmake-core/distinfo | 6 +- devel/cmake-core/files/InitialCache.cmake | 2 +- .../files/patch-Modules_FindOpenMP.cmake | 14 ++--- ...patch-Modules_Platform_FreeBSD-CXX.cmake (gone) | 11 ---- ...-Source_CPack_cmCPackFreeBSDGenerator.cxx (new) | 22 +++++++ devel/cmake-core/pkg-plist | 69 ++++++++++++++++++++-- 8 files changed, 99 insertions(+), 31 deletions(-)
Since it's a list, the right syntax is ``` set(CPACK_FREEBSD_PACKAGE_DEPS "devel/spdlog" "devel/gpds") ``` where the quotes are optional, too -- unless there are really weird characters in a port / dependency name, you won't hit CMake string restrictions in this variable's value. There was *also* a bona-fide bug in the generator code, which I'm pretty sure I fixed here.