/[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.19 - (hide annotations) (download)
Sun Feb 20 23:44:24 2011 UTC (9 years, 3 months ago) by nerdboy
Branch: MAIN
Changes since 1.18: +2 -2 lines
Migrating to requested mysql virtual: dev-db/mysql -> virtual/mysql.

(Portage version: 2.1.9.40/cvs/Linux x86_64)

1 nerdboy 1.19 # Copyright 1999-2011 Gentoo Foundation
2 nerdboy 1.1 # Distributed under the terms of the GNU General Public License v2
3 nerdboy 1.19 # $Header: /var/cvsroot/gentoo-x86/sci-geosciences/grass/grass-6.3.0.ebuild,v 1.18 2010/11/08 17:27:39 xarthisius Exp $
4 ulm 1.17
5     EAPI=1
6 nerdboy 1.1
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    
13 nerdboy 1.8 DESCRIPTION="A free GIS with raster and vector functionality, as well as 3D vizualization."
14 nerdboy 1.5 HOMEPAGE="http://grass.osgeo.org//"
15     SRC_URI="http://download.osgeo.org/grass/${MY_PM}/source/${P}.tar.gz"
16 nerdboy 1.1
17     LICENSE="GPL-2"
18 nerdboy 1.3 SLOT="6"
19 hwoarang 1.13 KEYWORDS="amd64 ppc ~ppc64 sparc x86"
20 nerdboy 1.1
21 nerdboy 1.5 IUSE="ffmpeg fftw gmath jpeg largefile motif mysql nls odbc opengl png \
22 dirtyepic 1.16 postgres python readline sqlite tiff truetype wxwidgets X"
23 nerdboy 1.1
24     RESTRICT="strip"
25    
26     RDEPEND=">=sys-libs/zlib-1.1.4
27     >=sys-libs/ncurses-5.3
28     >=sys-libs/gdbm-1.8.0
29     || (
30     sys-apps/man
31     sys-apps/man-db )
32     sci-libs/gdal
33     >=sci-libs/proj-4.4.7
34     ffmpeg? ( media-video/ffmpeg )
35     fftw? ( sci-libs/fftw )
36     gmath? ( virtual/blas
37     virtual/lapack )
38 xarthisius 1.18 jpeg? ( virtual/jpeg )
39 nerdboy 1.1 mysql? ( dev-db/mysql )
40     odbc? ( >=dev-db/unixODBC-2.0.6 )
41 nerdboy 1.5 opengl? ( virtual/opengl )
42 ulm 1.17 motif? ( >=x11-libs/openmotif-2.3:0 )
43 nerdboy 1.1 png? ( >=media-libs/libpng-1.2.2 )
44 nerdboy 1.9 postgres? ( || (
45 patrick 1.15 >=dev-db/postgresql-base-8.0
46     >=dev-db/postgresql-server-8.0 )
47 nerdboy 1.9 )
48 nerdboy 1.1 python? ( dev-lang/python )
49     readline? ( sys-libs/readline )
50     sqlite? ( dev-db/sqlite )
51     tiff? ( >=media-libs/tiff-3.5.7 )
52     truetype? ( >=media-libs/freetype-2.0 )
53 dirtyepic 1.16 wxwidgets? (
54 nerdboy 1.1 >=dev-python/wxpython-2.8.1.1
55     >=dev-lang/python-2.4
56     )
57     X? (
58     x11-libs/libXmu
59     x11-libs/libXext
60     x11-libs/libXp
61     x11-libs/libX11
62     x11-libs/libXt
63     x11-libs/libSM
64     x11-libs/libICE
65     x11-libs/libXpm
66     x11-libs/libXaw
67     >=dev-lang/tcl-8.4
68     >=dev-lang/tk-8.4
69     )"
70    
71     DEPEND="${RDEPEND}
72     >=sys-devel/flex-2.5.4a
73     >=sys-devel/bison-1.35
74 dirtyepic 1.16 wxwidgets? ( >=dev-lang/swig-1.3.31 )
75 nerdboy 1.1 X? (
76     x11-proto/xproto
77     x11-proto/xextproto
78     )"
79    
80     pkg_setup() {
81     local myblas
82     elog ""
83     elog "This version enables the experimental wxpython interface, which"
84 nerdboy 1.4 elog "you may want to try. If the legacy GUI seems a little wonky in"
85 dirtyepic 1.16 elog "this version, just enable the wxwidgets USE flag and rebuild"
86 nerdboy 1.2 elog "grass to use it."
87 nerdboy 1.1 elog ""
88     if use gmath; then
89     for d in $(eselect lapack show); do myblas=${d}; done
90     if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
91     ewarn "You need to set lapack to atlas or reference. Do:"
92     ewarn " eselect lapack set <impl>"
93     ewarn "where <impl> is atlas, threaded-atlas or reference"
94     die "setup failed"
95     fi
96     for d in $(eselect blas show); do myblas=${d}; done
97     if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
98     ewarn "You need to set blas to atlas or reference. Do:"
99     ewarn " eselect blas set <impl>"
100     ewarn "where <impl> is atlas, threaded-atlas or reference"
101     die "setup failed"
102     fi
103     fi
104    
105     if use opengl && ! use X; then
106     ewarn "GRASS OpenGL support needs X (will also pull in Tcl/Tk)."
107     die "Please set the X useflag."
108     fi
109     }
110    
111     src_unpack() {
112     unpack ${A}
113     cd "${S}"
114    
115     epatch rpm/fedora/grass-readline.patch
116 nerdboy 1.6 # fix the fortify_source and buffer issues (see bug #261283)
117     epatch "${FILESDIR}"/${P}-o_creat.patch
118 nerdboy 1.7 # and update for gcc 4.4 C++ changes (see bug #270916)
119     epatch "${FILESDIR}"/${P}-gcc44.patch
120    
121 nerdboy 1.6 sed -i -e "s:buff\[12:buff\[16:g" general/g.parser/main.c \
122     || die "sed failed"
123 nerdboy 1.1
124 nerdboy 1.5 if ! use opengl; then
125 nerdboy 1.1 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 nerdboy 1.9 addpredict /var/cache/fontconfig
136 nerdboy 1.1
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 nerdboy 1.5 --with-proj-share=/usr/share/proj \
143     --without-glw"
144 nerdboy 1.1
145     if use X; then
146     if has_version ">=dev-lang/tcl-8.5"; then
147     TCL_LIBDIR="/usr/$(get_libdir)/tcl8.5"
148     else
149     TCL_LIBDIR="/usr/$(get_libdir)/tcl8.4"
150     fi
151     myconf="${myconf} --with-tcltk --with-x \
152     --with-tcltk-includes=/usr/include \
153     --with-tcltk-libs=${TCL_LIBDIR}"
154 dirtyepic 1.16 if use wxwidgets; then
155 nerdboy 1.1 WX_GTK_VER=2.8
156 nerdboy 1.2 need-wxwidgets unicode
157     # The following lib should be there, based on the above and the
158     # wxpython dependency (in theory). I still need a good way to
159     # query for the location...
160 arfrever 1.14 LIBGDI="$(python_get_sitedir)/wx-${WX_GTK_VER}-gtk2-unicode/wx/_gdi_.so"
161 nerdboy 1.1 myconf="${myconf} --with-python --with-wxwidgets=${WX_CONFIG}"
162 nerdboy 1.4 else
163 dirtyepic 1.16 # USE=python must be enabled above if wxwidgets is enabled
164 nerdboy 1.4 myconf="${myconf} $(use_with python) --without-wxwidgets"
165 nerdboy 1.1 fi
166     else
167     myconf="${myconf} --without-tcltk --without-x"
168     fi
169    
170     if use opengl; then
171     myconf="${myconf} --with-opengl --with-opengl-libs=/usr/$(get_libdir)/opengl/xorg-x11/lib"
172     else
173 nerdboy 1.5 myconf="${myconf} --without-opengl"
174 nerdboy 1.1 fi
175    
176     # Should handle either older or latest without intervention;
177     # this won't work forever, but it should be okay for a while...
178     if use ffmpeg; then
179     myconf="${myconf} --with-ffmpeg \
180     --with-ffmpeg-libs=/usr/$(get_libdir)"
181     if has_version ">=media-video/ffmpeg-0.4.9_p20080326" ; then
182     # must pass multiple include dirs now; if you have a better
183     # way to do this, please speak up and file a bug :)
184     myconf="${myconf} --with-ffmpeg-includes=/usr/include/libav*"
185     else
186     myconf="${myconf} --with-ffmpeg-includes=/usr/include/ffmpeg"
187     fi
188     else
189     myconf="${myconf} --without-ffmpeg"
190     fi
191    
192     if use truetype; then
193     myconf="${myconf} --with-freetype \
194     --with-freetype-includes=/usr/include/freetype2"
195     fi
196    
197     if use mysql; then
198     myconf="${myconf} --with-mysql --with-mysql-includes=/usr/include/mysql \
199     --with-mysql-libs=/usr/$(get_libdir)/mysql"
200     else
201     myconf="${myconf} --without-mysql"
202     fi
203    
204     if use sqlite; then
205     myconf="${myconf} --with-sqlite --with-sqlite-includes=/usr/include \
206     --with-sqlite-libs=/usr/$(get_libdir)"
207     else
208     myconf="${myconf} --without-sqlite"
209     fi
210    
211     econf ${myconf} --with-libs=/usr/$(get_libdir) \
212     $(use_enable amd64 64bit) \
213     $(use_with fftw) \
214     $(use_with gmath blas) \
215     $(use_with gmath lapack) \
216     $(use_with jpeg) \
217     $(use_enable largefile) \
218 nerdboy 1.5 $(use_with motif) \
219 nerdboy 1.1 $(use_with nls) \
220     $(use_with odbc) \
221     $(use_with png) \
222     $(use_with postgres) \
223     $(use_with readline) \
224     $(use_with tiff) || die "configure failed!"
225    
226 dirtyepic 1.16 if use wxwidgets; then
227 nerdboy 1.5 # can't use die here since we need to hack the vdigit build
228 nerdboy 1.6 emake -j1
229 nerdboy 1.2 ln -sf "${LIBGDI}" dist.${CHOST}/lib/libgdi.so \
230 nerdboy 1.1 || die "making libgdi link failed"
231     cd gui/wxpython/vdigit
232 nerdboy 1.5 # now we're OK
233 nerdboy 1.1 make default -j1 || die "make vdigit failed!"
234     else
235 nerdboy 1.6 emake -j1 || die "make failed!"
236 nerdboy 1.1 fi
237     }
238    
239     src_install() {
240     elog "Grass Home is ${MY_PM}"
241     make install UNIX_BIN="${D}"usr/bin BINDIR="${D}"usr/bin \
242     PREFIX="${D}"usr INST_DIR="${D}"usr/${MY_PM} \
243     || die "make install failed!"
244    
245 dirtyepic 1.16 if use wxwidgets; then
246 nerdboy 1.1 ln -sf "${LIBGDI}" "${D}"usr/${MY_PM}/lib/libgdi.so \
247     || die "failed to find wx library"
248     fi
249    
250     # get rid of DESTDIR in script path
251     sed -i -e "s@${D}@/@" "${D}"usr/bin/${MY_PM}
252    
253     # Grass Extension Manager conflicts with ruby gems
254     mv "${D}"usr/bin/gem "${D}"usr/${MY_PM}/bin/
255    
256     ebegin "Adding env.d and desktop entry for Grass6..."
257     generate_files
258     doenvd 99grass-6
259     if use X; then
260     doicon "${FILESDIR}"/grass_icon.png
261     domenu ${MY_PM}-grass.desktop
262     fi
263     eend ${?}
264     }
265    
266     pkg_postinst() {
267     use X && fdo-mime_desktop_database_update
268    
269     elog "Note this version re-enables support for threads in Tcl and Tk."
270     elog "Enable the threads USE flag and rebuild to try it."
271     }
272    
273     pkg_postrm() {
274     use X && fdo-mime_desktop_database_update
275     }
276    
277     generate_files() {
278     local GUI="-gui"
279 dirtyepic 1.16 use wxwidgets && GUI="-wxpython"
280 nerdboy 1.1
281     cat <<-EOF > 99grass-6
282     GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib"
283     LDPATH="/usr/${MY_PM}/lib"
284     MANPATH="/usr/${MY_PM}/man"
285     GRASS_HOME="/usr/${MY_PM}"
286     EOF
287    
288     cat <<-EOF > ${MY_PM}-grass.desktop
289     [Desktop Entry]
290     Encoding=UTF-8
291     Version=1.0
292     Name=Grass ${PV}
293     Type=Application
294 nerdboy 1.8 Comment=GRASS (Geographic Resources Analysis Support System), the original GIS.
295 nerdboy 1.1 Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI}
296     Path=
297     Icon=grass_icon.png
298     Categories=Science;Education;
299 nerdboy 1.9 Terminal=false
300 nerdboy 1.1 EOF
301     }

  ViewVC Help
Powered by ViewVC 1.1.20