Ticket #189: opensg-1.8.ebuild

File opensg-1.8.ebuild, 3.8 KB (added by shaegler, 10 years ago)

ebuild for final opensg 1.8 release

Line 
1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3# $Header: $
4
5inherit eutils
6
7DESCRIPTION="OpenSG is a portable scenegraph system to create realtime graphics programs, e.g. for virtual reality applications."
8HOMEPAGE="http://www.opensg.org"
9LICENSE="LGPL-2"
10
11SRC_URI="http://superb-east.dl.sourceforge.net/sourceforge/opensg/opensg_dailybuild.070704.source.tgz"
12
13SLOT="1"
14KEYWORDS="~x86 ~amd64"
15
16# TODO: add use flags for distcc, qt4, tests
17IUSE="debug tiff png openexr gif cal3d jpeg qt3 cg tests doc"
18
19DEPEND="
20  virtual/opengl
21  virtual/glut
22  >=sys-libs/zlib-1.2.3-r1
23  tiff? ( >=media-libs/tiff-3.8.2-r2 )
24  png? ( >=media-libs/libpng-1.2.16 )
25  gif? ( >=media-libs/giflib-4.1.4 )
26  jpeg? ( >=media-libs/jpeg-6b-r7 )
27  openexr? ( media-libs/openexr )
28  cal3d? ( >=media-libs/cal3d-0.11.0-r1 )
29  qt3? ( >=x11-libs/qt-3.3.8 )
30  cg? ( >=media-gfx/nvidia-cg-toolkit-1.5.0 )
31  doc? ( >=app-doc/doxygen-1.4.2 )
32  doc? ( sci-visualization/gnuplot )
33  doc? ( media-gfx/imagemagick )
34  doc? ( media-gfx/transfig )
35"
36
37RDEPEND="${DEPEND}"
38
39#S="${WORKDIR}/${P}"
40
41# globally set the type of OpenSG to be build
42OSGTYPE="opt"
43if use debug ; then
44  OSGTYPE="dbg"
45fi
46
47src_unpack()
48{
49  unpack ${A}
50
51  # add scons modifications for the docs
52  cd ${WORKDIR}/OpenSG
53  epatch ${FILESDIR}/opensg_1.8_scons_doc_all.diff
54}
55
56src_compile()
57{
58  # setup scons options
59  osg_gif="0"
60  if use gif ; then
61    osg_gif="1"
62  fi
63
64  osg_png="0"
65  if use png ; then
66    osg_png="1"
67  fi
68
69  osg_tiff="0"
70  if use tiff ; then
71    osg_tiff="1"
72  fi
73
74  osg_jpeg="0"
75  if use jpeg ; then
76    osg_jpeg="1"
77  fi
78
79  osg_cal3d="0"
80  if use cal3d ; then
81    osg_cal3d="/usr"
82  fi
83
84  osg_qt3="0"
85  if use qt3 ; then
86    osg_qt3="/usr/qt/3"
87  fi
88
89  osg_cgchunk="0"
90  osg_cg="0"
91  osg_cgfxmaterial2="0"
92  osg_cg="0"
93  if use cg ; then
94    elog "Nvidia Cg support is currently disabled. i'm sorry."
95    #osg_cg="/usr"
96    #osg_cgchunk="1"
97    #osg_cgfxmaterial2="1"
98  fi
99
100  osg_tests="0"
101  if use tests ; then
102    osg_tests="1"
103  fi
104
105  osg_doc="0"
106  if use doc ; then
107    osg_doc="1"
108  fi
109 
110
111  # call scons (this customized scons is part of the opensg package)
112  cd ${WORKDIR}/OpenSG
113  ./scons ${MAKEOPTS} \
114    type=${OSGTYPE} \
115    gif=${osg_gif} \
116    tif=${osg_tiff} \
117    png=${osg_png} \
118    jpg=${osg_jpeg} \
119    qt=${osg_qt3} \
120    contrib_cal3d=${osg_cal3d} \
121    cg=${osg_cg} \
122    contrib_cgchunk=${osg_cgchunk} \
123    contrib_cgfxmaterial2=${osg_cgfxmaterial2} \
124    tests=${osg_tests} \
125    userdocs=${osg_doc} \
126    || die \
127    "!!! Please add ${S}/config.log when filing bugs reports to bugs.gentoo.org"
128}
129
130
131src_install()
132{
133  osg_install="OpenSG/Build/linux-gcc/installed"
134
135  # install tool binaries
136  exeinto /usr/bin
137  doexe ${WORKDIR}/${osg_install}/lib/${OSGTYPE}/fcdCompile
138  doexe ${WORKDIR}/${osg_install}/lib/${OSGTYPE}/runGraphOp
139  doexe ${WORKDIR}/${osg_install}/lib/${OSGTYPE}/proxyBuilder
140
141  if use qt3 ; then
142    doexe ${WORKDIR}/${osg_install}/lib/${OSGTYPE}/fcdEdit
143    doexe ${WORKDIR}/${osg_install}/lib/${OSGTYPE}/osgSceneViewer
144  fi
145
146  # install libraries
147  dolib.so ${WORKDIR}/${osg_install}/lib/${OSGTYPE}/*.so
148
149  # install headers
150  # the headers are split into two commands
151  insinto /usr/include/OpenSG
152  doins ${WORKDIR}/${osg_install}/include/OpenSG/*.inl
153  doins ${WORKDIR}/${osg_install}/include/OpenSG/OSG[0-9A-Ma-m]*.h
154  doins ${WORKDIR}/${osg_install}/include/OpenSG/OSG[N-Zn-z]*.h
155
156  # install tutorials
157  exeinto /usr/share/${PN}/tutorials
158  doexe ${WORKDIR}/${osg_install}/Tutorials/*
159  insinto /usr/share/${PN}/tutorials
160  doins ${WORKDIR}/OpenSG/Tutorials/*.cpp
161  doins ${WORKDIR}/OpenSG/Tutorials/Makefile
162
163  # install documentation
164  if use doc ; then
165    cd ${WORKDIR}/OpenSG/Doc/Code/user/html;
166    for i in $( ls ); do
167      dodoc ${i};
168    done
169    #dodoc ${WORKDIR}/OpenSG/Doc/Code/user/html/*
170  fi
171}