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
This commit is contained in:
John Marino 2014-04-21 13:08:53 +00:00
parent 98e5c24df8
commit dd918e15cf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=351680
6 changed files with 119 additions and 20 deletions

View file

@ -14,12 +14,13 @@ COMMENT= Persistence of Vision Ray Tracer
LIB_DEPENDS= libboost_thread.so:${PORTSDIR}/devel/boost-libs LIB_DEPENDS= libboost_thread.so:${PORTSDIR}/devel/boost-libs
OPTIONS_DEFINE= X11 PNG JPEG TIFF OPENEXR STATIC IO EXAMPLES DOCS 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) IO_DESC= Without I/O restrictions (security risk)
EXAMPLES_DESC= Install example scenes EXAMPLES_DESC= Install example scenes
DOCS_DESC= Install HTML documentation DOCS_DESC= Install HTML documentation
USE_GMAKE= yes USES= gmake
GNU_CONFIGURE= yes GNU_CONFIGURE= yes
VERSION_BASE= ${PORTVERSION:C/([0-9]+\.[0-9]+).*/\1/} 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} ETCDIR= ${PREFIX}/etc/${PORTNAME}/${VERSION_BASE}
INCLUDES= -I${LOCALBASE}/include INCLUDES= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib -lboost_system
CONFIGURE_ARGS= COMPILED_BY=${MAINTAINER} --prefix=${PREFIX} \ CONFIGURE_ARGS= COMPILED_BY=${MAINTAINER} --prefix=${PREFIX} \
--program-transform-name='s/${PORTNAME}/${PORTNAME}${PKGNAMESUFFIX}/' \ --program-transform-name='s/${PORTNAME}/${PORTNAME}${PKGNAMESUFFIX}/' \
--disable-optimiz --disable-optimiz
NO_STAGE= yes
.include <bsd.port.options.mk> .include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MX11} .if ${PORT_OPTIONS:MX11}
USE_XORG= xpm sm ice x11 USE_XORG= xpm sm ice x11
USE_SDL= sdl USE_SDL= sdl
CONFIGURE_ARGS+= --x-include=${LOCALBASE}/include --x-libraries=${LOCALBASE}/libs CONFIGURE_ARGS+= --x-include=${LOCALBASE}/include --x-libraries=${LOCALBASE}/libs
PLIST_SUB+= X11=""
.else .else
CONFIGURE_ARGS+= --without-x CONFIGURE_ARGS+= --without-x
PLIST_SUB+= X11="@comment "
.endif .endif
.if ${PORT_OPTIONS:MSTATIC} .if ${PORT_OPTIONS:MSTATIC}
@ -118,12 +117,16 @@ PORTDOCS= *
PORTEXAMPLES= * PORTEXAMPLES= *
post-patch: 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 \ @${REINPLACE_CMD} -e 's/TIME_UTC/TIME_UTC_/g' ${WRKSRC}/source/backend/scene/view.cpp \
${WRKSRC}/source/base/timer.cpp \ ${WRKSRC}/source/base/timer.cpp \
${WRKSRC}/vfe/vfepovms.cpp \ ${WRKSRC}/vfe/vfepovms.cpp \
${WRKSRC}/vfe/unix/platformbase.cpp \ ${WRKSRC}/vfe/unix/platformbase.cpp \
${WRKSRC}/vfe/vfesession.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: pre-build:
.if ${PORT_OPTIONS:MSTATIC} && ${PORT_OPTIONS:MTIFF} .if ${PORT_OPTIONS:MSTATIC} && ${PORT_OPTIONS:MTIFF}
# graphics/tiff adds dependencies on libjpeg and libjbig # graphics/tiff adds dependencies on libjpeg and libjbig
@ -131,27 +134,27 @@ pre-build:
.endif .endif
do-install: do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/unix/${PORTNAME} ${PREFIX}/bin/${PORTNAME}${PKGNAMESUFFIX} @${INSTALL_PROGRAM} ${WRKSRC}/unix/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}${PKGNAMESUFFIX}
@${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${MAN1PREFIX}/man/man1/${MAN1} @${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/${MAN1}
@${MKDIR} ${ETCDIR} @${MKDIR} ${STAGEDIR}${ETCDIR}
@${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${ETCDIR} @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${STAGEDIR}${ETCDIR}
@${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.ini ${ETCDIR} @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.ini ${STAGEDIR}${ETCDIR}
.for i in include ini scripts .for i in include ini scripts
${MKDIR} ${DATADIR}/$i ${MKDIR} ${STAGEDIR}${DATADIR}/$i
cd ${WRKSRC}/$i && ${COPYTREE_SHARE} . ${DATADIR}/$i cd ${WRKSRC}/$i && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/$i
.endfor .endfor
.if ${PORT_OPTIONS:MX11} .if ${PORT_OPTIONS:MX11}
@${MKDIR} ${DATADIR}/icons @${MKDIR} ${STAGEDIR}${DATADIR}/icons
cd ${WRKSRC}/icons && ${COPYTREE_SHARE} . ${DATADIR}/icons cd ${WRKSRC}/icons && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/icons
.endif .endif
.if ${PORT_OPTIONS:MEXAMPLES} .if ${PORT_OPTIONS:MEXAMPLES}
@${MKDIR} ${EXAMPLESDIR} @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
cd ${WRKSRC}/scenes && ${COPYTREE_SHARE} . ${EXAMPLESDIR} cd ${WRKSRC}/scenes && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}
.endif .endif
.if ${PORT_OPTIONS:MDOCS} .if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${DOCSDIR} @${MKDIR} ${STAGEDIR}${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${DOC_FILES} ${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${DOC_FILES} ${STAGEDIR}${DOCSDIR}
cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${DOCSDIR} cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
.endif .endif
.include <bsd.port.mk> .include <bsd.port.mk>

View file

@ -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());

View file

@ -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;

View file

@ -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) ;

View file

@ -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;

View file

@ -1,4 +1,5 @@
bin/povray37 bin/povray37
man/man1/povray37.1.gz
%%ETCDIR%%/povray.conf %%ETCDIR%%/povray.conf
%%ETCDIR%%/povray.ini %%ETCDIR%%/povray.ini
%%X11%%%%DATADIR%%/icons/file_inc_classic_16.png %%X11%%%%DATADIR%%/icons/file_inc_classic_16.png