/[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.5 - (show annotations) (download)
Thu Jan 17 20:55:37 2013 UTC (7 years, 1 month ago) by aballier
Branch: MAIN
Changes since 1.4: +4 -3 lines
Fix build with latest ffmpeg. Part of bug #443264. Note: this patches configure directly to avoid having to autoreconf it.

(Portage version: 2.2.0_alpha154/cvs/Linux x86_64, signed Manifest commit with key 160F534A)

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.4 2012/10/24 19:38:26 ulm 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-0.10 )
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/motif-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 "${FILESDIR}"/${PN}-6.4.2-ffmpeg-1.patch
96 )
97
98 REQUIRED_USE="
99 motif? ( X )
100 opengl? ( X )
101 wxwidgets? ( X python )
102 "
103
104 pkg_setup() {
105 local myblas
106
107 # check correct gmath profiles (this must sadly die)
108 if use gmath; then
109 for d in $(eselect lapack show); do myblas=${d}; done
110 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
111 ewarn "You need to set lapack to atlas or reference. Do:"
112 ewarn " eselect lapack set <impl>"
113 ewarn "where <impl> is atlas, threaded-atlas or reference"
114 die "setup failed"
115 fi
116 for d in $(eselect blas show); do myblas=${d}; done
117 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
118 ewarn "You need to set blas to atlas or reference. Do:"
119 ewarn " eselect blas set <impl>"
120 ewarn "where <impl> is atlas, threaded-atlas or reference"
121 die "setup failed"
122 fi
123 fi
124
125 if use python; then
126 # only py2 is supported
127 python_set_active_version 2
128 fi
129 }
130
131 src_prepare() {
132 use opengl || epatch "${FILESDIR}"/${PN}-6.4.0-html-nonviz.patch
133 base_src_prepare
134 }
135
136 src_configure() {
137 local myconf TCL_LIBDIR
138
139 if use X; then
140 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.5"
141 myconf+="
142 --with-tcltk-libs=${TCL_LIBDIR}
143 $(use_with motif)
144 $(use_with opengl)
145 --with-x
146 "
147
148 use opengl && myconf+=" --with-tcltk"
149 use motif && use opengl && myconf+=" --with-glw"
150 use motif || myconf+=" --without-glw"
151
152 if use wxwidgets; then
153 WX_BUILD=yes
154 WX_GTK_VER=2.8
155 need-wxwidgets unicode
156 myconf+="
157 --without-tcltk
158 --with-wxwidgets=${WX_CONFIG}
159 "
160 else
161 WX_BUILD=no
162 # use tcl gui if wxwidgets are disabled
163 myconf+="
164 --with-tcltk
165 --without-wxwidgets
166 "
167 fi
168 else
169 myconf+="
170 --without-glw
171 --without-opengl
172 --without-tcltk
173 --without-wxwidgets
174 --without-x
175 "
176 fi
177
178 econf \
179 --with-gdal=$(type -P gdal-config) \
180 --with-curses \
181 --with-proj \
182 --with-proj-share="/usr/share/proj/" \
183 --without-glw \
184 --enable-shared \
185 $(use_enable amd64 64bit) \
186 $(use_enable ppc64 64bit) \
187 $(use_with cairo) \
188 $(use_with cxx) \
189 $(use_with fftw) \
190 $(use_with ffmpeg) \
191 --with-ffmpeg-includes="/usr/include/libavcodec /usr/include/libavdevice /usr/include/libavfilter /usr/include/libavformat /usr/include/libavutil /usr/include/libpostproc /usr/include/libswscale" \
192 $(use_with gmath blas) \
193 $(use_with gmath lapack) \
194 $(use_with jpeg) \
195 $(use_with mysql) \
196 --with-mysql-includes=/usr/include/mysql \
197 --with-mysql-libs=/usr/$(get_libdir)/mysql \
198 $(use_with nls) \
199 $(use_with odbc) \
200 $(use_with png) \
201 $(use_with postgres) \
202 $(use_with python) \
203 $(use_with readline) \
204 $(use_with sqlite) \
205 $(use_with tiff) \
206 $(use_with truetype freetype) \
207 --with-freetype-includes="/usr/include/freetype2/" \
208 --enable-largefile \
209 ${myconf}
210 }
211
212 src_compile() {
213 # we don't want to link against embeded mysql lib
214 base_src_compile MYSQLDLIB=""
215 }
216
217 src_install() {
218 emake DESTDIR="${D}" \
219 INST_DIR="${D}"/usr/${MY_PM} \
220 prefix="${D}"/usr BINDIR="${D}"/usr/bin \
221 PREFIX="${D}"/usr/ \
222 install
223
224 pushd "${ED}"/usr/${MY_PM} &> /dev/null
225
226 # fix docs
227 dodoc AUTHORS CHANGES
228 dohtml -r docs/html/*
229 rm -rf docs/ || die
230 rm -rf {AUTHORS,CHANGES,COPYING,GPL.TXT,REQUIREMENTS.html} || die
231
232 # manuals
233 dodir /usr/share/man/man1
234 mv man/man1/* "${ED}"/usr/share/man/man1/ || die
235 rm -rf man/ || die
236 mv -vf "${ED}"/usr/share/man/man1/sql.1{,grass} || die #381599
237
238 # translations
239 if use nls; then
240 dodir /usr/share/locale/
241 mv locale/* "${ED}"/usr/share/locale/ || die
242 rm -rf locale/ || die
243 # pt_BR is broken
244 mv "${ED}"/usr/share/locale/pt_br "${ED}"/usr/share/locale/pt_BR || die
245 fi
246
247 popd &> /dev/null
248
249 # place libraries where they belong
250 mv "${ED}"/usr/${MY_PM}/lib/ "${ED}"/usr/$(get_libdir)/ || die
251
252 # place header files where they belong
253 mv "${ED}"/usr/${MY_PM}/include/ "${ED}"/usr/include/ || die
254 # make rules are not required on installed system
255 rm -rf "${ED}"/usr/include/Make || die
256
257 # mv remaining gisbase stuff to libdir
258 mv "${ED}"/usr/${MY_PM} "${ED}"/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 "${ED}"/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 "${ED}"usr/bin/${MY_PM} || die
271
272 # get proper fonts path for fontcap
273 sed -i \
274 -e "s|${ED}/usr/${MY_PM}|${EPREFIX}usr/$(get_libdir)/${MY_PM}|" \
275 "${ED}"/usr/$(get_libdir)/${MY_PM}/etc/fontcap || die
276
277 if use X; then
278 generate_files
279 doicon gui/icons/${PN}-48x48.png
280 domenu ${MY_PM}-grass.desktop
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
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