aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2023-09-06 05:00:54 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2023-09-06 05:00:54 +0000
commit1e713e7082b0c4ecd96dac71944cdee56c8e3bd5 (patch)
tree3777790093973c012c38e678ea3aa2665018feca
parent3db77c06df7e2d233f53e1b26e050aad0d6f9682 (diff)
downloadports-1e713e7082b0c4ecd96dac71944cdee56c8e3bd5.tar.gz
ports-1e713e7082b0c4ecd96dac71944cdee56c8e3bd5.zip
graphics/fv: make the code both C++14/17-friendly, cleanup Makefile
Fixes: dd362b15e226
-rw-r--r--graphics/fv/Makefile28
-rw-r--r--graphics/fv/files/patch-Makefile18
-rw-r--r--graphics/fv/files/patch-common.h18
3 files changed, 40 insertions, 24 deletions
diff --git a/graphics/fv/Makefile b/graphics/fv/Makefile
index 8bee9692d85c..a3443faa6d04 100644
--- a/graphics/fv/Makefile
+++ b/graphics/fv/Makefile
@@ -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
diff --git a/graphics/fv/files/patch-Makefile b/graphics/fv/files/patch-Makefile
new file mode 100644
index 000000000000..3a0ec0d66b4a
--- /dev/null
+++ b/graphics/fv/files/patch-Makefile
@@ -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
diff --git a/graphics/fv/files/patch-common.h b/graphics/fv/files/patch-common.h
new file mode 100644
index 000000000000..9acf98835ffc
--- /dev/null
+++ b/graphics/fv/files/patch-common.h
@@ -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();
+