aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarino <marino@FreeBSD.org>2014-04-21 21:08:53 +0800
committermarino <marino@FreeBSD.org>2014-04-21 21:08:53 +0800
commit7ec7421facfba19e84523408a9f29f49a01413e9 (patch)
tree48c2682d2eb03b4ea8dccb731283d8eb7efd00fb
parentbf9953de7b5b724959d54e20ded85337b50c3bac (diff)
downloadfreebsd-ports-gnome-7ec7421facfba19e84523408a9f29f49a01413e9.tar.gz
freebsd-ports-gnome-7ec7421facfba19e84523408a9f29f49a01413e9.tar.zst
freebsd-ports-gnome-7ec7421facfba19e84523408a9f29f49a01413e9.zip
graphics/povray37: Fix build on clang, support stage
The main problem with building this port with clang was the use of shared_ptr without the boost namespace which clashes with libc++. This occurs in numerous places but luckly sed can fix most of them save for a few files that inconsistently used boost names. It was also missing an explicit link to libboost_system [1] PR: ports/176172 Submitted by: Oliver Hartmann Approved by: Maintainer timeout Stage support: blanket approval MFH: 2014Q2
-rw-r--r--graphics/povray37/Makefile43
-rw-r--r--graphics/povray37/files/patch-vfe_vfe.cpp40
-rw-r--r--graphics/povray37/files/patch-vfe_vfe.h24
-rw-r--r--graphics/povray37/files/patch-vfe_vfesession.cpp20
-rw-r--r--graphics/povray37/files/patch-vfe_vfesession.h11
-rw-r--r--graphics/povray37/pkg-plist1
6 files changed, 119 insertions, 20 deletions
diff --git a/graphics/povray37/Makefile b/graphics/povray37/Makefile
index 3b47ec75d682..45a9f7990905 100644
--- a/graphics/povray37/Makefile
+++ b/graphics/povray37/Makefile
@@ -14,12 +14,13 @@ COMMENT= Persistence of Vision Ray Tracer
LIB_DEPENDS= libboost_thread.so:${PORTSDIR}/devel/boost-libs
OPTIONS_DEFINE= X11 PNG JPEG TIFF OPENEXR STATIC IO EXAMPLES DOCS
-OPTIONS_DEFAULT= PNG JPEG EXAMPLES DOCS
+OPTIONS_DEFAULT=PNG JPEG EXAMPLES DOCS
+OPTIONS_SUB= yes
IO_DESC= Without I/O restrictions (security risk)
EXAMPLES_DESC= Install example scenes
DOCS_DESC= Install HTML documentation
-USE_GMAKE= yes
+USES= gmake
GNU_CONFIGURE= yes
VERSION_BASE= ${PORTVERSION:C/([0-9]+\.[0-9]+).*/\1/}
@@ -30,22 +31,20 @@ DATADIR= ${PREFIX}/share/${PORTNAME}-${VERSION_BASE}
ETCDIR= ${PREFIX}/etc/${PORTNAME}/${VERSION_BASE}
INCLUDES= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib -lboost_system
CONFIGURE_ARGS= COMPILED_BY=${MAINTAINER} --prefix=${PREFIX} \
--program-transform-name='s/${PORTNAME}/${PORTNAME}${PKGNAMESUFFIX}/' \
--disable-optimiz
-NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MX11}
USE_XORG= xpm sm ice x11
USE_SDL= sdl
CONFIGURE_ARGS+= --x-include=${LOCALBASE}/include --x-libraries=${LOCALBASE}/libs
-PLIST_SUB+= X11=""
.else
CONFIGURE_ARGS+= --without-x
-PLIST_SUB+= X11="@comment "
.endif
.if ${PORT_OPTIONS:MSTATIC}
@@ -118,12 +117,16 @@ PORTDOCS= *
PORTEXAMPLES= *
post-patch:
-# Fix with boost 1.52
+# Fix with boost 1.52 and now boost 1.55
@${REINPLACE_CMD} -e 's/TIME_UTC/TIME_UTC_/g' ${WRKSRC}/source/backend/scene/view.cpp \
${WRKSRC}/source/base/timer.cpp \
${WRKSRC}/vfe/vfepovms.cpp \
${WRKSRC}/vfe/unix/platformbase.cpp \
${WRKSRC}/vfe/vfesession.cpp
+ ${FIND} ${WRKSRC}/source/*end \( -name \*.h -o -name \*.cpp \) | \
+ ${XARGS} ${GREP} -l shared_ptr | ${SED} '/shellout/d' | \
+ ${XARGS} ${REINPLACE_CMD} -e 's|shared_ptr|boost::shared_ptr|g'
+
pre-build:
.if ${PORT_OPTIONS:MSTATIC} && ${PORT_OPTIONS:MTIFF}
# graphics/tiff adds dependencies on libjpeg and libjbig
@@ -131,27 +134,27 @@ pre-build:
.endif
do-install:
- @${INSTALL_PROGRAM} ${WRKSRC}/unix/${PORTNAME} ${PREFIX}/bin/${PORTNAME}${PKGNAMESUFFIX}
- @${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${MAN1PREFIX}/man/man1/${MAN1}
- @${MKDIR} ${ETCDIR}
- @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${ETCDIR}
- @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.ini ${ETCDIR}
+ @${INSTALL_PROGRAM} ${WRKSRC}/unix/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}${PKGNAMESUFFIX}
+ @${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/${MAN1}
+ @${MKDIR} ${STAGEDIR}${ETCDIR}
+ @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${STAGEDIR}${ETCDIR}
+ @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.ini ${STAGEDIR}${ETCDIR}
.for i in include ini scripts
- ${MKDIR} ${DATADIR}/$i
- cd ${WRKSRC}/$i && ${COPYTREE_SHARE} . ${DATADIR}/$i
+ ${MKDIR} ${STAGEDIR}${DATADIR}/$i
+ cd ${WRKSRC}/$i && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/$i
.endfor
.if ${PORT_OPTIONS:MX11}
- @${MKDIR} ${DATADIR}/icons
- cd ${WRKSRC}/icons && ${COPYTREE_SHARE} . ${DATADIR}/icons
+ @${MKDIR} ${STAGEDIR}${DATADIR}/icons
+ cd ${WRKSRC}/icons && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/icons
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
- @${MKDIR} ${EXAMPLESDIR}
- cd ${WRKSRC}/scenes && ${COPYTREE_SHARE} . ${EXAMPLESDIR}
+ @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+ cd ${WRKSRC}/scenes && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}
.endif
.if ${PORT_OPTIONS:MDOCS}
- @${MKDIR} ${DOCSDIR}
- cd ${WRKSRC} && ${INSTALL_DATA} ${DOC_FILES} ${DOCSDIR}
- cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${DOCSDIR}
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ cd ${WRKSRC} && ${INSTALL_DATA} ${DOC_FILES} ${STAGEDIR}${DOCSDIR}
+ cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
.endif
.include <bsd.port.mk>
diff --git a/graphics/povray37/files/patch-vfe_vfe.cpp b/graphics/povray37/files/patch-vfe_vfe.cpp
new file mode 100644
index 000000000000..e4a536ad7fa2
--- /dev/null
+++ b/graphics/povray37/files/patch-vfe_vfe.cpp
@@ -0,0 +1,40 @@
+--- vfe/vfe.cpp.orig 2012-06-19 11:29:39.000000000 -0500
++++ vfe/vfe.cpp
+@@ -640,7 +640,7 @@ void vfeProcessRenderOptions::WriteError
+ //
+ ////////////////////////////////////////////////////////////////////////////////////////
+
+-VirtualFrontEnd::VirtualFrontEnd(vfeSession& session, POVMSContext ctx, POVMSAddress addr, POVMS_Object& msg, POVMS_Object *result, shared_ptr<Console>& console) :
++VirtualFrontEnd::VirtualFrontEnd(vfeSession& session, POVMSContext ctx, POVMSAddress addr, POVMS_Object& msg, POVMS_Object *result, boost::shared_ptr<Console>& console) :
+ m_Session(&session), m_PlatformBase(session), renderFrontend (ctx)
+ {
+ backendAddress = addr ;
+@@ -747,7 +747,7 @@ bool VirtualFrontEnd::Start(POVMS_Object
+
+ if (m_Session->OutputToFileSet())
+ {
+- imageProcessing = shared_ptr<ImageProcessing> (new ImageProcessing (opts));
++ imageProcessing = boost::shared_ptr<ImageProcessing> (new ImageProcessing (opts));
+ UCS2String filename = imageProcessing->GetOutputFilename (opts, 0, 0);
+ options.SetUCS2String (kPOVAttrib_OutputFile, filename.c_str());
+
+@@ -774,8 +774,8 @@ bool VirtualFrontEnd::Start(POVMS_Object
+ opts.Set(kPOVAttrib_Declare, declares);
+ imageProcessing.reset();
+ if (m_Session->OutputToFileSet())
+- imageProcessing = shared_ptr<ImageProcessing> (new ImageProcessing (opts)) ;
+- animationProcessing = shared_ptr<AnimationProcessing> (new AnimationProcessing (opts)) ;
++ imageProcessing = boost::shared_ptr<ImageProcessing> (new ImageProcessing (opts)) ;
++ animationProcessing = boost::shared_ptr<AnimationProcessing> (new AnimationProcessing (opts)) ;
+ options = animationProcessing->GetFrameRenderOptions () ;
+ }
+
+@@ -1151,7 +1151,7 @@ State VirtualFrontEnd::Process()
+ }
+
+ // now we display the render window, if enabled
+- shared_ptr<Display> display(GetDisplay());
++ boost::shared_ptr<Display> display(GetDisplay());
+ if (display != NULL)
+ {
+ vfeDisplay *disp = dynamic_cast<vfeDisplay *>(display.get());
diff --git a/graphics/povray37/files/patch-vfe_vfe.h b/graphics/povray37/files/patch-vfe_vfe.h
new file mode 100644
index 000000000000..84a57dd04e50
--- /dev/null
+++ b/graphics/povray37/files/patch-vfe_vfe.h
@@ -0,0 +1,24 @@
+--- vfe/vfe.h.orig 2012-06-19 11:29:39.000000000 -0500
++++ vfe/vfe.h
+@@ -267,7 +267,7 @@ namespace vfe
+ class VirtualFrontEnd
+ {
+ public:
+- VirtualFrontEnd(vfeSession& session, POVMSContext ctx, POVMSAddress addr, POVMS_Object& msg, POVMS_Object *result, shared_ptr<Console>& console) ;
++ VirtualFrontEnd(vfeSession& session, POVMSContext ctx, POVMSAddress addr, POVMS_Object& msg, POVMS_Object *result, boost::shared_ptr<Console>& console) ;
+ virtual ~VirtualFrontEnd() ;
+
+ virtual bool Start(POVMS_Object& opts) ;
+@@ -298,9 +298,9 @@ namespace vfe
+ POVMS_Object options;
+ RenderFrontendBase::SceneId sceneId;
+ RenderFrontendBase::ViewId viewId;
+- shared_ptr<AnimationProcessing> animationProcessing ;
+- shared_ptr<ImageProcessing> imageProcessing ;
+- shared_ptr<ShelloutProcessing> shelloutProcessing;
++ boost::shared_ptr<AnimationProcessing> animationProcessing ;
++ boost::shared_ptr<ImageProcessing> imageProcessing ;
++ boost::shared_ptr<ShelloutProcessing> shelloutProcessing;
+ Console **consoleResult;
+ Display **displayResult;
+ vfeSession* m_Session;
diff --git a/graphics/povray37/files/patch-vfe_vfesession.cpp b/graphics/povray37/files/patch-vfe_vfesession.cpp
new file mode 100644
index 000000000000..60378ef159c7
--- /dev/null
+++ b/graphics/povray37/files/patch-vfe_vfesession.cpp
@@ -0,0 +1,20 @@
+--- vfe/vfesession.cpp.orig 2014-04-21 07:36:50.000000000 -0500
++++ vfe/vfesession.cpp
+@@ -602,7 +602,7 @@ const char *vfeSession::GetBackendStateN
+ boost::shared_ptr<Display> vfeSession::GetDisplay() const
+ {
+ if (m_Frontend == NULL)
+- return (shared_ptr<Display>());
++ return (boost::shared_ptr<Display>());
+ return m_Frontend->GetDisplay();
+ }
+
+@@ -640,7 +640,7 @@ void vfeSession::WorkerThread()
+ m_BackendThread = povray_init (boost::bind(&vfeSession::BackendThreadNotify, this), const_cast<void **>(&pov::RenderThreadAddr)) ;
+ POVMS_Output_Context = pov::POVMS_GUI_Context ;
+
+- m_Console = shared_ptr<vfeConsole> (new vfeConsole(this, m_ConsoleWidth)) ;
++ m_Console = boost::shared_ptr<vfeConsole> (new vfeConsole(this, m_ConsoleWidth)) ;
+
+ POVMS_Object obj ;
+ m_Frontend = new VirtualFrontEnd (*this, POVMS_Output_Context, (POVMSAddress) pov::RenderThreadAddr, obj, NULL, m_Console) ;
diff --git a/graphics/povray37/files/patch-vfe_vfesession.h b/graphics/povray37/files/patch-vfe_vfesession.h
new file mode 100644
index 000000000000..d21812712b1e
--- /dev/null
+++ b/graphics/povray37/files/patch-vfe_vfesession.h
@@ -0,0 +1,11 @@
+--- vfe/vfesession.h.orig 2012-06-19 11:29:40.000000000 -0500
++++ vfe/vfesession.h
+@@ -1294,7 +1294,7 @@ namespace vfe
+
+ static bool m_Initialized;
+ static vfeSession *m_CurrentSessionTemporaryHack;
+- shared_ptr<Console> m_Console;
++ boost::shared_ptr<Console> m_Console;
+
+ virtual vfeDisplay *DefaultDisplayCreator (unsigned int width, unsigned int height, GammaCurvePtr gamma, vfeSession *session, bool visible);
+ DisplayCreator m_DisplayCreator;
diff --git a/graphics/povray37/pkg-plist b/graphics/povray37/pkg-plist
index 59489fa3bad2..f0ec9e5e43d9 100644
--- a/graphics/povray37/pkg-plist
+++ b/graphics/povray37/pkg-plist
@@ -1,4 +1,5 @@
bin/povray37
+man/man1/povray37.1.gz
%%ETCDIR%%/povray.conf
%%ETCDIR%%/povray.ini
%%X11%%%%DATADIR%%/icons/file_inc_classic_16.png