diff --git a/graphics/cfdg/Makefile b/graphics/cfdg/Makefile index 54359b5f05d1..0bce0cead324 100644 --- a/graphics/cfdg/Makefile +++ b/graphics/cfdg/Makefile @@ -1,42 +1,47 @@ PORTNAME= cfdg -PORTVERSION= 3.3 -PORTREVISION= 4 +DISTVERSION= 3.4.1 CATEGORIES= graphics math MASTER_SITES= http://www.contextfreeart.org/download/ \ http://glyphic.s3.amazonaws.com/cfa/download/ -DISTNAME= ContextFreeSource${PORTVERSION} +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 \ libpng.so:graphics/png USES= bison gmake tar:xz MAKE_ARGS= prefix=${PREFIX} \ DESTDIR=${STAGEDIR} TEST_TARGET= check -NO_WRKSUBDIR= yes +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 + +WRKSRC= ${WRKDIR}/context-free${DISTVERSION} 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: - ${REINPLACE_CMD} -e 's,/usr/local,${LOCALBASE},' ${WRKSRC}/Makefile + ${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/distinfo b/graphics/cfdg/distinfo index 1b64578873fd..37f3f78c735d 100644 --- a/graphics/cfdg/distinfo +++ b/graphics/cfdg/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1633352475 -SHA256 (ContextFreeSource3.3.tar.xz) = f0b9b3622d7e729d867a5e5a9f8d1e9a134f019215fdde553c11b523416291c8 -SIZE (ContextFreeSource3.3.tar.xz) = 2684008 +TIMESTAMP = 1679405487 +SHA256 (ContextFreeSource3.4.1.tar.xz) = d8a496a61a5de970a29214c161dd59ed2fc6ddcecc631bc50bf773131f76d698 +SIZE (ContextFreeSource3.4.1.tar.xz) = 3097376 diff --git a/graphics/cfdg/files/patch-Makefile b/graphics/cfdg/files/patch-Makefile index 15e6c8f49045..8e9f7710ae11 100644 --- a/graphics/cfdg/files/patch-Makefile +++ b/graphics/cfdg/files/patch-Makefile @@ -1,76 +1,98 @@ ---- Makefile.orig 2020-04-10 19:38:18 UTC +--- Makefile.orig 2023-02-04 00:34:00 UTC +++ Makefile +@@ -19,7 +19,7 @@ vpath %.cpp $(SRC_DIRS) + 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 = /usr/local/lib $(shell libpng-config --libdir) ++LIB_DIRS := %%LOCALBASE%%/lib $(shell libpng-config --libdir) # # Sources and Objects -@@ -69,30 +69,20 @@ INPUT_SRCS = ciliasun_v2.cfdg demo1_v2.cfdg demo2_v2.c +@@ -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 --# + # 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) # -@@ -113,6 +103,7 @@ DEPS = $(patsubst %.o,%.d,$(OBJS)) + # Configuration for local AGG + # + SRCS += $(AGG_SRCS) + INC_DIRS += $(AGG_DIR) $(AGG_DIR)/agg2 + + + # + # Configuration for system AGG + # + #LIBS += agg + + + OBJS = $(patsubst %.cpp,$(OBJ_DIR)/%.o,$(SRCS)) +@@ -113,6 +105,7 @@ DEPS = $(patsubst %.o,%.d,$(OBJS)) LINKFLAGS += $(patsubst %,-L%,$(LIB_DIRS)) LINKFLAGS += $(patsubst %,-l%,$(LIBS)) +LINKFLAGS += $(shell libpng-config --libs) LINKFLAGS += -fexceptions deps: $(OBJ_DIR) $(DEPS) -@@ -133,7 +124,7 @@ $(OBJS): $(OBJ_DIR)/Sentry +@@ -133,7 +126,7 @@ $(OBJS): $(OBJ_DIR)/Sentry # Under Cygwin replace strip $@ with strip $@.exe cfdg: $(OBJS) - $(LINK.o) $^ $(LINKFLAGS) -o $@ + $(CXX) $^ $(LINKFLAGS) -o $@ strip $@ -@@ -196,7 +187,7 @@ check: cfdg +@@ -196,7 +189,7 @@ check: cfdg # CXXFLAGS += $(patsubst %,-I%,$(INC_DIRS)) --CXXFLAGS += -O2 -Wall -Wextra -march=native -Wno-parentheses -std=c++14 -+CXXFLAGS += -Wall -Wextra -Wno-parentheses -std=c++14 +-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 diff --git a/graphics/cfdg/files/patch-src-common_cfdg.ypp b/graphics/cfdg/files/patch-src-common_cfdg.ypp index f94bb67debde..f88ed7e89019 100644 --- a/graphics/cfdg/files/patch-src-common_cfdg.ypp +++ b/graphics/cfdg/files/patch-src-common_cfdg.ypp @@ -1,11 +1,11 @@ ---- src-common/cfdg.ypp.orig 2021-10-04 13:54:54 UTC +--- src-common/cfdg.ypp.orig 2023-02-04 00:34:00 UTC +++ src-common/cfdg.ypp @@ -31,7 +31,7 @@ %skeleton "lalr1.cc" /* -*- C++ -*- */ %require "3.0" %defines -%define parser_class_name {CfdgParser} +%define api.parser.class {CfdgParser} %locations %expect 3 //%debug