/[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.2 - (show annotations) (download)
Thu May 24 19:33:27 2012 UTC (7 years, 9 months ago) by scarabeus
Branch: MAIN
Changes since 1.1: +1 -3 lines
Whitespace to shutup repoman.

(Portage version: 2.2.0_alpha107/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20