/[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.22 - (hide annotations) (download)
Sat Mar 26 15:27:44 2011 UTC (8 years, 11 months ago) by scarabeus
Branch: MAIN
Changes since 1.21: +3 -9 lines
Depend on virtual/ffmpeg instead of media-video/ffmpeg. Cleanup the deprecated if has_version for old ffmpeg.

(Portage version: 2.2.0_alpha28/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.22 # $Header: /var/cvsroot/gentoo-x86/sci-geosciences/grass/grass-6.3.0.ebuild,v 1.21 2011/03/10 19:14:03 jlec 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 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     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 scarabeus 1.22 myconf="${myconf} --with-ffmpeg-includes=/usr/include/libav*"
182 nerdboy 1.1 else
183     myconf="${myconf} --without-ffmpeg"
184     fi
185    
186     if use truetype; then
187     myconf="${myconf} --with-freetype \
188     --with-freetype-includes=/usr/include/freetype2"
189     fi
190    
191     if use mysql; then
192     myconf="${myconf} --with-mysql --with-mysql-includes=/usr/include/mysql \
193     --with-mysql-libs=/usr/$(get_libdir)/mysql"
194     else
195     myconf="${myconf} --without-mysql"
196     fi
197    
198     if use sqlite; then
199     myconf="${myconf} --with-sqlite --with-sqlite-includes=/usr/include \
200     --with-sqlite-libs=/usr/$(get_libdir)"
201     else
202     myconf="${myconf} --without-sqlite"
203     fi
204    
205     econf ${myconf} --with-libs=/usr/$(get_libdir) \
206     $(use_enable amd64 64bit) \
207     $(use_with fftw) \
208     $(use_with gmath blas) \
209     $(use_with gmath lapack) \
210     $(use_with jpeg) \
211 nerdboy 1.5 $(use_with motif) \
212 nerdboy 1.1 $(use_with nls) \
213     $(use_with odbc) \
214     $(use_with png) \
215     $(use_with postgres) \
216     $(use_with readline) \
217 jlec 1.21 $(use_with tiff) \
218     --enable-largefile \
219 nerdboy 1.1
220 dirtyepic 1.16 if use wxwidgets; then
221 nerdboy 1.5 # can't use die here since we need to hack the vdigit build
222 nerdboy 1.6 emake -j1
223 nerdboy 1.2 ln -sf "${LIBGDI}" dist.${CHOST}/lib/libgdi.so \
224 nerdboy 1.1 || die "making libgdi link failed"
225     cd gui/wxpython/vdigit
226 nerdboy 1.5 # now we're OK
227 nerdboy 1.1 make default -j1 || die "make vdigit failed!"
228     else
229 nerdboy 1.6 emake -j1 || die "make failed!"
230 nerdboy 1.1 fi
231     }
232    
233     src_install() {
234     elog "Grass Home is ${MY_PM}"
235     make install UNIX_BIN="${D}"usr/bin BINDIR="${D}"usr/bin \
236     PREFIX="${D}"usr INST_DIR="${D}"usr/${MY_PM} \
237     || die "make install failed!"
238    
239 dirtyepic 1.16 if use wxwidgets; then
240 nerdboy 1.1 ln -sf "${LIBGDI}" "${D}"usr/${MY_PM}/lib/libgdi.so \
241     || die "failed to find wx library"
242     fi
243    
244     # get rid of DESTDIR in script path
245     sed -i -e "s@${D}@/@" "${D}"usr/bin/${MY_PM}
246    
247     # Grass Extension Manager conflicts with ruby gems
248     mv "${D}"usr/bin/gem "${D}"usr/${MY_PM}/bin/
249    
250     ebegin "Adding env.d and desktop entry for Grass6..."
251     generate_files
252     doenvd 99grass-6
253     if use X; then
254     doicon "${FILESDIR}"/grass_icon.png
255     domenu ${MY_PM}-grass.desktop
256     fi
257     eend ${?}
258     }
259    
260     pkg_postinst() {
261     use X && fdo-mime_desktop_database_update
262    
263     elog "Note this version re-enables support for threads in Tcl and Tk."
264     elog "Enable the threads USE flag and rebuild to try it."
265     }
266    
267     pkg_postrm() {
268     use X && fdo-mime_desktop_database_update
269     }
270    
271     generate_files() {
272     local GUI="-gui"
273 dirtyepic 1.16 use wxwidgets && GUI="-wxpython"
274 nerdboy 1.1
275     cat <<-EOF > 99grass-6
276     GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib"
277     LDPATH="/usr/${MY_PM}/lib"
278     MANPATH="/usr/${MY_PM}/man"
279     GRASS_HOME="/usr/${MY_PM}"
280     EOF
281    
282     cat <<-EOF > ${MY_PM}-grass.desktop
283     [Desktop Entry]
284     Encoding=UTF-8
285     Version=1.0
286     Name=Grass ${PV}
287     Type=Application
288 nerdboy 1.8 Comment=GRASS (Geographic Resources Analysis Support System), the original GIS.
289 nerdboy 1.1 Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI}
290     Path=
291     Icon=grass_icon.png
292     Categories=Science;Education;
293 nerdboy 1.9 Terminal=false
294 nerdboy 1.1 EOF
295     }

  ViewVC Help
Powered by ViewVC 1.1.20