diff options
author | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2013-09-27 01:19:33 +0800 |
---|---|---|
committer | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2013-09-27 01:19:33 +0800 |
commit | 86db3fb43e263dc2532875741c436d701d83442e (patch) | |
tree | 05e8c964a75667c5b8e9a304e5af3ff4ce50178a /graphics | |
parent | fce96b1a4897147db88a08186176742308ffa9ce (diff) | |
download | freebsd-ports-gnome-86db3fb43e263dc2532875741c436d701d83442e.tar.gz freebsd-ports-gnome-86db3fb43e263dc2532875741c436d701d83442e.tar.zst freebsd-ports-gnome-86db3fb43e263dc2532875741c436d701d83442e.zip |
- Fix build with clang
- Support staging
- Convert to new LIB_DEPENDS syntax and OPTIONS features
PR: 182205
Submitted by: nemysis <nemysis@FreeBSD.org>
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/osg/Makefile | 96 | ||||
-rw-r--r-- | graphics/osg/files/patch-include-OpenThreads-Atomic | 11 | ||||
-rw-r--r-- | graphics/osg/files/patch-include-osg-Math | 29 | ||||
-rw-r--r-- | graphics/osg/files/patch-src-OpenThreads-common-Atomic.cpp | 11 | ||||
-rw-r--r-- | graphics/osg/pkg-plist | 1 |
5 files changed, 77 insertions, 71 deletions
diff --git a/graphics/osg/Makefile b/graphics/osg/Makefile index f382754e7c91..0f90b88fecdc 100644 --- a/graphics/osg/Makefile +++ b/graphics/osg/Makefile @@ -3,7 +3,7 @@ PORTNAME= osg PORTVERSION= 3.0.1 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= graphics MASTER_SITES= http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-${PORTVERSION}/source/ \ http://mirror.amdmi3.ru/distfiles/ @@ -12,19 +12,17 @@ DISTNAME= OpenSceneGraph-${PORTVERSION} MAINTAINER= amdmi3@FreeBSD.org COMMENT= C++ OpenGL scene graph library for real-time rendering -LIB_DEPENDS= jpeg:${PORTSDIR}/graphics/jpeg \ - png15:${PORTSDIR}/graphics/png \ - tiff:${PORTSDIR}/graphics/tiff +LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg \ + libpng.so:${PORTSDIR}/graphics/png \ + libtiff.so:${PORTSDIR}/graphics/tiff CONFLICTS= osg-devel-[0-9]* -USE_GCC= any USE_ZIP= yes USES= cmake pkgconfig USE_GL= gl glu USE_XORG= x11 USE_LDCONFIG= yes -USE_GCC= 4.2+ PLIST_SUB= OSG_VERSION=${PORTVERSION} \ OSG_SHLIBVER=80 \ @@ -35,18 +33,33 @@ PORTSCOUT= limitw:1,even OPTIONS_DEFINE= CURL FREETYPE GDAL GIF INVENTOR JASPER XINE ITK \ VNC OPENEXR FFMPEG SVG PDF XRANDR SDL +OPTIONS_DEFAULT=FREETYPE GIF FFMPEG XRANDR + GDAL_DESC= GDAL support INVENTOR_DESC= SGI OpenInventor support ITK_DESC= InsightToolkit support VNC_DESC= LibVNCServer support SDL_DESC= Use SDL (joystick support in present3d) -OPTIONS_DEFAULT= FREETYPE GIF XRANDR - -# broken (openvrml from ports is too old) -# OPENVRML "Support for OpenVRML" off +OPTIONS_SUB= yes + +CURL_LIB_DEPENDS= libcurl.so:${PORTSDIR}/ftp/curl +FREETYPE_LIB_DEPENDS= libfreetype.so:${PORTSDIR}/print/freetype2 +GDAL_LIB_DEPENDS= libgdal.so:${PORTSDIR}/graphics/gdal +GIF_LIB_DEPENDS= libgif.so:${PORTSDIR}/graphics/giflib +INVENTOR_LIB_DEPENDS= libInventor.so:${PORTSDIR}/graphics/inventor +JASPER_LIB_DEPENDS= libjasper.so:${PORTSDIR}/graphics/jasper +XINE_LIB_DEPENDS= libxine.so:${PORTSDIR}/multimedia/libxine +ITK_BUILD_DEPENDS= ${LOCALBASE}/lib/InsightToolkit/UseITK.cmake:${PORTSDIR}/science/InsightToolkit +ITK_RUN_DEPENDS= ${LOCALBASE}/lib/InsightToolkit/UseITK.cmake:${PORTSDIR}/science/InsightToolkit +VNC_LIB_DEPENDS= libvncserver.so:${PORTSDIR}/net/libvncserver +OPENEXR_LIB_DEPENDS= libIlmImf.so:${PORTSDIR}/graphics/OpenEXR +FFMPEG_LIB_DEPENDS= libavcodec.so:${PORTSDIR}/multimedia/ffmpeg +SVG_LIB_DEPENDS= librsvg-2.so:${PORTSDIR}/graphics/librsvg2 +PDF_LIB_DEPENDS= libpoppler-glib.so:${PORTSDIR}/graphics/poppler-glib +XRANDR_CMAKE_ON= -DOSGVIEWER_USE_XRANDR:BOOL=ON +XRANDR_CMAKE_OFF= -DOSGVIEWER_USE_XRANDR:BOOL=OFF -NO_STAGE= yes .include <bsd.port.options.mk> # GUI toolkits are only needed for building examples, which are not even installed @@ -57,113 +70,72 @@ FORCE_REQUIRE= Threads OpenGL X11 JPEG PNG TIFF ZLIB # common & lightweig # options that affect FIND_PACKAGE .if ${PORT_OPTIONS:MCURL} FORCE_REQUIRE+= CURL -LIB_DEPENDS+= curl:${PORTSDIR}/ftp/curl -PLIST_SUB+= CURL="" .else FORCE_IGNORE+= CURL -PLIST_SUB+= CURL="@comment " .endif .if ${PORT_OPTIONS:MFREETYPE} FORCE_REQUIRE+= FreeType -LIB_DEPENDS+= freetype:${PORTSDIR}/print/freetype2 -PLIST_SUB+= FREETYPE="" .else FORCE_IGNORE+= FreeType -PLIST_SUB+= FREETYPE="@comment " .endif .if ${PORT_OPTIONS:MGDAL} FORCE_REQUIRE+= GDAL -LIB_DEPENDS+= gdal:${PORTSDIR}/graphics/gdal -PLIST_SUB+= GDAL="" .else FORCE_IGNORE+= GDAL -PLIST_SUB+= GDAL="@comment " .endif .if ${PORT_OPTIONS:MGIF} FORCE_REQUIRE+= GIFLIB -LIB_DEPENDS+= gif:${PORTSDIR}/graphics/giflib -PLIST_SUB+= GIF="" .else FORCE_IGNORE+= GIFLIB -PLIST_SUB+= GIF="@comment " .endif .if ${PORT_OPTIONS:MINVENTOR} FORCE_REQUIRE+= Inventor -BUILD_DEPENDS+= ${LOCALBASE}/lib/libInventor.so:${PORTSDIR}/graphics/inventor -RUN_DEPENDS+= ${LOCALBASE}/lib/libInventor.so:${PORTSDIR}/graphics/inventor -PLIST_SUB+= INVENTOR="" .else FORCE_IGNORE+= Inventor -PLIST_SUB+= INVENTOR="@comment " .endif .if ${PORT_OPTIONS:MJASPER} FORCE_REQUIRE+= Jasper -LIB_DEPENDS+= jasper:${PORTSDIR}/graphics/jasper -PLIST_SUB+= JASPER="" .else FORCE_IGNORE+= Jasper -PLIST_SUB+= JASPER="@comment " .endif -#.if ${PORT_OPTIONS:MOPENVRML} -#FORCE_REQUIRE+= OpenVRML -#LIB_DEPENDS+= openvrml:${PORTSDIR}/www/openvrml -#PLIST_SUB+= OPENVRML="" -#.else +# broken (openvrml from ports is too old) FORCE_IGNORE+= OpenVRML -PLIST_SUB+= OPENVRML="@comment " -#.endif .if ${PORT_OPTIONS:MXINE} FORCE_REQUIRE+= Xine -LIB_DEPENDS+= xine:${PORTSDIR}/multimedia/libxine -PLIST_SUB+= XINE="" .else FORCE_IGNORE+= Xine -PLIST_SUB+= XINE="@comment " .endif .if ${PORT_OPTIONS:MITK} FORCE_REQUIRE+= ITK -BUILD_DEPENDS+= ${LOCALBASE}/lib/InsightToolkit/UseITK.cmake:${PORTSDIR}/science/InsightToolkit -RUN_DEPENDS+= ${LOCALBASE}/lib/InsightToolkit/UseITK.cmake:${PORTSDIR}/science/InsightToolkit -PLIST_SUB+= ITK="" CXXFLAGS+= -DVCL_CAN_STATIC_CONST_INIT_FLOAT=0 .else FORCE_IGNORE+= ITK -PLIST_SUB+= ITK="@comment " .endif .if ${PORT_OPTIONS:MVNC} FORCE_REQUIRE+= LibVNCServer -LIB_DEPENDS+= vncserver:${PORTSDIR}/net/libvncserver -PLIST_SUB+= VNC="" .else FORCE_IGNORE+= LibVNCServer -PLIST_SUB+= VNC="@comment " .endif .if ${PORT_OPTIONS:MOPENEXR} FORCE_REQUIRE+= OpenEXR -LIB_DEPENDS+= IlmImf:${PORTSDIR}/graphics/OpenEXR -PLIST_SUB+= OPENEXR="" .else FORCE_IGNORE+= OpenEXR -PLIST_SUB+= OPENEXR="@comment " .endif .if ${PORT_OPTIONS:MFFMPEG} FORCE_REQUIRE+= FFmpeg -LIB_DEPENDS+= avcodec:${PORTSDIR}/multimedia/ffmpeg -PLIST_SUB+= FFMPEG="" .else FORCE_IGNORE+= FFmpeg -PLIST_SUB+= FFMPEG="@comment " .endif .if ${PORT_OPTIONS:MSDL} @@ -176,39 +148,23 @@ FORCE_IGNORE+= SDL # options that affect PKG_CHECK_MODULES .if ${PORT_OPTIONS:MSVG} FORCE_REQUIRE+= RSVG -LIB_DEPENDS+= rsvg-2:${PORTSDIR}/graphics/librsvg2 -PLIST_SUB+= SVG="" .else FORCE_IGNORE+= RSVG -PLIST_SUB+= SVG="@comment " .endif .if ${PORT_OPTIONS:MPDF} FORCE_REQUIRE+= Poppler-glib -LIB_DEPENDS+= poppler-glib:${PORTSDIR}/graphics/poppler-glib -PLIST_SUB+= PDF="" .else FORCE_IGNORE+= Poppler-glib -PLIST_SUB+= PDF="@comment " .endif .if ${PORT_OPTIONS:MSVG} || ${PORT_OPTIONS:MPDF} -LIB_DEPENDS+= cairo:${PORTSDIR}/graphics/cairo +USE_GNOME= cairo .endif # other options .if ${PORT_OPTIONS:MXRANDR} -CMAKE_ARGS+= -DOSGVIEWER_USE_XRANDR:BOOL=ON -USE_XORG+= xrandr -.else -CMAKE_ARGS+= -DOSGVIEWER_USE_XRANDR:BOOL=OFF -.endif - -.if ${PORT_OPTIONS:MXRANDR} -CMAKE_ARGS+= -DOSGVIEWER_USE_XRANDR:BOOL=ON USE_XORG+= xrandr -.else -CMAKE_ARGS+= -DOSGVIEWER_USE_XRANDR:BOOL=OFF .endif post-patch: diff --git a/graphics/osg/files/patch-include-OpenThreads-Atomic b/graphics/osg/files/patch-include-OpenThreads-Atomic new file mode 100644 index 000000000000..3061b662a747 --- /dev/null +++ b/graphics/osg/files/patch-include-OpenThreads-Atomic @@ -0,0 +1,11 @@ +--- include/OpenThreads/Atomic.orig 2011-01-31 12:35:50.000000000 +0100 ++++ include/OpenThreads/Atomic 2013-09-18 12:41:22.000000000 +0200 +@@ -241,7 +241,7 @@ + AtomicPtr::assign(void* ptrNew, const void* const ptrOld) + { + #if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS) +- return __sync_bool_compare_and_swap(&_ptr, ptrOld, ptrNew); ++ return __sync_bool_compare_and_swap(&_ptr, (void *)ptrOld, ptrNew); + #elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS) + return __compare_and_swap((unsigned long*)&_ptr, (unsigned long)ptrOld, (unsigned long)ptrNew); + #elif defined(_OPENTHREADS_ATOMIC_USE_SUN) diff --git a/graphics/osg/files/patch-include-osg-Math b/graphics/osg/files/patch-include-osg-Math new file mode 100644 index 000000000000..a53261098173 --- /dev/null +++ b/graphics/osg/files/patch-include-osg-Math @@ -0,0 +1,29 @@ +--- include/osg/Math.orig 2011-05-26 20:52:08.000000000 +0400 ++++ include/osg/Math 2013-09-24 22:00:59.252519925 +0400 +@@ -20,7 +20,7 @@ + + //certain math functions were not defined until 10.2 + //so this code checks the version so it can add in workarounds for older versions. +-#ifdef __APPLE__ ++#if defined(__APPLE__) + // Using std::isnan will work for OS X, but use of <cmath> + // and std:: are not necessarily portible with other systems so + // the include of <cmath> is isolated here. +@@ -38,6 +38,8 @@ + #define APPLE_PRE_10_2 + #endif + #endif ++#elif defined(__FreeBSD__) ++#include <cmath> + #endif + + #if defined(_MSC_VER) +@@ -207,7 +209,7 @@ + inline bool isNaN(float v) { return _isnan(v)!=0; } + inline bool isNaN(double v) { return _isnan(v)!=0; } + #else +- #if defined(__APPLE__) ++ #if defined(__APPLE__) || defined(__FreeBSD__) + inline bool isNaN(float v) { return std::isnan(v); } + inline bool isNaN(double v) { return std::isnan(v); } + #else diff --git a/graphics/osg/files/patch-src-OpenThreads-common-Atomic.cpp b/graphics/osg/files/patch-src-OpenThreads-common-Atomic.cpp new file mode 100644 index 000000000000..ef439e271090 --- /dev/null +++ b/graphics/osg/files/patch-src-OpenThreads-common-Atomic.cpp @@ -0,0 +1,11 @@ +--- src/OpenThreads/common/Atomic.cpp.orig 2011-04-19 13:40:22.000000000 +0200 ++++ src/OpenThreads/common/Atomic.cpp 2013-09-18 11:26:03.000000000 +0200 +@@ -143,7 +143,7 @@ + AtomicPtr::assign(void* ptrNew, const void* const ptrOld) + { + #if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS) +- return __sync_bool_compare_and_swap(&_ptr, ptrOld, ptrNew); ++ return __sync_bool_compare_and_swap(&_ptr, (void *)ptrOld, ptrNew); + #elif defined(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED) + return ptrOld == InterlockedCompareExchangePointer((PVOID volatile*)&_ptr, (PVOID)ptrNew, (PVOID)ptrOld); + #elif defined(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC) diff --git a/graphics/osg/pkg-plist b/graphics/osg/pkg-plist index ec6257070ace..31a4e683871f 100644 --- a/graphics/osg/pkg-plist +++ b/graphics/osg/pkg-plist @@ -672,7 +672,6 @@ lib/osgPlugins-%%OSG_VERSION%%/osgdb_trans.so lib/osgPlugins-%%OSG_VERSION%%/osgdb_txf.so lib/osgPlugins-%%OSG_VERSION%%/osgdb_txp.so %%VNC%%lib/osgPlugins-%%OSG_VERSION%%/osgdb_vnc.so -%%OPENVRML%%lib/osgPlugins-%%OSG_VERSION%%/osgdb_vrml.so lib/osgPlugins-%%OSG_VERSION%%/osgdb_vtf.so lib/osgPlugins-%%OSG_VERSION%%/osgdb_x.so %%XINE%%lib/osgPlugins-%%OSG_VERSION%%/osgdb_xine.so |