aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/osg/Makefile
blob: 1d8721b30b85c45fb13d88196fbd4fcb1e62aabe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Created by: Randall Hopper <aa8vb@nc.rr.com>
# $FreeBSD$

PORTNAME=   osg
PORTVERSION=    3.4.0
PORTREVISION=   1
CATEGORIES= graphics
MASTER_SITES=   http://trac.openscenegraph.org/downloads/developer_releases/ \
        http://mirror.amdmi3.ru/distfiles/
DISTNAME=   OpenSceneGraph-${PORTVERSION}

MAINTAINER= amdmi3@FreeBSD.org
COMMENT=    C++ OpenGL scene graph library for real-time rendering

LICENSE=    OSGPL
LICENSE_NAME=   OpenSceneGraph Public License
LICENSE_FILE=   ${WRKSRC}/LICENSE.txt
LICENSE_PERMS=  dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

LIB_DEPENDS=    libpng.so:graphics/png \
        libtiff.so:graphics/tiff

CONFLICTS=  osg-devel-[0-9]*

USES=       alias cmake:outsource jpeg pkgconfig zip
USE_GL=     gl glu
USE_XORG=   x11
USE_LDCONFIG=   yes

PLIST_SUB=  OSG_VERSION=${PORTVERSION} \
        OSG_SHLIBVER=130 \
        OPENTHREADS_VERSION=3.3.0 \
        OPENTHREADS_SHLIBVER=20

PORTSCOUT=  limitw:1,even

OPTIONS_DEFINE= CURL FFMPEG FREETYPE GDAL GIF GSTREAMER GTA INVENTOR \
        JASPER LIBLAS LUA NVTT OPENEXR PDF SDL \
        SVG VNC XINE XRANDR
OPTIONS_RADIO=  QT
OPTIONS_RADIO_QT=QT4 QT5
OPTIONS_DEFAULT=FFMPEG FREETYPE GIF XRANDR

GDAL_DESC=  GDAL support
GTA_DESC=   GTA file format support
INVENTOR_DESC=  SGI OpenInventor support
LIBLAS_DESC=    liblas support
NVTT_DESC=  Use NVidia texture tools
QT_DESC=    QT toolkit support (optional)
SDL_DESC=   Use SDL (joystick support in present3d)
VNC_DESC=   LibVNCServer support

OPTIONS_SUB=    yes

CURL_LIB_DEPENDS=   libcurl.so:ftp/curl
CURL_VARS=      FORCE_REQUIRE+=CURL
CURL_VARS_OFF=      FORCE_IGNORE+=CURL
FFMPEG_LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg
FFMPEG_VARS=        FORCE_REQUIRE+=FFmpeg
FFMPEG_VARS_OFF=    FORCE_IGNORE+=FFmpeg
FREETYPE_LIB_DEPENDS=   libfreetype.so:print/freetype2
FREETYPE_VARS=      FORCE_REQUIRE+=Freetype
FREETYPE_VARS_OFF=  FORCE_IGNORE+=Freetype
GDAL_LIB_DEPENDS=   libgdal.so:graphics/gdal
GDAL_VARS=      FORCE_REQUIRE+=GDAL
GDAL_VARS_OFF=      FORCE_IGNORE+=GDAL
GIF_LIB_DEPENDS=    libgif.so:graphics/giflib
GIF_VARS=       FORCE_REQUIRE+=GIFLIB
GIF_VARS_OFF=       FORCE_IGNORE+=GIFLIB
GSTREAMER_USE=      GNOME=glib20 GSTREAMER1=yes
GSTREAMER_VARS=     FORCE_REQUIRE+=GStreamer
GSTREAMER_VARS_OFF= FORCE_IGNORE+=GStreamer
GSTREAMER_BROKEN=   fails when linking gstreamer plugin, with error cannot find -lgstreamer-1.0
GTA_LIB_DEPENDS=    libgta.so:devel/libgta
GTA_VARS=       FORCE_REQUIRE+=GTA
GTA_VARS_OFF=       FORCE_IGNORE+=GTA
INVENTOR_LIB_DEPENDS=   libInventor.so:graphics/inventor
INVENTOR_VARS=      FORCE_REQUIRE+=Inventor
INVENTOR_VARS_OFF=  FORCE_IGNORE+=Inventor
JASPER_LIB_DEPENDS= libjasper.so:graphics/jasper
JASPER_VARS=        FORCE_REQUIRE+=Jasper
JASPER_VARS_OFF=    FORCE_IGNORE+=Jasper
LIBLAS_LIB_DEPENDS= liblas.so:devel/liblas
LIBLAS_VARS=        FORCE_REQUIRE+=LIBLAS
LIBLAS_VARS_OFF=    FORCE_IGNORE+=LIBLAS
LUA_USES=       lua:52
LUA_CMAKE_ON=       -DOSG_USE_LOCAL_LUA_SOURCE:BOOL=OFF
LUA_VARS=       FORCE_IGNORE+=Lua51 FORCE_REQUIRE+=Lua52
LUA_VARS_OFF=       FORCE_IGNORE+="Lua51 Lua52"
NVTT_LIB_DEPENDS=   libnvtt.so:graphics/nvidia-texture-tools
NVTT_VARS=      FORCE_REQUIRE+=NVTT
NVTT_VARS_OFF=      FORCE_IGNORE+=NVTT
OPENEXR_LIB_DEPENDS=    libIlmImf.so:graphics/OpenEXR
OPENEXR_VARS=       FORCE_REQUIRE+=OpenEXR
OPENEXR_VARS_OFF=   FORCE_IGNORE+=OpenEXR
PDF_LIB_DEPENDS=    libpoppler-glib.so:graphics/poppler-glib
PDF_USE=        gnome=cairo
PDF_VARS=       FORCE_REQUIRE+=Poppler-glib
PDF_VARS_OFF=       FORCE_IGNORE+=Poppler-glib
QT4_USE=        qt4=corelib,gui,moc_build,opengl,qmake_build,rcc_build,uic_build
QT4_CMAKE_ON=       -DDESIRED_QT_VERSION=4
QT4_VARS=       FORCE_REQUIRE+=Qt4
QT4_VARS_OFF=       FORCE_IGNORE+=Qt4
QT5_USE=        qt5=buildtools_build,core,gui,opengl,qmake_build,webkit
QT5_CMAKE_ON=       -DDESIRED_QT_VERSION=5
QT5_VARS=       FORCE_REQUIRE+="Qt5Widgets Qt5WebKitWidgets"
QT5_VARS_OFF=       FORCE_IGNORE+="Qt5Widgets Qt5WebKitWidgets"
SDL_USE=        sdl=sdl
SDL_VARS=       FORCE_REQUIRE+=SDL
SDL_VARS_OFF=       FORCE_IGNORE+=SDL
SVG_LIB_DEPENDS=    librsvg-2.so:graphics/librsvg2
SVG_USE=        gnome=cairo
SVG_VARS=       FORCE_REQUIRE+=RSVG
SVG_VARS_OFF=       FORCE_IGNORE+=RSVG
VNC_LIB_DEPENDS=    libvncserver.so:net/libvncserver
VNC_VARS=       FORCE_REQUIRE+=LibVNCServer
VNC_VARS_OFF=       FORCE_IGNORE+=LibVNCServer
XINE_LIB_DEPENDS=   libxine.so:multimedia/libxine
XINE_VARS=      FORCE_REQUIRE+=Xine
XINE_VARS_OFF=      FORCE_IGNORE+=Xine
XRANDR_CMAKE_ON=    -DOSGVIEWER_USE_XRANDR:BOOL=ON
XRANDR_CMAKE_OFF=   -DOSGVIEWER_USE_XRANDR:BOOL=OFF
XRANDR_USE=     xorg=xrandr

# GUI toolkits are only needed for building examples, which are not even installed
FORCE_IGNORE=   FLTK GLUT FOX Qt3 wxWidgets OpenAL GtkGl SDL2   # only for examples
FORCE_IGNORE+=  COLLADA Performer OurDCMTK XUL FBX      # not in ports
FORCE_IGNORE+=  OpenVRML                    # ports version too old
FORCE_IGNORE+=  ITK                     # ports version doesn't build on 10.x
FORCE_REQUIRE=  Threads OpenGL X11 JPEG PNG TIFF ZLIB       # common & lightweight

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MQT4} || ${PORT_OPTIONS:MQT5}
CMAKE_ARGS+=        -DOSG_USE_QT:BOOL=ON
PLIST_SUB+=     QT=""
.else
CMAKE_ARGS+=        -DOSG_USE_QT:BOOL=OFF
PLIST_SUB+=     QT="@comment "
.endif

post-patch:
    @${FIND} ${WRKSRC}/CMakeModules -type f -print0 | ${XARGS} -0 \
        ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g'
    @${REINPLACE_CMD} -e '/FIND_LIBRARY.*DL_LIBRARY/ d' \
        ${WRKSRC}/CMakeLists.txt
.for p in ${FORCE_REQUIRE}
    @${REINPLACE_CMD} -e '/FIND_PACKAGE.*${p}/ s|)$$| REQUIRED&|' \
        ${WRKSRC}/CMakeLists.txt
.endfor
.for p in ${FORCE_IGNORE}
    @${REINPLACE_CMD} -e '/FIND_PACKAGE.*${p}/ s|^|#|' \
        ${WRKSRC}/CMakeLists.txt
.endfor

.include <bsd.port.mk>