1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-01 05:45:45 +00:00

graphics/fv: make the code both C++14/17-friendly, cleanup Makefile

Fixes:	dd362b15e2
This commit is contained in:
Alexey Dokuchaev 2023-09-06 05:00:54 +00:00
parent 3db77c06df
commit 1e713e7082
3 changed files with 40 additions and 24 deletions

View File

@ -13,35 +13,15 @@ LICENSE= GPLv2+
LIB_DEPENDS= libpng.so:graphics/png
USES= gl gmake pkgconfig zip
USE_GL= glut
USES= gl gmake xorg zip
USE_GL= gl glu glut
USE_XORG= sm x11 xext xi xmu
ALL_TARGET= ${PORTNAME}
CXXFLAGS+= $$(pkg-config --cflags libpng) -I${LOCALBASE}/include
LDFLAGS+= $$(pkg-config --libs libpng) -L${LOCALBASE}/lib -lglut \
-lGLU -lGL -lbz2 -lm -lz -llzma -lpthread
PORTDOCS= AUTHORS ChangeLog README
PLIST_FILES= bin/${PORTNAME}
OPTIONS_DEFINE= DEBUG DOCS
DEBUG_CXXFLAGS_OFF= -DNDEBUG
.include <bsd.port.options.mk>
.if ${OPSYS} == FreeBSD && ( ${OSVERSION} >= 1400091 || ( ${OSVERSION} >= 1302505 && ${OSVERSION} < 1400000 ))
USES+= llvm:max=15
CC= clang${LLVM_VERSION}
CPP= clang-cpp${LLVM_VERSION}
CXX= clang++${LLVM_VERSION}
.endif
post-patch:
@${REINPLACE_CMD} -e \
's|^CXX=|CXX?=| ; \
s|^CXXFLAGS=|CXXFLAGS?=| ; \
s|^LDFLAGS=|LDFLAGS?=|' ${WRKSRC}/Makefile
OPTIONS_DEFINE= DOCS
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin

View File

@ -0,0 +1,18 @@
--- Makefile.orig 2012-05-07 01:48:43 UTC
+++ Makefile
@@ -62,11 +62,12 @@ LDFLAGS=\
-L/opt/local/lib -lpng15 -lz -lbz2 -llzma -lpthread \
-lm
else
-CXXXFLAGS=\
-$(OPT)
+CXXFLAGS+=\
+-Wno-deprecated \
+-I$(LOCALBASE)/include
LDFLAGS=\
-lpng -lz -lbz2 -llzma -lpthread \
--lfreeglut -lGLU -lGL -L/usr/X11R6/lib -lXi -lXmu -lX11 -lXext -lSM \
+-lglut -lGLU -lGL -L$(LOCALBASE)/lib -lXi -lXmu -lX11 -lXext -lSM \
-lm
endif
endif

View File

@ -0,0 +1,18 @@
--- common.h.orig 2012-05-07 01:48:43 UTC
+++ common.h
@@ -108,6 +108,7 @@ inline T deg2rad(T angle)
return angle * M_PI / 180.0;
}
+#if _LIBCPP_STD_VER <= 14
template <class T>
inline T clamp(T x, T a, T b)
{
@@ -118,6 +119,7 @@ inline T clamp(T x, T a, T b)
}
return x;
}
+#endif
extern bool isLittleEndian();