/[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.4 - (show annotations) (download)
Thu Jun 17 21:03:51 2010 UTC (9 years, 8 months ago) by patrick
Branch: MAIN
Changes since 1.3: +3 -3 lines
Migrating away from deprecated postgres virtuals
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2010 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_rc5.ebuild,v 1.3 2010/05/30 20:45:30 arfrever Exp $
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 >=dev-db/postgresql-base-8.0
51 >=dev-db/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
138 myconf="--prefix=/usr --with-cxx --enable-shared \
139 --with-gdal=$(type -P gdal-config) --with-curses --with-proj \
140 --with-includes=/usr/include --with-libs=/usr/$(get_libdir) \
141 --with-proj-includes=/usr/include \
142 --with-proj-libs=/usr/$(get_libdir) \
143 --with-proj-share=/usr/share/proj \
144 --without-glw"
145
146 if use X; then
147 if has_version ">=dev-lang/tcl-8.5"; then
148 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.5"
149 else
150 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.4"
151 fi
152 myconf+=" --with-tcltk --with-x \
153 --with-tcltk-includes=/usr/include \
154 --with-tcltk-libs=${TCL_LIBDIR}"
155 if use wxwindows; then
156 WX_GTK_VER=2.8
157 need-wxwidgets unicode
158 myconf+=" --with-python --with-wxwidgets=${WX_CONFIG}"
159 else
160 # USE=python must be enabled above if wxwindows is enabled
161 myconf+=" $(use_with python) --without-wxwidgets"
162 fi
163 else
164 myconf+=" --without-tcltk --without-x"
165 fi
166
167 if use opengl; then
168 myconf+=" --with-opengl --with-opengl-libs=/usr/$(get_libdir)/opengl/xorg-x11/lib"
169 else
170 myconf+=" --without-opengl"
171 fi
172
173 if use truetype; then
174 myconf+=" --with-freetype
175 --with-freetype-includes=/usr/include/freetype2"
176 fi
177
178 if use mysql; then
179 myconf+=" --with-mysql --with-mysql-includes=/usr/include/mysql
180 --with-mysql-libs=/usr/$(get_libdir)/mysql"
181 else
182 myconf+=" --without-mysql"
183 fi
184
185 if use sqlite; then
186 myconf+=" --with-sqlite --with-sqlite-includes=/usr/include
187 --with-sqlite-libs=/usr/$(get_libdir)"
188 else
189 myconf+=" --without-sqlite"
190 fi
191
192 # Old ffmpeg is gone, but new is a pita with all those include dirs,
193 # thus, a rather funky configure...
194 if use ffmpeg; then
195 ffmlib_conf="--with-ffmpeg --with-ffmpeg-libs=/usr/$(get_libdir)"
196 else
197 myconf+=" --without-ffmpeg"
198 fi
199
200 myconf+=" --with-libs=/usr/$(get_libdir)
201 $(use_enable amd64 64bit)
202 $(use_with fftw)
203 $(use_with gmath blas)
204 $(use_with gmath lapack)
205 $(use_with jpeg)
206 $(use_enable largefile)
207 $(use_with motif)
208 $(use_with nls)
209 $(use_with odbc)
210 $(use_with png)
211 $(use_with postgres)
212 $(use_with readline)
213 $(use_with tiff)"
214
215 if use ffmpeg; then
216 "${S}"/configure ${myconf} ${ffmlib_conf} \
217 --with-ffmpeg-includes="/usr/include/libavcodec \
218 /usr/include/libavdevice /usr/include/libavfilter \
219 /usr/include/libavformat /usr/include/libavutil \
220 /usr/include/libpostproc /usr/include/libswscale" \
221 || die "ffmpeg configure failed!"
222 else
223 "${S}"/configure ${myconf} || die "configure failed!"
224 fi
225 }
226
227 src_compile() {
228 # looks like we no longer need the vdigit symlink build hack
229 emake -j1 || die "make failed!"
230 }
231
232 src_install() {
233 elog "Grass Home is ${MY_PM}"
234 make install UNIX_BIN="${D}"usr/bin BINDIR="${D}"usr/bin \
235 PREFIX="${D}"usr INST_DIR="${D}"usr/${MY_PM} \
236 || die "make install failed!"
237
238 # get rid of DESTDIR in script path
239 sed -i -e "s@${D}@/@" "${D}"usr/bin/${MY_PM}
240
241 # Grass Extension Manager conflicts with ruby gems
242 mv "${D}"usr/bin/gem "${D}"usr/${MY_PM}/bin/
243
244 ebegin "Adding env.d and desktop entry for Grass6..."
245 generate_files
246 doenvd 99grass-6
247 if use X; then
248 doicon "${FILESDIR}"/grass_icon.png
249 domenu ${MY_PM}-grass.desktop
250 fi
251 eend ${?}
252 }
253
254 pkg_postinst() {
255 use X && fdo-mime_desktop_database_update
256
257 elog "Note this version re-enables support for threads in Tcl and Tk."
258 elog "Enable the threads USE flag and rebuild to try it."
259 }
260
261 pkg_postrm() {
262 use X && fdo-mime_desktop_database_update
263 }
264
265 generate_files() {
266 local GUI="-gui"
267 use wxwindows && GUI="-wxpython"
268
269 cat <<-EOF > 99grass-6
270 GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib"
271 LDPATH="/usr/${MY_PM}/lib"
272 MANPATH="/usr/${MY_PM}/man"
273 GRASS_HOME="/usr/${MY_PM}"
274 EOF
275
276 cat <<-EOF > ${MY_PM}-grass.desktop
277 [Desktop Entry]
278 Encoding=UTF-8
279 Version=1.0
280 Name=Grass ${PV}
281 Type=Application
282 Comment=GRASS (Geographic Resources Analysis Support System), the original GIS.
283 Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI}
284 Path=
285 Icon=grass_icon.png
286 Categories=Science;Education;
287 Terminal=false
288 EOF
289 }

  ViewVC Help
Powered by ViewVC 1.1.20