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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Sat Jun 11 14:13:15 2011 UTC (8 years, 8 months ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
Grass is quite happy to use any tiff version that gdal suplies.

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

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

  ViewVC Help
Powered by ViewVC 1.1.20