git: 1ae49930c7f0 - main - devel/heaptrack: fix build on 14-

From: Adriaan de Groot <adridg_at_FreeBSD.org>
Date: Mon, 09 May 2022 11:13:23 UTC
The branch main has been updated by adridg:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1ae49930c7f079112577e62f7f4c0e0f9360a051

commit 1ae49930c7f079112577e62f7f4c0e0f9360a051
Author:     Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2022-05-09 10:41:16 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2022-05-09 11:13:21 +0000

    devel/heaptrack: fix build on 14-
    
    On 14-, libunwind doesn't install a corresponding <unwind.h>.
    It doesn't seem to be necessary, either: builds fine on
    13- and 14- without the extra check in heaptrack.
---
 devel/heaptrack/Makefile                              |  1 +
 devel/heaptrack/files/patch-cmake_FindLibunwind.cmake | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/devel/heaptrack/Makefile b/devel/heaptrack/Makefile
index 1cd10c4d50ea..a2a200db50a1 100644
--- a/devel/heaptrack/Makefile
+++ b/devel/heaptrack/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	heaptrack
 DISTVERSION=	1.3.0
+PORTREVISION=	1
 CATEGORIES=	devel kde
 MASTER_SITES=	KDE/stable/${PORTNAME}/${PORTVERSION}/
 
diff --git a/devel/heaptrack/files/patch-cmake_FindLibunwind.cmake b/devel/heaptrack/files/patch-cmake_FindLibunwind.cmake
new file mode 100644
index 000000000000..5141d7b6b37b
--- /dev/null
+++ b/devel/heaptrack/files/patch-cmake_FindLibunwind.cmake
@@ -0,0 +1,18 @@
+--- cmake/FindLibunwind.cmake.orig	2022-05-09 10:37:16 UTC
++++ cmake/FindLibunwind.cmake
+@@ -23,9 +23,15 @@
+ 
+ 
+ find_path(LIBUNWIND_INCLUDE_DIR libunwind.h )
++if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
++# FreeBSD 14 doesn't install an <unwind.h> header with
++# the libunwind port, and in any case it is not needed.
++message(STATUS "Assuming there is a corresponding unwind.h")
++else()
+ if(NOT EXISTS "${LIBUNWIND_INCLUDE_DIR}/unwind.h")
+   MESSAGE("Found libunwind.h but corresponding unwind.h is absent!")
+   SET(LIBUNWIND_INCLUDE_DIR "")
++endif()
+ endif()
+ 
+ find_library(LIBUNWIND_LIBRARY unwind)