/[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.1 - (hide annotations) (download)
Mon Dec 28 07:22:26 2009 UTC (10 years, 2 months ago) by nerdboy
Branch: MAIN
Updated to latest upstream "stable" release; tested with more data.
(Portage version: 2.2_rc60/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20