Bug 267748

Summary: devel/cmake-core: CMAKE_INSTALL_FULL_LOCALSTATEDIR points to /usr/local/var which is invalid on FreeBSD
Product: Ports & Packages Reporter: Yuri Victorovich <yuri>
Component: Individual Port(s)Assignee: freebsd-kde (group) <kde>
Status: Closed FIXED    
Severity: Affects Only Me CC: adridg, yuri
Priority: --- Flags: bugzilla: maintainer-feedback? (kde)
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://gitlab.kitware.com/cmake/cmake/-/issues/24159
Attachments:
Description Flags
Patch against GNUInstallDirs module none

Description Yuri Victorovich freebsd_committer freebsd_triage 2022-11-13 19:46:54 UTC
CMakeLists.txt:
> include(GNUInstallDirs)
> message("CMAKE_INSTALL_FULL_LOCALSTATEDIR=${CMAKE_INSTALL_FULL_LOCALSTATEDIR}")

prints:
> CMAKE_INSTALL_FULL_LOCALSTATEDIR=/usr/local/var

It should be /var because system doesn't have the /usr/local/var directory, and the ports framework prints this warning:
> Warning: port uses /usr/local/var instead of /var
Comment 1 Adriaan de Groot freebsd_committer freebsd_triage 2022-11-13 23:20:37 UTC
Meta-commentary placed in the CMake issue.

A handful of ports create `/usr/local/var` (security/krb5* and textproc/refdb) and should probably be fixed.
Comment 2 Adriaan de Groot freebsd_committer freebsd_triage 2022-11-13 23:21:32 UTC
Created attachment 238064 [details]
Patch against GNUInstallDirs module

This patch does "the trick" for me, but only with the most minimal of testing.
Comment 3 Adriaan de Groot freebsd_committer freebsd_triage 2023-03-27 21:47:18 UTC
Trying this one in the cmake 3.26.1 exp-run.
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-04-12 22:30:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2f35240f67b54feb5c212d35cae3b80d24bf52ff

commit 2f35240f67b54feb5c212d35cae3b80d24bf52ff
Author:     Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2023-03-16 21:21:10 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2023-04-12 22:27:28 +0000

    devel/cmake: update to 3.26.1, latest upstream

    See release notes at
            https://cmake.org/cmake/help/v3.26/release/3.26.html

    Some "while we're at it" changes:
    - remove obsolete patch, reported by: diizzy (PR 270337)
    - set LOCALSTATEDIR to /var (PR 267748)

    Thanks antoine@ for the exp-run.

    PR:             270491 270337 267748

 Mk/Uses/cmake.mk                                    |  2 +-
 devel/cmake-core/distinfo                           |  6 +++---
 .../files/patch-Modules_GNUInstallDirs.cmake (new)  | 15 +++++++++++++++
 .../files/patch-Utilities_cmcurl_lib_url.c (gone)   | 13 -------------
 devel/cmake-core/pkg-plist                          | 21 +++++++++++++++++++++
 devel/cmake-man/pkg-plist                           |  1 +
 devel/cmake-modules-webos/distinfo                  |  1 +
 7 files changed, 42 insertions(+), 17 deletions(-)