/[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.25 - (hide annotations) (download)
Fri Jul 22 11:14:58 2011 UTC (8 years, 7 months ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.24: +1 -1 lines
FILE REMOVED
old

(Portage version: 2.2.0_alpha46/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 scarabeus 1.25 # $Header: /var/cvsroot/gentoo-x86/sci-geosciences/grass/grass-6.3.0.ebuild,v 1.24 2011/04/12 17:39:42 arfrever Exp $
4 ulm 1.17
5 arfrever 1.23 EAPI=3
6 nerdboy 1.1
7 arfrever 1.24 inherit eutils fdo-mime python versionator wxwidgets
8 nerdboy 1.1
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 armin76 1.20 KEYWORDS="amd64 ppc ~ppc64 x86"
20 nerdboy 1.1
21 jlec 1.21 IUSE="ffmpeg fftw gmath jpeg 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 scarabeus 1.22 ffmpeg? ( virtual/ffmpeg )
35 nerdboy 1.1 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 arfrever 1.23 src_prepare() {
112 nerdboy 1.1 epatch rpm/fedora/grass-readline.patch
113 nerdboy 1.6 # fix the fortify_source and buffer issues (see bug #261283)
114     epatch "${FILESDIR}"/${P}-o_creat.patch
115 nerdboy 1.7 # and update for gcc 4.4 C++ changes (see bug #270916)
116     epatch "${FILESDIR}"/${P}-gcc44.patch
117    
118 nerdboy 1.6 sed -i -e "s:buff\[12:buff\[16:g" general/g.parser/main.c \
119     || die "sed failed"
120 nerdboy 1.1
121 nerdboy 1.5 if ! use opengl; then
122 nerdboy 1.1 epatch "${FILESDIR}"/${P}-html-nonviz.patch
123     fi
124    
125     # patch missing math functions (yes, this is still needed)
126     sed -i -e "s:\$(EXTRA_LIBS):\$(EXTRA_LIBS) \$(MATHLIB):g" include/Make/Shlib.make
127     echo "MATHLIB=-lm" >> include/Make/Rules.make
128     }
129    
130 arfrever 1.23 src_configure() {
131 nerdboy 1.1 local myconf
132 nerdboy 1.9 addpredict /var/cache/fontconfig
133 nerdboy 1.1
134     myconf="--prefix=/usr --with-cxx --enable-shared \
135     --with-gdal=$(type -P gdal-config) --with-curses --with-proj \
136     --with-includes=/usr/include --with-libs=/usr/$(get_libdir) \
137     --with-proj-includes=/usr/include \
138     --with-proj-libs=/usr/$(get_libdir) \
139 nerdboy 1.5 --with-proj-share=/usr/share/proj \
140     --without-glw"
141 nerdboy 1.1
142     if use X; then
143     if has_version ">=dev-lang/tcl-8.5"; then
144     TCL_LIBDIR="/usr/$(get_libdir)/tcl8.5"
145     else
146     TCL_LIBDIR="/usr/$(get_libdir)/tcl8.4"
147     fi
148     myconf="${myconf} --with-tcltk --with-x \
149     --with-tcltk-includes=/usr/include \
150     --with-tcltk-libs=${TCL_LIBDIR}"
151 dirtyepic 1.16 if use wxwidgets; then
152 nerdboy 1.1 WX_GTK_VER=2.8
153 nerdboy 1.2 need-wxwidgets unicode
154     # The following lib should be there, based on the above and the
155     # wxpython dependency (in theory). I still need a good way to
156     # query for the location...
157 arfrever 1.14 LIBGDI="$(python_get_sitedir)/wx-${WX_GTK_VER}-gtk2-unicode/wx/_gdi_.so"
158 nerdboy 1.1 myconf="${myconf} --with-python --with-wxwidgets=${WX_CONFIG}"
159 nerdboy 1.4 else
160 dirtyepic 1.16 # USE=python must be enabled above if wxwidgets is enabled
161 nerdboy 1.4 myconf="${myconf} $(use_with python) --without-wxwidgets"
162 nerdboy 1.1 fi
163     else
164     myconf="${myconf} --without-tcltk --without-x"
165     fi
166    
167     if use opengl; then
168     myconf="${myconf} --with-opengl --with-opengl-libs=/usr/$(get_libdir)/opengl/xorg-x11/lib"
169     else
170 nerdboy 1.5 myconf="${myconf} --without-opengl"
171 nerdboy 1.1 fi
172    
173     # Should handle either older or latest without intervention;
174     # this won't work forever, but it should be okay for a while...
175     if use ffmpeg; then
176     myconf="${myconf} --with-ffmpeg \
177     --with-ffmpeg-libs=/usr/$(get_libdir)"
178 scarabeus 1.22 myconf="${myconf} --with-ffmpeg-includes=/usr/include/libav*"
179 nerdboy 1.1 else
180     myconf="${myconf} --without-ffmpeg"
181     fi
182    
183     if use truetype; then
184     myconf="${myconf} --with-freetype \
185     --with-freetype-includes=/usr/include/freetype2"
186     fi
187    
188     if use mysql; then
189     myconf="${myconf} --with-mysql --with-mysql-includes=/usr/include/mysql \
190     --with-mysql-libs=/usr/$(get_libdir)/mysql"
191     else
192     myconf="${myconf} --without-mysql"
193     fi
194    
195     if use sqlite; then
196     myconf="${myconf} --with-sqlite --with-sqlite-includes=/usr/include \
197     --with-sqlite-libs=/usr/$(get_libdir)"
198     else
199     myconf="${myconf} --without-sqlite"
200     fi
201    
202     econf ${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 nerdboy 1.5 $(use_with motif) \
209 nerdboy 1.1 $(use_with nls) \
210     $(use_with odbc) \
211     $(use_with png) \
212     $(use_with postgres) \
213     $(use_with readline) \
214 jlec 1.21 $(use_with tiff) \
215 arfrever 1.23 --enable-largefile
216     }
217 nerdboy 1.1
218 arfrever 1.23 src_compile() {
219 dirtyepic 1.16 if use wxwidgets; then
220 nerdboy 1.5 # can't use die here since we need to hack the vdigit build
221 nerdboy 1.6 emake -j1
222 nerdboy 1.2 ln -sf "${LIBGDI}" dist.${CHOST}/lib/libgdi.so \
223 nerdboy 1.1 || die "making libgdi link failed"
224     cd gui/wxpython/vdigit
225 nerdboy 1.5 # now we're OK
226 nerdboy 1.1 make default -j1 || die "make vdigit failed!"
227     else
228 nerdboy 1.6 emake -j1 || die "make failed!"
229 nerdboy 1.1 fi
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 dirtyepic 1.16 if use wxwidgets; then
239 nerdboy 1.1 ln -sf "${LIBGDI}" "${D}"usr/${MY_PM}/lib/libgdi.so \
240     || die "failed to find wx library"
241     fi
242    
243     # get rid of DESTDIR in script path
244     sed -i -e "s@${D}@/@" "${D}"usr/bin/${MY_PM}
245    
246     # Grass Extension Manager conflicts with ruby gems
247     mv "${D}"usr/bin/gem "${D}"usr/${MY_PM}/bin/
248    
249     ebegin "Adding env.d and desktop entry for Grass6..."
250     generate_files
251     doenvd 99grass-6
252     if use X; then
253     doicon "${FILESDIR}"/grass_icon.png
254     domenu ${MY_PM}-grass.desktop
255     fi
256     eend ${?}
257     }
258    
259     pkg_postinst() {
260     use X && fdo-mime_desktop_database_update
261    
262     elog "Note this version re-enables support for threads in Tcl and Tk."
263     elog "Enable the threads USE flag and rebuild to try it."
264     }
265    
266     pkg_postrm() {
267     use X && fdo-mime_desktop_database_update
268     }
269    
270     generate_files() {
271     local GUI="-gui"
272 dirtyepic 1.16 use wxwidgets && GUI="-wxpython"
273 nerdboy 1.1
274     cat <<-EOF > 99grass-6
275     GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib"
276     LDPATH="/usr/${MY_PM}/lib"
277     MANPATH="/usr/${MY_PM}/man"
278     GRASS_HOME="/usr/${MY_PM}"
279     EOF
280    
281     cat <<-EOF > ${MY_PM}-grass.desktop
282     [Desktop Entry]
283     Encoding=UTF-8
284     Version=1.0
285     Name=Grass ${PV}
286     Type=Application
287 nerdboy 1.8 Comment=GRASS (Geographic Resources Analysis Support System), the original GIS.
288 nerdboy 1.1 Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI}
289     Path=
290     Icon=grass_icon.png
291     Categories=Science;Education;
292 nerdboy 1.9 Terminal=false
293 nerdboy 1.1 EOF
294     }

  ViewVC Help
Powered by ViewVC 1.1.20