git: e02b2ca451b0 - main - textproc/libxml2: Fix cmake file

From: Zsolt Udvari <uzsolt_at_FreeBSD.org>
Date: Thu, 10 Jul 2025 11:08:47 UTC
The branch main has been updated by uzsolt:

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

commit e02b2ca451b050db7a63fb19ccf0decc6c7d04a1
Author:     Zsolt Udvari <uzsolt@FreeBSD.org>
AuthorDate: 2025-07-10 11:03:37 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2025-07-10 11:08:15 +0000

    textproc/libxml2: Fix cmake file
    
    The port's cmake file is wrong because there is an unclosed
    if-statement.
    Can check with 'cmake -P test-libxml2.cmake' where the content of
    test-libxml2.cmake is:
    include("/usr/local/lib/cmake/libxml2/libxml2-config.cmake")
    
    The test's result is:
    CMake Error at /usr/local/lib/cmake/libxml2/libxml2-config.cmake:53 (if):
      Flow control statements are not properly nested.
    Call Stack (most recent call first):
      test-libxml2.cmake:1 (include)
    
    Approved by:    portmgr (blanket, trivial runtime fix)
---
 textproc/libxml2/Makefile                            |  2 +-
 textproc/libxml2/files/patch-libxml2-config.cmake.in | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/textproc/libxml2/Makefile b/textproc/libxml2/Makefile
index 7f2922589d85..af933570190a 100644
--- a/textproc/libxml2/Makefile
+++ b/textproc/libxml2/Makefile
@@ -1,6 +1,6 @@
 PORTNAME?=	libxml2
 DISTVERSION=	2.14.4
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES?=	textproc gnome
 MASTER_SITES=	GNOME
 DISTNAME=	libxml2-${DISTVERSION}
diff --git a/textproc/libxml2/files/patch-libxml2-config.cmake.in b/textproc/libxml2/files/patch-libxml2-config.cmake.in
new file mode 100644
index 000000000000..581142a44aaf
--- /dev/null
+++ b/textproc/libxml2/files/patch-libxml2-config.cmake.in
@@ -0,0 +1,10 @@
+--- libxml2-config.cmake.in.orig	2025-07-10 08:31:10 UTC
++++ libxml2-config.cmake.in
+@@ -119,6 +119,7 @@ if(NOT LIBXML2_SHARED)
+         if(LIBXML2_WITH_HTTP)
+             list(APPEND LIBXML2_LIBRARIES ws2_32)
+             list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ws2_32>")
++        endif()
+     endif()
+ endif()
+