/[gentoo-x86]/sci-geosciences/grass/grass-6.4.0_rc6.ebuild
Gentoo

Contents of /sci-geosciences/grass/grass-6.4.0_rc6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Sat Sep 4 02:29:11 2010 UTC (9 years, 4 months ago) by nerdboy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
Updated to official 6.4.0 release and removed old rc releases/patches.
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-geosciences/grass/grass-6.4.0_rc6.ebuild,v 1.10 2010/06/17 21:03:51 patrick Exp $
4
5 EAPI="3"
6
7 PYTHON_DEPEND="python? 2"
8 inherit eutils python gnome2 multilib versionator wxwidgets base
9
10 MY_PM=${PN}$(get_version_component_range 1-2 ${PV})
11 MY_PM=${MY_PM/.}
12 MY_P=${P/_rc/RC}
13
14 DESCRIPTION="A free GIS with raster and vector functionality, as well as 3D vizualization."
15 HOMEPAGE="http://grass.osgeo.org//"
16 SRC_URI="http://grass.osgeo.org/${MY_PM}/source/${MY_P}.tar.gz"
17
18 LICENSE="GPL-2"
19 SLOT="6"
20 KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
21
22 IUSE="X cairo cxx ffmpeg fftw gmath jpeg largefile motif mysql nls odbc opengl png postgres python readline sqlite tiff truetype wxwidgets"
23
24 TCL_DEPS="
25 >=dev-lang/tcl-8.5
26 >=dev-lang/tk-8.5
27 "
28
29 RDEPEND="
30 sci-libs/gdal
31 sci-libs/proj
32 sys-libs/gdbm
33 sys-libs/ncurses
34 sys-libs/zlib
35 cairo? ( x11-libs/cairo[X?,opengl?] )
36 ffmpeg? ( media-video/ffmpeg )
37 fftw? ( sci-libs/fftw:3.0 )
38 gmath? (
39 virtual/blas
40 virtual/lapack
41 )
42 jpeg? ( media-libs/jpeg )
43 mysql? ( dev-db/mysql )
44 odbc? ( dev-db/unixODBC )
45 png? ( media-libs/libpng )
46 postgres? (
47 || (
48 >=dev-db/postgresql-base-8.4
49 >=dev-db/postgresql-server-8.4
50 )
51 )
52 readline? ( sys-libs/readline )
53 sqlite? ( dev-db/sqlite:3 )
54 tiff? ( media-libs/tiff )
55 truetype? ( media-libs/freetype:2 )
56 X? (
57 x11-libs/libICE
58 x11-libs/libSM
59 x11-libs/libX11
60 x11-libs/libXaw
61 x11-libs/libXext
62 x11-libs/libXmu
63 x11-libs/libXp
64 x11-libs/libXpm
65 x11-libs/libXt
66 motif? (
67 x11-libs/openmotif
68 opengl? ( media-libs/mesa[motif] )
69 )
70 opengl? (
71 virtual/opengl
72 ${TCL_DEPS}
73 )
74 python? ( wxwidgets? ( >=dev-python/wxpython-2.8.10.1 ) )
75 !python? ( ${TCL_DEPS} )
76 !wxwidgets? ( ${TCL_DEPS} )
77 )
78 "
79
80 DEPEND="${RDEPEND}
81 dev-util/pkgconfig
82 sys-devel/flex
83 sys-devel/gettext
84 sys-devel/bison
85 X? (
86 x11-proto/xextproto
87 x11-proto/xproto
88 python? ( wxwidgets? ( dev-lang/swig ) )
89 )"
90
91 S="${WORKDIR}/${MY_P}"
92
93 PATCHES=(
94 "${FILESDIR}/${PN}-pkgconf.patch"
95 )
96
97 pkg_setup() {
98 local myblas
99
100 # check correct gmath profiles (this must sadly die)
101 if use gmath; then
102 for d in $(eselect lapack show); do myblas=${d}; done
103 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
104 ewarn "You need to set lapack to atlas or reference. Do:"
105 ewarn " eselect lapack set <impl>"
106 ewarn "where <impl> is atlas, threaded-atlas or reference"
107 die "setup failed"
108 fi
109 for d in $(eselect blas show); do myblas=${d}; done
110 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
111 ewarn "You need to set blas to atlas or reference. Do:"
112 ewarn " eselect blas set <impl>"
113 ewarn "where <impl> is atlas, threaded-atlas or reference"
114 die "setup failed"
115 fi
116 fi
117
118 # check useflag nesting.
119 use motif && ! use X && ewarn "For motif support X useflag must be enabled"
120 use opengl && ! use X && ewarn "For opengl support X useflag must be enabled"
121 use wxwidgets && ! use X && ewarn "For wxwidgets support X useflag must be enabled"
122 use wxwidgets && ! use python && ewarn "For wxwidgets support python useflag must be enabled"
123
124 if use python; then
125 # only py2 is supported
126 python_set_active_version 2
127 fi
128 }
129
130 src_prepare() {
131 if ! use opengl; then
132 epatch "${FILESDIR}"/${P}-html-nonviz.patch
133 fi
134
135 base_src_prepare
136 }
137
138 src_configure() {
139 local myconf TCL_LIBDIR
140
141 if use X; then
142 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.5"
143 myconf+="
144 --with-tcltk-libs=${TCL_LIBDIR}
145 $(use_with motif)
146 $(use_with opengl)
147 --with-x
148 "
149
150 if use python && use wxwidgets; then
151 WX_BUILD=yes
152 WX_GTK_VER=2.8
153 need-wxwidgets base
154 myconf+="
155 --without-tcltk
156 --with-wxwidgets=${WX_CONFIG}
157 "
158 else
159 WX_BUILD=no
160 # use tcl gui if wxwidgets are disabled
161
162 myconf+="
163 --with-tcltk
164 --without-wxwidgets
165 "
166 fi
167
168 use opengl && myconf+=" --with-tcltk"
169 use motif && use opengl && myconf+=" --with-glw"
170 use motif || myconf+=" --without-glw"
171 else
172 myconf+="
173 --without-opengl
174 --without-glw
175 --without-tcltk
176 --without-wxwidgets
177 --without-x
178 "
179 fi
180
181 econf \
182 --with-gdal=$(type -P gdal-config) \
183 --with-curses \
184 --with-proj \
185 --with-proj-share="/usr/share/proj/" \
186 --without-glw \
187 --enable-shared \
188 $(use_enable amd64 64bit) \
189 $(use_enable ppc64 64bit) \
190 $(use_with cairo) \
191 $(use_with cxx) \
192 $(use_with fftw) \
193 $(use_with ffmpeg) \
194 --with-ffmpeg-includes="/usr/include/libavcodec \
195 /usr/include/libavdevice /usr/include/libavfilter \
196 /usr/include/libavformat /usr/include/libavutil \
197 /usr/include/libpostproc /usr/include/libswscale" \
198 $(use_with gmath blas) \
199 $(use_with gmath lapack) \
200 $(use_with jpeg) \
201 $(use_enable largefile) \
202 $(use_with mysql) \
203 --with-mysql-includes=/usr/include/mysql \
204 --with-mysql-libs=/usr/$(get_libdir)/mysql \
205 $(use_with nls) \
206 $(use_with odbc) \
207 $(use_with png) \
208 $(use_with postgres) \
209 $(use_with python) \
210 $(use_with readline) \
211 $(use_with sqlite) \
212 $(use_with tiff) \
213 $(use_with truetype freetype) \
214 --with-freetype-includes="/usr/include/freetype2/" \
215 ${myconf}
216 }
217
218 src_compile() {
219 # we don't want to link against embeded mysql lib
220 base_src_compile MYSQLDLIB=""
221 }
222
223 src_install() {
224 emake DESTDIR="${D}" \
225 INST_DIR="${D}"/usr/${MY_PM} \
226 prefix="${D}"/usr BINDIR="${D}"/usr/bin \
227 PREFIX="${D}"/usr/ \
228 install || die
229
230 pushd "${D}"/usr/${MY_PM} &> /dev/null
231
232 # fix docs
233 dodoc AUTHORS CHANGES || die
234 dohtml -r docs/html/* || die
235 rm -rf docs/ || die
236 rm -rf {AUTHORS,CHANGES,COPYING,GPL.TXT,REQUIREMENTS.html} || die
237
238 # manuals
239 dodir /usr/share/man/man1 || die
240 mv man/man1/* "${D}"/usr/share/man/man1/ || die
241 rm -rf man/ || die
242
243 # translations
244 if use nls; then
245 dodir /usr/share/locale/ || die
246 mv locale/* "${D}"/usr/share/locale/ || die
247 rm -rf locale/ || die
248 # pt_BR is broken
249 mv "${D}"/usr/share/locale/pt_br "${D}"/usr/share/locale/pt_BR || die
250 fi
251
252 popd &> /dev/null
253
254 # place libraries where they belong
255 mv "${D}"/usr/${MY_PM}/lib/ "${D}"/usr/$(get_libdir)/ || die
256
257 # place header files where they belong
258 mv "${D}"/usr/${MY_PM}/include/ "${D}"/usr/include/ || die
259 # make rules are not required on installed system
260 rm -rf "${D}"/usr/include/Make || die
261
262 # mv remaining gisbase stuff to libdir
263 mv "${D}"/usr/${MY_PM} "${D}"/usr/$(get_libdir) || die
264
265 # set proper default window renderer
266 if [[ ${WX_BUILD} == yes ]]; then
267 sed -i \
268 -e "1,\$s:^DEFAULT_GUI.*:DEFAULT_GUI=\"wxpython\":" \
269 "${D}"/usr/$(get_libdir)/${MY_PM}/etc/Init.sh || die
270 fi
271
272 # get proper folder for grass path in script
273 sed -i \
274 -e "1,\$s:^GISBASE.*:GISBASE=/usr/$(get_libdir)/${MY_PM}:" \
275 "${D}"usr/bin/${MY_PM} || die
276
277 # get proper fonts path for fontcap
278 sed -i \
279 -e "s|${D}/usr/${MY_PM}|/usr/$(get_libdir)/${MY_PM}|" \
280 "${D}"/usr/$(get_libdir)/${MY_PM}/etc/fontcap || die
281
282 if use X; then
283 generate_files
284 doicon gui/icons/${PN}-48x48.png || die
285 domenu ${MY_PM}-grass.desktop || die
286 fi
287
288 # install .pc file so other apps know where to look for grass
289 insinto /usr/$(get_libdir)/pkgconfig/
290 doins grass.pc || die
291
292 # fix weird +x on tcl scripts
293 find "${D}" -name "*.tcl" -exec chmod +r-x '{}' \;
294 }
295
296 pkg_postinst() {
297 if use X; then
298 fdo-mime_desktop_database_update
299 gnome2_icon_cache_update
300 fi
301 }
302
303 pkg_postrm() {
304 if use X; then
305 fdo-mime_desktop_database_update
306 gnome2_icon_cache_update
307 fi
308 }
309
310 generate_files() {
311 local GUI="-gui"
312 [[ ${WX_BUILD} == yes ]] && GUI="-wxpython"
313
314 cat <<-EOF > ${MY_PM}-grass.desktop
315 [Desktop Entry]
316 Encoding=UTF-8
317 Version=1.0
318 Name=Grass ${PV}
319 Type=Application
320 Comment=GRASS (Geographic Resources Analysis Support System), the original GIS.
321 Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI}
322 Path=
323 Icon=${PN}-48x48.png
324 Categories=Science;Education;
325 Terminal=false
326 EOF
327 }

  ViewVC Help
Powered by ViewVC 1.1.20