aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/osg
diff options
context:
space:
mode:
authoramdmi3 <amdmi3@FreeBSD.org>2009-02-10 11:57:56 +0800
committeramdmi3 <amdmi3@FreeBSD.org>2009-02-10 11:57:56 +0800
commitc615114cda2bc2175ab1a0463804e79c3f386cb4 (patch)
treef7a8f8a0b1d96ab691a703a513bccf32472f6403 /graphics/osg
parent7e9ed03dbea0df97f0b17b3df2a917cdfcae307d (diff)
downloadfreebsd-ports-graphics-c615114cda2bc2175ab1a0463804e79c3f386cb4.tar.gz
freebsd-ports-graphics-c615114cda2bc2175ab1a0463804e79c3f386cb4.tar.zst
freebsd-ports-graphics-c615114cda2bc2175ab1a0463804e79c3f386cb4.zip
- Fix installation
- Merge some changes from osg-devel - Add more knobs (for things detected via pkg-config) - Remove OPENVRML knob, which is broken - Add PORTSCOUT - Plist fixes
Diffstat (limited to 'graphics/osg')
-rw-r--r--graphics/osg/Makefile82
-rw-r--r--graphics/osg/files/patch-src-osgViewer-CMakeLists.txt20
-rw-r--r--graphics/osg/pkg-plist6
3 files changed, 85 insertions, 23 deletions
diff --git a/graphics/osg/Makefile b/graphics/osg/Makefile
index 4d57c5c20ed..4641c6b0a4c 100644
--- a/graphics/osg/Makefile
+++ b/graphics/osg/Makefile
@@ -7,7 +7,7 @@
PORTNAME= osg
PORTVERSION= 2.6.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= graphics
MASTER_SITES= http://www.openscenegraph.org/downloads/developer_releases/ \
http://mirror.amdmi3.ru/
@@ -23,27 +23,40 @@ LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg \
USE_ZIP= yes
USE_CMAKE= yes
USE_GL= gl glu
-WANT_SDL= yes
+USE_GNOME= pkgconfig
+USE_XORG= x11
USE_LDCONFIG= yes
-PLIST_SUB= OSG_VERSION=2.6.1 OSG_SHLIBVER=48
+PLIST_SUB= OSG_VERSION=${PORTVERSION} \
+ OSG_SHLIBVER=48 \
+ OPENTHREADS_VERSION=2.3.0 \
+ OPENTHREADS_SHLIBVER=11
-OPTIONS= CURL "Support for cURL" off \
- FREETYPE "Support for FreeType" on \
- GDAL "Support for GDAL" off \
- GIF "Support for libungif" on \
- INVENTOR "Support for SGI OpenInventor" off \
- JASPER "Support for JPEG2000" off \
- OPENVRML "Support for OpenVRML" off \
- XINE "Support for Xine" off
+PORTSCOUT= limitw:1,even
+
+OPTIONS= CURL "Support for cURL" off \
+ FREETYPE "Support for FreeType" on \
+ GDAL "Support for GDAL" off \
+ GIF "Support for libungif" on \
+ INVENTOR "Support for SGI OpenInventor" off \
+ JASPER "Support for JPEG2000" off \
+ XINE "Support for Xine" off \
+ SVG "Support for SVG through librsvg2" off \
+ XRANDR "Use Xrandr" on
+
+# broken
+# OPENVRML "Support for OpenVRML" off \
.include <bsd.port.pre.mk>
-# Gui toolkits (FOX, WX, QT, FLTK, SDL, GLUT) are only needed for
-# examples which are not installed, so leave them as is (autodetected)
-FORCE_IGNORE= COLLADA Performer
-FORCE_REQUIRE= JPEG PNG TIFF ZLIB Threads OpenGL X11
+# GUI toolkits are only needed for building examples, which are not even installed
+FORCE_IGNORE= FLTK GLUT SDL FOX Qt3 Qt4 wxWidgets # only needed for examples
+FORCE_IGNORE+= COLLADA Performer # not in ports (yet?)
+FORCE_REQUIRE= Threads OpenGL X11 JPEG PNG TIFF ZLIB # common & lightweight
+FORCE_PC_IGNORE= GTK GTKGL # only needed for examples
+FORCE_PC_REQUIRE=
+# options that affect FIND_PACKAGE
.if defined(WITH_CURL)
FORCE_REQUIRE+= CURL
LIB_DEPENDS+= curl.5:${PORTSDIR}/ftp/curl
@@ -98,14 +111,14 @@ FORCE_IGNORE+= Jasper
PLIST_SUB+= JASPER="@comment "
.endif
-.if defined(WITH_OPENVRML)
-FORCE_REQUIRE+= OpenVRML
-LIB_DEPENDS+= openvrml.8:${PORTSDIR}/www/openvrml
-PLIST_SUB+= OPENVRML=""
-.else
+#.if defined(WITH_OPENVRML)
+#FORCE_REQUIRE+= OpenVRML
+#LIB_DEPENDS+= openvrml.8:${PORTSDIR}/www/openvrml
+#PLIST_SUB+= OPENVRML=""
+#.else
FORCE_IGNORE+= OpenVRML
PLIST_SUB+= OPENVRML="@comment "
-.endif
+#.endif
.if defined(WITH_XINE)
FORCE_REQUIRE+= Xine
@@ -116,6 +129,25 @@ FORCE_IGNORE+= Xine
PLIST_SUB+= XINE="@comment "
.endif
+# options that affect PKG_CHECK_MODULES
+.if defined(WITH_SVG)
+FORCE_PC_REQUIRE+=RSVG CAIRO
+LIB_DEPENDS+= rsvg-2:${PORTSDIR}/graphics/librsvg2 \
+ cairo.2:${PORTSDIR}/graphics/cairo
+PLIST_SUB+= SVG=""
+.else
+FORCE_PC_IGNORE+=RSVG CAIRO
+PLIST_SUB+= SVG="@comment "
+.endif
+
+# other options
+.if defined(WITHOUT_XRANDR)
+CMAKE_ARGS+= -DOSGVIEWER_USE_XRANDR:BOOL=OFF
+.else
+CMAKE_ARGS+= -DOSGVIEWER_USE_XRANDR:BOOL=ON
+USE_XORG+= xrandr
+.endif
+
post-patch:
@${REINPLACE_CMD} -e 's|"64"|""|' ${WRKSRC}/CMakeLists.txt
@${REINPLACE_CMD} -e 's|cpu_set_t|cpuset_t|g' \
@@ -129,5 +161,13 @@ post-patch:
@${REINPLACE_CMD} -e '/FIND_PACKAGE.*${p}/ s|^|#|' \
${WRKSRC}/CMakeLists.txt
.endfor
+.for p in ${FORCE_PC_REQUIRE}
+ @${REINPLACE_CMD} -e 's|PKG_CHECK_MODULES.*${p}|& REQUIRED| ' \
+ ${WRKSRC}/CMakeLists.txt
+.endfor
+.for p in ${FORCE_PC_IGNORE}
+ @${REINPLACE_CMD} -e '/PKG_CHECK_MODULES.*${p}/ s|^|#|' \
+ ${WRKSRC}/CMakeLists.txt
+.endfor
.include <bsd.port.post.mk>
diff --git a/graphics/osg/files/patch-src-osgViewer-CMakeLists.txt b/graphics/osg/files/patch-src-osgViewer-CMakeLists.txt
new file mode 100644
index 00000000000..d42acffd81c
--- /dev/null
+++ b/graphics/osg/files/patch-src-osgViewer-CMakeLists.txt
@@ -0,0 +1,20 @@
+--- src/osgViewer/CMakeLists.txt.orig 2008-08-05 19:32:03.000000000 +0400
++++ src/osgViewer/CMakeLists.txt 2009-02-09 23:35:48.000000000 +0300
+@@ -78,7 +78,6 @@
+ SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS}
+ ${HEADER_PATH}/api/X11/GraphicsWindowX11
+ ${HEADER_PATH}/api/X11/PixelBufferX11
+- ${XRANDR_INCLUDE_DIRS}
+ )
+ SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
+ GraphicsWindowX11.cpp
+@@ -89,8 +88,7 @@
+ INCLUDE(FindPkgConfig)
+ PKG_CHECK_MODULES(XRANDR REQUIRED xrandr)
+ ADD_DEFINITIONS(-DOSGVIEWER_USE_XRANDR)
+- SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS} ${XRANDR_INCLUDE_DIRS})
+- LINK_LIBRARIES(Xrandr)
++ LINK_LIBRARIES(${XRANDR_LDFLAGS})
+ ENDIF(OSGVIEWER_USE_XRANDR)
+
+ # X11 on Apple requires X11 library plus OpenGL linking hack on Leopard
diff --git a/graphics/osg/pkg-plist b/graphics/osg/pkg-plist
index 4665ca629ed..07166d65e7d 100644
--- a/graphics/osg/pkg-plist
+++ b/graphics/osg/pkg-plist
@@ -417,8 +417,8 @@ include/osgWidget/Widget
include/osgWidget/Window
include/osgWidget/WindowManager
lib/libOpenThreads.so
-lib/libOpenThreads.so.11
-lib/libOpenThreads.so.2.3.0
+lib/libOpenThreads.so.%%OPENTHREADS_VERSION%%
+lib/libOpenThreads.so.%%OPENTHREADS_SHLIBVER%%
lib/libosg.so
lib/libosg.so.%%OSG_VERSION%%
lib/libosg.so.%%OSG_SHLIBVER%%
@@ -473,6 +473,7 @@ lib/osgPlugins-%%OSG_VERSION%%/osgdb_geo.so
%%GIF%%lib/osgPlugins-%%OSG_VERSION%%/osgdb_gif.so
lib/osgPlugins-%%OSG_VERSION%%/osgdb_glsl.so
lib/osgPlugins-%%OSG_VERSION%%/osgdb_hdr.so
+%%INVENTOR%%lib/osgPlugins-%%OSG_VERSION%%/osgdb_iv.so
lib/osgPlugins-%%OSG_VERSION%%/osgdb_ive.so
lib/osgPlugins-%%OSG_VERSION%%/osgdb_jpeg.so
%%JASPER%%lib/osgPlugins-%%OSG_VERSION%%/osgdb_jp2.so
@@ -503,6 +504,7 @@ lib/osgPlugins-%%OSG_VERSION%%/osgdb_rot.so
lib/osgPlugins-%%OSG_VERSION%%/osgdb_scale.so
lib/osgPlugins-%%OSG_VERSION%%/osgdb_shp.so
lib/osgPlugins-%%OSG_VERSION%%/osgdb_stl.so
+%%SVG%%lib/osgPlugins-%%OSG_VERSION%%/osgdb_svg.so
lib/osgPlugins-%%OSG_VERSION%%/osgdb_tga.so
lib/osgPlugins-%%OSG_VERSION%%/osgdb_tgz.so
lib/osgPlugins-%%OSG_VERSION%%/osgdb_tiff.so