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

Contents of /sci-geosciences/grass/grass-6.4.1-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Mon Jan 6 14:58:08 2014 UTC (6 years, 1 month ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
sci-geosciences/grass: Drop old; punt base.eclass

(Portage version: 2.2.8/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)

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.1-r1.ebuild,v 1.5 2012/10/24 19:38:26 ulm 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? ( >=dev-db/postgresql-base-8.4 )
47 readline? ( sys-libs/readline )
48 sqlite? ( dev-db/sqlite:3 )
49 tiff? ( media-libs/tiff )
50 truetype? ( media-libs/freetype:2 )
51 X? (
52 x11-libs/libICE
53 x11-libs/libSM
54 x11-libs/libX11
55 x11-libs/libXaw
56 x11-libs/libXext
57 x11-libs/libXmu
58 x11-libs/libXp
59 x11-libs/libXpm
60 x11-libs/libXt
61 motif? (
62 >=x11-libs/motif-2.3:0
63 opengl? (
64 || (
65 media-libs/mesa[motif]
66 ( media-libs/mesa x11-libs/libGLw ) ) )
67 )
68 opengl? (
69 virtual/opengl
70 ${TCL_DEPS}
71 )
72 python? ( wxwidgets? ( >=dev-python/wxpython-2.8.10.1[cairo,opengl?] ) )
73 !python? ( ${TCL_DEPS} )
74 !wxwidgets? ( ${TCL_DEPS} )
75 )"
76
77 DEPEND="${RDEPEND}
78 virtual/pkgconfig
79 sys-devel/flex
80 sys-devel/gettext
81 sys-devel/bison
82 X? (
83 x11-proto/xextproto
84 x11-proto/xproto
85 python? ( wxwidgets? ( dev-lang/swig ) )
86 )"
87
88 S="${WORKDIR}/${MY_P}"
89
90 PATCHES=(
91 "${FILESDIR}"/${PN}-pkgconf.patch
92 "${FILESDIR}"/${P}-libpng15.patch
93 "${FILESDIR}"/${P}-nopycompile.patch
94 "${FILESDIR}"/${P}-timer_flags.patch
95 "${FILESDIR}"/${P}-libav-0.8.patch
96 )
97
98 pkg_setup() {
99 local myblas
100
101 # check correct gmath profiles (this must sadly die)
102 if use gmath; then
103 for d in $(eselect lapack show); do myblas=${d}; done
104 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
105 ewarn "You need to set lapack to atlas or reference. Do:"
106 ewarn " eselect lapack set <impl>"
107 ewarn "where <impl> is atlas, threaded-atlas or reference"
108 die "setup failed"
109 fi
110 for d in $(eselect blas show); do myblas=${d}; done
111 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
112 ewarn "You need to set blas to atlas or reference. Do:"
113 ewarn " eselect blas set <impl>"
114 ewarn "where <impl> is atlas, threaded-atlas or reference"
115 die "setup failed"
116 fi
117 fi
118
119 # check useflag nesting.
120 use motif && ! use X && ewarn "For motif support X useflag must be enabled"
121 use opengl && ! use X && ewarn "For opengl support X useflag must be enabled"
122 use wxwidgets && ! use X && ewarn "For wxwidgets support X useflag must be enabled"
123 use wxwidgets && ! use python && ewarn "For wxwidgets support python useflag must be enabled"
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 if use python && use wxwidgets; then
149 WX_BUILD=yes
150 WX_GTK_VER=2.8
151 need-wxwidgets unicode
152 myconf+="
153 --without-tcltk
154 --with-wxwidgets=${WX_CONFIG}
155 "
156 else
157 WX_BUILD=no
158 # use tcl gui if wxwidgets are disabled
159 myconf+="
160 --with-tcltk
161 --without-wxwidgets
162 "
163 fi
164
165 use opengl && myconf+=" --with-tcltk"
166 use motif && use opengl && myconf+=" --with-glw"
167 use motif || myconf+=" --without-glw"
168 else
169 myconf+="
170 --without-opengl
171 --without-glw
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 || die
223
224 pushd "${D}"/usr/${MY_PM} &> /dev/null
225
226 # fix docs
227 dodoc AUTHORS CHANGES || die
228 dohtml -r docs/html/* || die
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 || die
234 mv man/man1/* "${D}"/usr/share/man/man1/ || die
235 rm -rf man/ || die
236 mv -vf "${D}"/usr/share/man/man1/sql.1{,grass} || die #381599
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