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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Feb 17 16:48:21 2010 UTC (10 years ago) by scarabeus
Branch: MAIN
Changes since 1.1: +57 -52 lines
Slightly update grass ebuild. Synced with sci overlay + whitespace cleanup.
(Portage version: 2.2_rc62/cvs/Linux x86_64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="2"
6
7 inherit eutils distutils fdo-mime versionator wxwidgets
8
9 MY_PV=$(get_version_component_range 1-2 ${PV})
10 MY_PVM=$(delete_all_version_separators ${MY_PV})
11 MY_PM=${PN}${MY_PVM}
12 MY_P=${PN}-$(get_version_component_range 1-3 ${PV})RC5
13
14 DESCRIPTION="A free GIS with raster and vector functionality, as well as 3D vizualization."
15 HOMEPAGE="http://grass.osgeo.org//"
16 SRC_URI="http://grass.osgeo.org/${MY_PM}/source/${MY_P}.tar.gz"
17
18 LICENSE="GPL-2"
19 SLOT="6"
20 KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
21
22 IUSE="X ffmpeg fftw gmath jpeg largefile motif mysql nls odbc opengl png
23 postgres python readline sqlite tiff truetype wxwindows"
24
25 RESTRICT="strip"
26
27 RDEPEND=">=sys-libs/zlib-1.1.4
28 >=sys-libs/ncurses-5.3
29 >=sys-libs/gdbm-1.8.0
30 || (
31 sys-apps/man
32 sys-apps/man-db
33 )
34 sci-libs/gdal
35 >=sci-libs/proj-4.4.7
36 ffmpeg? ( media-video/ffmpeg )
37 fftw? ( sci-libs/fftw )
38 gmath? (
39 virtual/blas
40 virtual/lapack
41 )
42 jpeg? ( media-libs/jpeg )
43 mysql? ( dev-db/mysql )
44 odbc? ( >=dev-db/unixODBC-2.0.6 )
45 opengl? ( virtual/opengl )
46 motif? ( x11-libs/openmotif )
47 png? ( >=media-libs/libpng-1.2.2 )
48 postgres? (
49 || (
50 >=virtual/postgresql-base-8.0
51 >=virtual/postgresql-server-8.0
52 )
53 )
54 python? ( dev-lang/python )
55 readline? ( sys-libs/readline )
56 sqlite? ( dev-db/sqlite )
57 tiff? ( >=media-libs/tiff-3.5.7 )
58 truetype? ( >=media-libs/freetype-2.0 )
59 wxwindows? (
60 >=dev-python/wxpython-2.8.1.1
61 >=dev-lang/python-2.4
62 )
63 X? (
64 x11-libs/libXmu
65 x11-libs/libXext
66 x11-libs/libXp
67 x11-libs/libX11
68 x11-libs/libXt
69 x11-libs/libSM
70 x11-libs/libICE
71 x11-libs/libXpm
72 x11-libs/libXaw
73 >=dev-lang/tcl-8.4
74 >=dev-lang/tk-8.4
75 )"
76
77 DEPEND="${RDEPEND}
78 >=sys-devel/flex-2.5.4a
79 >=sys-devel/bison-1.35
80 wxwindows? ( >=dev-lang/swig-1.3.31 )
81 X? (
82 x11-proto/xproto
83 x11-proto/xextproto
84 )"
85
86 S=${WORKDIR}/${MY_P}
87
88 pkg_setup() {
89 local myblas
90 elog ""
91 elog "This version enables the experimental wxpython interface, which"
92 elog "you may want to try. If the legacy GUI seems a little wonky in"
93 elog "this version, just enable the wxwindows USE flag and rebuild"
94 elog "grass to use it."
95 elog ""
96 if use gmath; then
97 for d in $(eselect lapack show); do myblas=${d}; done
98 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
99 ewarn "You need to set lapack to atlas or reference. Do:"
100 ewarn " eselect lapack set <impl>"
101 ewarn "where <impl> is atlas, threaded-atlas or reference"
102 die "setup failed"
103 fi
104 for d in $(eselect blas show); do myblas=${d}; done
105 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
106 ewarn "You need to set blas to atlas or reference. Do:"
107 ewarn " eselect blas set <impl>"
108 ewarn "where <impl> is atlas, threaded-atlas or reference"
109 die "setup failed"
110 fi
111 fi
112
113 if use opengl && ! use X; then
114 ewarn "GRASS OpenGL support needs X (will also pull in Tcl/Tk)."
115 die "Please set the X useflag."
116 fi
117 }
118
119 src_prepare() {
120 epatch rpm/fedora/grass-readline.patch
121
122 sed -i -e "s:buff\[12:buff\[16:g" general/g.parser/main.c \
123 || die "sed failed"
124
125 if ! use opengl; then
126 epatch "${FILESDIR}"/${PN}-6.4.0-html-nonviz.patch
127 fi
128
129 # patch missing math functions (yes, this is still needed)
130 sed -i -e "s:\$(EXTRA_LIBS):\$(EXTRA_LIBS) \$(MATHLIB):g" include/Make/Shlib.make
131 echo "MATHLIB=-lm" >> include/Make/Rules.make
132 }
133
134 src_configure() {
135 local myconf
136 addpredict /var/cache/fontconfig
137 # wxwindows needs python (see bug #237495)
138 use wxwindows && distutils_python_version
139
140 myconf="--prefix=/usr --with-cxx --enable-shared \
141 --with-gdal=$(type -P gdal-config) --with-curses --with-proj \
142 --with-includes=/usr/include --with-libs=/usr/$(get_libdir) \
143 --with-proj-includes=/usr/include \
144 --with-proj-libs=/usr/$(get_libdir) \
145 --with-proj-share=/usr/share/proj \
146 --without-glw"
147
148 if use X; then
149 if has_version ">=dev-lang/tcl-8.5"; then
150 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.5"
151 else
152 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.4"
153 fi
154 myconf+=" --with-tcltk --with-x \
155 --with-tcltk-includes=/usr/include \
156 --with-tcltk-libs=${TCL_LIBDIR}"
157 if use wxwindows; then
158 WX_GTK_VER=2.8
159 need-wxwidgets unicode
160 myconf+=" --with-python --with-wxwidgets=${WX_CONFIG}"
161 else
162 # USE=python must be enabled above if wxwindows is enabled
163 myconf+=" $(use_with python) --without-wxwidgets"
164 fi
165 else
166 myconf+=" --without-tcltk --without-x"
167 fi
168
169 if use opengl; then
170 myconf+=" --with-opengl --with-opengl-libs=/usr/$(get_libdir)/opengl/xorg-x11/lib"
171 else
172 myconf+=" --without-opengl"
173 fi
174
175 if use truetype; then
176 myconf+=" --with-freetype
177 --with-freetype-includes=/usr/include/freetype2"
178 fi
179
180 if use mysql; then
181 myconf+=" --with-mysql --with-mysql-includes=/usr/include/mysql
182 --with-mysql-libs=/usr/$(get_libdir)/mysql"
183 else
184 myconf+=" --without-mysql"
185 fi
186
187 if use sqlite; then
188 myconf+=" --with-sqlite --with-sqlite-includes=/usr/include
189 --with-sqlite-libs=/usr/$(get_libdir)"
190 else
191 myconf+=" --without-sqlite"
192 fi
193
194 # Old ffmpeg is gone, but new is a pita with all those include dirs,
195 # thus, a rather funky configure...
196 if use ffmpeg; then
197 ffmlib_conf="--with-ffmpeg --with-ffmpeg-libs=/usr/$(get_libdir)"
198 else
199 myconf+=" --without-ffmpeg"
200 fi
201
202 myconf+=" --with-libs=/usr/$(get_libdir)
203 $(use_enable amd64 64bit)
204 $(use_with fftw)
205 $(use_with gmath blas)
206 $(use_with gmath lapack)
207 $(use_with jpeg)
208 $(use_enable largefile)
209 $(use_with motif)
210 $(use_with nls)
211 $(use_with odbc)
212 $(use_with png)
213 $(use_with postgres)
214 $(use_with readline)
215 $(use_with tiff)"
216
217 if use ffmpeg; then
218 "${S}"/configure ${myconf} ${ffmlib_conf} \
219 --with-ffmpeg-includes="/usr/include/libavcodec \
220 /usr/include/libavdevice /usr/include/libavfilter \
221 /usr/include/libavformat /usr/include/libavutil \
222 /usr/include/libpostproc /usr/include/libswscale" \
223 || die "ffmpeg configure failed!"
224 else
225 "${S}"/configure ${myconf} || die "configure failed!"
226 fi
227 }
228
229 src_compile() {
230 # looks like we no longer need the vdigit symlink build hack
231 emake -j1 || die "make failed!"
232 }
233
234 src_install() {
235 elog "Grass Home is ${MY_PM}"
236 make install UNIX_BIN="${D}"usr/bin BINDIR="${D}"usr/bin \
237 PREFIX="${D}"usr INST_DIR="${D}"usr/${MY_PM} \
238 || die "make install failed!"
239
240 # get rid of DESTDIR in script path
241 sed -i -e "s@${D}@/@" "${D}"usr/bin/${MY_PM}
242
243 # Grass Extension Manager conflicts with ruby gems
244 mv "${D}"usr/bin/gem "${D}"usr/${MY_PM}/bin/
245
246 ebegin "Adding env.d and desktop entry for Grass6..."
247 generate_files
248 doenvd 99grass-6
249 if use X; then
250 doicon "${FILESDIR}"/grass_icon.png
251 domenu ${MY_PM}-grass.desktop
252 fi
253 eend ${?}
254 }
255
256 pkg_postinst() {
257 use X && fdo-mime_desktop_database_update
258
259 elog "Note this version re-enables support for threads in Tcl and Tk."
260 elog "Enable the threads USE flag and rebuild to try it."
261 }
262
263 pkg_postrm() {
264 use X && fdo-mime_desktop_database_update
265 }
266
267 generate_files() {
268 local GUI="-gui"
269 use wxwindows && GUI="-wxpython"
270
271 cat <<-EOF > 99grass-6
272 GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib"
273 LDPATH="/usr/${MY_PM}/lib"
274 MANPATH="/usr/${MY_PM}/man"
275 GRASS_HOME="/usr/${MY_PM}"
276 EOF
277
278 cat <<-EOF > ${MY_PM}-grass.desktop
279 [Desktop Entry]
280 Encoding=UTF-8
281 Version=1.0
282 Name=Grass ${PV}
283 Type=Application
284 Comment=GRASS (Geographic Resources Analysis Support System), the original GIS.
285 Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI}
286 Path=
287 Icon=grass_icon.png
288 Categories=Science;Education;
289 Terminal=false
290 EOF
291 }

  ViewVC Help
Powered by ViewVC 1.1.20