git: c00357ccd000 - main - graphics/png: Fix the HAVE_LD_VERSION_SCRIPT check

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Sat, 10 Oct 2026 15:41:27 UTC
The branch main has been updated by arrowd:

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

commit c00357ccd000cd35cfcd018874f210114ba83a14
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2026-10-10 15:11:56 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2026-10-10 15:41:16 +0000

    graphics/png: Fix the HAVE_LD_VERSION_SCRIPT check
    
    PR:             299275
---
 graphics/png/Makefile                   |  2 ++
 graphics/png/files/patch-CMakeLists.txt | 13 +++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/graphics/png/Makefile b/graphics/png/Makefile
index 6753b2ba693d..f843f01f7132 100644
--- a/graphics/png/Makefile
+++ b/graphics/png/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	png
 DISTVERSION=	1.6.59
+PORTREVISION=	1
 CATEGORIES=	graphics
 MASTER_SITES=	SF/lib${PORTNAME}/lib${PORTNAME}16/${DISTVERSION}/
 #PATCH_SITES=	SF/lib${PORTNAME}-apng/lib${PORTNAME}16/${DISTVERSION}/
@@ -20,6 +21,7 @@ LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
 USES=		cmake:testing cpe pathfix tar:xz
 CPE_PRODUCT=	libpng
 USE_LDCONFIG=	yes
+HAS_SYMBOL_VERSION=	${PREFIX}/lib/libpng16.so
 
 CMAKE_TESTING_ON=	 PNG_TESTS
 
diff --git a/graphics/png/files/patch-CMakeLists.txt b/graphics/png/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..c8b7010bab8a
--- /dev/null
+++ b/graphics/png/files/patch-CMakeLists.txt
@@ -0,0 +1,13 @@
+Can be removed once FreeBSD 14 goes EoL
+
+--- CMakeLists.txt.orig	2026-10-10 15:08:05 UTC
++++ CMakeLists.txt
+@@ -393,7 +393,7 @@ if(ld-version-script AND NOT (ANDROID OR APPLE))
+ if(ld-version-script AND NOT (ANDROID OR APPLE))
+   # Check if LD supports linker scripts.
+   file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "
+-VERS_1 { global: sym1; local: *; };
++VERS_1 { global: sym1; };
+ VERS_2 { global: sym2; main; } VERS_1;
+ ")
+   # CMAKE_REQUIRED_FLAGS is a space-separated string, not a CMake list.