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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Jun 24 07:45:51 2008 UTC (11 years, 7 months ago) by nerdboy
Branch: MAIN
added latest release with wxpython gui support, QA fixes, etc
(Portage version: 2.1.5.5)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils distutils fdo-mime versionator wxwidgets
6
7 MY_PV=$(get_version_component_range 1-2 ${PV})
8 MY_PVM=$(delete_all_version_separators ${MY_PV})
9 MY_PM=${PN}${MY_PVM}
10
11 DESCRIPTION="An open-source GIS with raster and vector functionality, as well as 3D vizualization."
12 HOMEPAGE="http://grass.itc.it/"
13 SRC_URI="http://grass.itc.it/${MY_PM}/source/${P}.tar.gz"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
18
19 IUSE="ffmpeg fftw glw gmath jpeg largefile mysql nls odbc opengl png \
20 postgres python readline sqlite tiff truetype wxwindows X"
21
22 RESTRICT="strip"
23
24 RDEPEND=">=sys-libs/zlib-1.1.4
25 >=sys-libs/ncurses-5.3
26 >=sys-libs/gdbm-1.8.0
27 || (
28 sys-apps/man
29 sys-apps/man-db )
30 sci-libs/gdal
31 >=sci-libs/proj-4.4.7
32 ffmpeg? ( media-video/ffmpeg )
33 fftw? ( sci-libs/fftw )
34 gmath? ( virtual/blas
35 virtual/lapack )
36 jpeg? ( media-libs/jpeg )
37 mysql? ( dev-db/mysql )
38 odbc? ( >=dev-db/unixODBC-2.0.6 )
39 opengl? ( ( virtual/opengl )
40 ( x11-libs/openmotif )
41 glw? ( media-libs/mesa ) )
42 png? ( >=media-libs/libpng-1.2.2 )
43 postgres? ( >=dev-db/postgresql-7.3 )
44 python? ( dev-lang/python )
45 readline? ( sys-libs/readline )
46 sqlite? ( dev-db/sqlite )
47 tiff? ( >=media-libs/tiff-3.5.7 )
48 truetype? ( >=media-libs/freetype-2.0 )
49 wxwindows? (
50 >=dev-python/wxpython-2.8.1.1
51 >=dev-lang/python-2.4
52 )
53 X? (
54 x11-libs/libXmu
55 x11-libs/libXext
56 x11-libs/libXp
57 x11-libs/libX11
58 x11-libs/libXt
59 x11-libs/libSM
60 x11-libs/libICE
61 x11-libs/libXpm
62 x11-libs/libXaw
63 >=dev-lang/tcl-8.4
64 >=dev-lang/tk-8.4
65 )"
66
67 DEPEND="${RDEPEND}
68 >=sys-devel/flex-2.5.4a
69 >=sys-devel/bison-1.35
70 wxwindows? ( >=dev-lang/swig-1.3.31 )
71 X? (
72 x11-proto/xproto
73 x11-proto/xextproto
74 )"
75
76 pkg_setup() {
77 local myblas
78 elog ""
79 elog "This version enables the experimental wxpython interface, which"
80 elog "you may want to try, since the legacy GUI seems a little wonky"
81 elog "in this version; just enable the wxwindows USE flag and build."
82 elog ""
83 if use gmath; then
84 for d in $(eselect lapack show); do myblas=${d}; done
85 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
86 ewarn "You need to set lapack to atlas or reference. Do:"
87 ewarn " eselect lapack set <impl>"
88 ewarn "where <impl> is atlas, threaded-atlas or reference"
89 die "setup failed"
90 fi
91 for d in $(eselect blas show); do myblas=${d}; done
92 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
93 ewarn "You need to set blas to atlas or reference. Do:"
94 ewarn " eselect blas set <impl>"
95 ewarn "where <impl> is atlas, threaded-atlas or reference"
96 die "setup failed"
97 fi
98 fi
99
100 if use glw && ! use opengl; then
101 ewarn "You set USE='glw -opengl'. GLw support needs OpenGL."
102 ewarn "OpenGL support also requires X."
103 die "Set opengl and X useflags."
104 fi
105
106 if use glw && ! built_with_use media-libs/mesa motif; then
107 ewarn "GRASS GLw/OpenGL support needs mesa with motif headers."
108 ewarn "Please rebuild mesa with motif support."
109 die "Re-emerge mesa with motif."
110 fi
111
112 if use opengl && ! use X; then
113 ewarn "GRASS OpenGL support needs X (will also pull in Tcl/Tk)."
114 die "Please set the X useflag."
115 fi
116 }
117
118 src_unpack() {
119 unpack ${A}
120 cd "${S}"
121
122 epatch rpm/fedora/grass-readline.patch
123
124 if use opengl; then
125 epatch "${FILESDIR}"/${P}-html-nonviz.patch
126 fi
127
128 # patch missing math functions (yes, this is still needed)
129 sed -i -e "s:\$(EXTRA_LIBS):\$(EXTRA_LIBS) \$(MATHLIB):g" include/Make/Shlib.make
130 echo "MATHLIB=-lm" >> include/Make/Rules.make
131 }
132
133 src_compile() {
134 local myconf
135 use python || use wxindows && distutils_python_version
136
137 myconf="--prefix=/usr --with-cxx --enable-shared \
138 --with-gdal=$(type -P gdal-config) --with-curses --with-proj \
139 --with-includes=/usr/include --with-libs=/usr/$(get_libdir) \
140 --with-proj-includes=/usr/include \
141 --with-proj-libs=/usr/$(get_libdir) \
142 --with-proj-share=/usr/share/proj"
143
144 if use X; then
145 if has_version ">=dev-lang/tcl-8.5"; then
146 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.5"
147 else
148 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.4"
149 fi
150 myconf="${myconf} --with-tcltk --with-x \
151 --with-tcltk-includes=/usr/include \
152 --with-tcltk-libs=${TCL_LIBDIR}"
153 if use wxwindows; then
154 WX_GTK_VER=2.8
155 need-wxwidgets gtk2
156 LIBGDI="/usr/$(get_libdir)/python${PYVER}/site-packages/wx-2.8-gtk2-unicode/wx/_gdi_.so"
157 myconf="${myconf} --with-python --with-wxwidgets=${WX_CONFIG}"
158 fi
159 else
160 myconf="${myconf} --without-tcltk --without-x"
161 fi
162
163 if use opengl; then
164 myconf="${myconf} --with-opengl --with-opengl-libs=/usr/$(get_libdir)/opengl/xorg-x11/lib"
165 if use glw; then
166 myconf="${myconf} --with-glw"
167 fi
168 else
169 myconf="${myconf} --without-opengl --without-glw"
170 fi
171
172 # Should handle either older or latest without intervention;
173 # this won't work forever, but it should be okay for a while...
174 if use ffmpeg; then
175 myconf="${myconf} --with-ffmpeg \
176 --with-ffmpeg-libs=/usr/$(get_libdir)"
177 if has_version ">=media-video/ffmpeg-0.4.9_p20080326" ; then
178 # must pass multiple include dirs now; if you have a better
179 # way to do this, please speak up and file a bug :)
180 myconf="${myconf} --with-ffmpeg-includes=/usr/include/libav*"
181 else
182 myconf="${myconf} --with-ffmpeg-includes=/usr/include/ffmpeg"
183 fi
184 else
185 myconf="${myconf} --without-ffmpeg"
186 fi
187
188 if use truetype; then
189 myconf="${myconf} --with-freetype \
190 --with-freetype-includes=/usr/include/freetype2"
191 fi
192
193 if use mysql; then
194 myconf="${myconf} --with-mysql --with-mysql-includes=/usr/include/mysql \
195 --with-mysql-libs=/usr/$(get_libdir)/mysql"
196 else
197 myconf="${myconf} --without-mysql"
198 fi
199
200 if use sqlite; then
201 myconf="${myconf} --with-sqlite --with-sqlite-includes=/usr/include \
202 --with-sqlite-libs=/usr/$(get_libdir)"
203 else
204 myconf="${myconf} --without-sqlite"
205 fi
206
207 econf ${myconf} --with-libs=/usr/$(get_libdir) \
208 $(use_enable amd64 64bit) \
209 $(use_with fftw) \
210 $(use_with gmath blas) \
211 $(use_with gmath lapack) \
212 $(use_with jpeg) \
213 $(use_enable largefile) \
214 $(use_with opengl motif) \
215 $(use_with nls) \
216 $(use_with odbc) \
217 $(use_with png) \
218 $(use_with postgres) \
219 $(use_with python) \
220 $(use_with readline) \
221 $(use_with tiff) || die "configure failed!"
222
223 if use wxwindows; then
224 emake -j1
225 ln -sf "${LIBGDI}" dist.x86_64-pc-linux-gnu/lib/libgdi.so \
226 || die "making libgdi link failed"
227 cd gui/wxpython/vdigit
228 make default -j1 || die "make vdigit failed!"
229 else
230 emake -j1 || die "make failed!"
231 fi
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 if use wxwindows; then
241 ln -sf "${LIBGDI}" "${D}"usr/${MY_PM}/lib/libgdi.so \
242 || die "failed to find wx library"
243 fi
244
245 # get rid of DESTDIR in script path
246 sed -i -e "s@${D}@/@" "${D}"usr/bin/${MY_PM}
247
248 # Grass Extension Manager conflicts with ruby gems
249 mv "${D}"usr/bin/gem "${D}"usr/${MY_PM}/bin/
250
251 ebegin "Adding env.d and desktop entry for Grass6..."
252 generate_files
253 doenvd 99grass-6
254 if use X; then
255 doicon "${FILESDIR}"/grass_icon.png
256 domenu ${MY_PM}-grass.desktop
257 fi
258 eend ${?}
259 }
260
261 pkg_postinst() {
262 use X && fdo-mime_desktop_database_update
263
264 elog "Note this version re-enables support for threads in Tcl and Tk."
265 elog "Enable the threads USE flag and rebuild to try it."
266 }
267
268 pkg_postrm() {
269 use X && fdo-mime_desktop_database_update
270 }
271
272 generate_files() {
273 local GUI="-gui"
274 use wxwindows && GUI="-wxpython"
275
276 cat <<-EOF > 99grass-6
277 GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib"
278 LDPATH="/usr/${MY_PM}/lib"
279 MANPATH="/usr/${MY_PM}/man"
280 GRASS_HOME="/usr/${MY_PM}"
281 EOF
282
283 cat <<-EOF > ${MY_PM}-grass.desktop
284 [Desktop Entry]
285 Encoding=UTF-8
286 Version=1.0
287 Name=Grass ${PV}
288 Type=Application
289 Comment=GRASS Open Source GIS, derived from the original US Army Corps of Engineers project.
290 Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI}
291 Path=
292 Icon=grass_icon.png
293 Categories=Science;Education;
294 Terminal=true
295 EOF
296 }

  ViewVC Help
Powered by ViewVC 1.1.20