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

Contents of /sci-geosciences/grass/grass-6.4.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Tue Jul 2 08:59:53 2013 UTC (6 years, 7 months ago) by ago
Branch: MAIN
Changes since 1.7: +2 -2 lines
Stable for x86, wrt bug #464568

(Portage version: 2.1.12.9/cvs/Linux x86_64, RepoMan options: --include-arches="x86", signed Manifest commit with key 7194459F)

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

  ViewVC Help
Powered by ViewVC 1.1.20