diff --git a/graphics/cfdg/Makefile b/graphics/cfdg/Makefile index ec64d7dd4501..5c881ad4c94e 100644 --- a/graphics/cfdg/Makefile +++ b/graphics/cfdg/Makefile @@ -1,47 +1,45 @@ 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/ DISTNAME= ContextFreeSource${DISTVERSION} MAINTAINER= fuz@FreeBSD.org COMMENT= Context Free Design Grammar compiler 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 MAKE_ARGS= prefix=${PREFIX} \ DESTDIR=${STAGEDIR} 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 PORTEXAMPLES= *.cfdg OPTIONS_DEFINE= EXAMPLES FFMPEG OPTIONS_DEFAULT= FFMPEG 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: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/input/*.cfdg ${STAGEDIR}${EXAMPLESDIR} .include 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,98 +1,101 @@ ---- 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 -INC_DIRS += /usr/local/include +INC_DIRS += %%LOCALBASE%%/include # # Installation directories @@ -34,7 +34,7 @@ MAN_DIR = $(DESTDIR)$(prefix)/share/man # Library directories for FFmpeg and libpng # -LIB_DIRS = /usr/local/lib +LIB_DIRS := %%LOCALBASE%%/lib $(shell libpng-config --libdir) # # Sources and Objects @@ -69,43 +69,35 @@ INPUT_SRCS = ciliasun_v2.cfdg demo1_v2.cfdg demo2_v2.c welcome.cfdg ziggy.cfdg -LIBS = png m +LIBS = m -# Use the first one for clang and the second one for gcc -ifeq ($(shell uname -s), Darwin) - LIBS += c++ icucore -else - LIBS += stdc++ atomic icui18n icuuc icudata -endif +LIBS += stdc++ icui18n icuuc icudata # # FFmpeg support # # Uncomment these lines to enable FFmpeg support # +ifeq ($(WANT_FFMPEG), yes) + COMMON_SRCS += ffCanvas.cpp + LIBS += avformat avcodec swscale swresample avutil z m x264 pthread dl +else + COMMON_SRCS += ffCanvasDummy.cpp +endif -# COMMON_SRCS += ffCanvas.cpp -# LIBS += avformat avcodec swscale swresample avutil z m x264 pthread dl - -# -# Comment out this line to enable FFmpeg support -# - -COMMON_SRCS += ffCanvasDummy.cpp - SRCS = $(DERIVED_SRCS) $(COMMON_SRCS) $(UNIX_SRCS) # # 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)) +LINKFLAGS += $(shell libpng-config --libs) 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) - $(LINK.o) $^ $(LINKFLAGS) -o $@ + $(CXX) $^ $(LINKFLAGS) -o $@ strip $@ -@@ -196,7 +189,7 @@ check: cfdg +@@ -196,7 +189,7 @@ CXXFLAGS += $(patsubst %,-I%,$(INC_DIRS)) # CXXFLAGS += $(patsubst %,-I%,$(INC_DIRS)) -CXXFLAGS += -O2 -Wall -Wextra -Wno-parentheses -std=c++17 +CXXFLAGS += -Wall -Wextra -Wno-parentheses -std=c++17 CXXFLAGS += -g -D_GLIBCXX_USE_C99_MATH=1 CPPFLAGS += -DNDEBUG