git: 1d33dca7d312 - main - graphics/cfdg: unbundle graphics/agg

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Sat, 03 May 2025 11:19:59 UTC
The branch main has been updated by fuz:

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

commit 1d33dca7d3120cd55ca5b989fb380364251ff4e9
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2025-05-01 10:53:10 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-05-03 11:19:38 +0000

    graphics/cfdg: unbundle graphics/agg
    
    Many thanks to dinoex@ for helping me with the unbundling.
    
    PR:             285652
---
 graphics/cfdg/Makefile             | 10 ++++------
 graphics/cfdg/files/patch-Makefile | 19 +++++++++++--------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/graphics/cfdg/Makefile b/graphics/cfdg/Makefile
index ec64d7dd4501..5c881ad4c94e 100644
--- a/graphics/cfdg/Makefile
+++ b/graphics/cfdg/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	cfdg
 DISTVERSION=	3.4.2
+PORTREVISION=	1
 CATEGORIES=	graphics math
 MASTER_SITES=	http://www.contextfreeart.org/download/ \
 		http://glyphic.s3.amazonaws.com/cfa/download/
@@ -12,7 +13,8 @@ WWW=		https://www.contextfreeart.org/
 LICENSE=	GPLv2+
 LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 
-LIB_DEPENDS=	libicuuc.so:devel/icu \
+LIB_DEPENDS=	libagg.so:graphics/agg \
+		libicuuc.so:devel/icu \
 		libpng.so:graphics/png
 
 USES=		bison gmake tar:xz
@@ -21,10 +23,6 @@ MAKE_ARGS=	prefix=${PREFIX} \
 TEST_TARGET=	check
 CXXFLAGS+=	-Wno-register
 
-# graphics/agg cannot be unbundled: version in ports too outdated
-# furthermore, its header files conflict with the headers bundled by cfdg
-CONFLICTS_BUILD=	agg
-
 NO_WRKSUBDIR=	yes
 PLIST_FILES=	bin/cfdg \
 		share/man/man1/cfdg.1.gz
@@ -37,7 +35,7 @@ FFMPEG_LIB_DEPENDS=	libavformat.so:multimedia/ffmpeg \
 			libx264.so:multimedia/libx264
 FFMPEG_MAKE_ARGS=	WANT_FFMPEG=yes
 
-post-patch:
+pre-configure:
 	${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},' ${WRKSRC}/Makefile
 
 do-install-EXAMPLES-on:
diff --git a/graphics/cfdg/files/patch-Makefile b/graphics/cfdg/files/patch-Makefile
index 8e9f7710ae11..e7c2973f5b3e 100644
--- a/graphics/cfdg/files/patch-Makefile
+++ b/graphics/cfdg/files/patch-Makefile
@@ -1,6 +1,6 @@
---- Makefile.orig	2023-02-04 00:34:00 UTC
+--- Makefile.orig	2025-03-23 20:30:34 UTC
 +++ Makefile
-@@ -19,7 +19,7 @@ vpath %.cpp $(SRC_DIRS)
+@@ -19,7 +19,7 @@ INC_DIRS = $(COMMON_DIR) $(UNIX_DIR) $(DERIVED_DIR) $(
  vpath %.cfdg input
  
  INC_DIRS = $(COMMON_DIR) $(UNIX_DIR) $(DERIVED_DIR) $(COMMON_DIR)/agg-extras
@@ -59,18 +59,21 @@
  #
  # Configuration for local AGG
  #
- SRCS += $(AGG_SRCS)
- INC_DIRS += $(AGG_DIR) $(AGG_DIR)/agg2
+-SRCS += $(AGG_SRCS)
+-INC_DIRS += $(AGG_DIR) $(AGG_DIR)/agg2
++#SRCS += $(AGG_SRCS)
++#INC_DIRS += $(AGG_DIR) $(AGG_DIR)/agg2
  
  
  #
  # Configuration for system AGG
  #
- #LIBS += agg
+-#LIBS += agg
++LIBS += agg
  
  
  OBJS = $(patsubst %.cpp,$(OBJ_DIR)/%.o,$(SRCS))
-@@ -113,6 +105,7 @@ DEPS = $(patsubst %.o,%.d,$(OBJS))
+@@ -113,6 +105,7 @@ LINKFLAGS += $(patsubst %,-l%,$(LIBS))
  
  LINKFLAGS += $(patsubst %,-L%,$(LIB_DIRS))
  LINKFLAGS += $(patsubst %,-l%,$(LIBS))
@@ -78,7 +81,7 @@
  LINKFLAGS += -fexceptions
  
  deps: $(OBJ_DIR) $(DEPS)
-@@ -133,7 +126,7 @@ $(OBJS): $(OBJ_DIR)/Sentry
+@@ -133,7 +126,7 @@ cfdg: $(OBJS)
  # Under Cygwin replace strip $@ with strip $@.exe
  
  cfdg: $(OBJS)
@@ -87,7 +90,7 @@
  	strip $@
  
  
-@@ -196,7 +189,7 @@ check: cfdg
+@@ -196,7 +189,7 @@ CXXFLAGS += $(patsubst %,-I%,$(INC_DIRS))
  #
  
  CXXFLAGS += $(patsubst %,-I%,$(INC_DIRS))