/[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.16 - (hide annotations) (download)
Sun Sep 5 04:41:48 2010 UTC (9 years, 8 months ago) by dirtyepic
Branch: MAIN
Changes since 1.15: +10 -10 lines
s/wxwindows/wxwidgets

(Portage version: 2.2_rc75/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20