/[gentoo-x86]/sci-geosciences/grass/grass-6.3.0.ebuild
Gentoo

Diff of /sci-geosciences/grass/grass-6.3.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.19
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2011 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/sci-geosciences/grass/Attic/grass-6.3.0.ebuild,v 1.2 2008/06/25 04:28:50 nerdboy Exp $ 3# $Header: /var/cvsroot/gentoo-x86/sci-geosciences/grass/Attic/grass-6.3.0.ebuild,v 1.19 2011/02/20 23:44:24 nerdboy Exp $
4
5EAPI=1
4 6
5inherit eutils distutils fdo-mime versionator wxwidgets 7inherit eutils distutils fdo-mime versionator wxwidgets
6 8
7MY_PV=$(get_version_component_range 1-2 ${PV}) 9MY_PV=$(get_version_component_range 1-2 ${PV})
8MY_PVM=$(delete_all_version_separators ${MY_PV}) 10MY_PVM=$(delete_all_version_separators ${MY_PV})
9MY_PM=${PN}${MY_PVM} 11MY_PM=${PN}${MY_PVM}
10 12
11DESCRIPTION="An open-source GIS with raster and vector functionality, as well as 3D vizualization." 13DESCRIPTION="A free GIS with raster and vector functionality, as well as 3D vizualization."
12HOMEPAGE="http://grass.itc.it/" 14HOMEPAGE="http://grass.osgeo.org//"
13SRC_URI="http://grass.itc.it/${MY_PM}/source/${P}.tar.gz" 15SRC_URI="http://download.osgeo.org/grass/${MY_PM}/source/${P}.tar.gz"
14 16
15LICENSE="GPL-2" 17LICENSE="GPL-2"
16SLOT="0" 18SLOT="6"
17KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" 19KEYWORDS="amd64 ppc ~ppc64 sparc x86"
18 20
19IUSE="ffmpeg fftw glw gmath jpeg largefile mysql nls odbc opengl png \ 21IUSE="ffmpeg fftw gmath jpeg largefile motif mysql nls odbc opengl png \
20postgres python readline sqlite tiff truetype wxwindows X" 22postgres python readline sqlite tiff truetype wxwidgets X"
21 23
22RESTRICT="strip" 24RESTRICT="strip"
23 25
24RDEPEND=">=sys-libs/zlib-1.1.4 26RDEPEND=">=sys-libs/zlib-1.1.4
25 >=sys-libs/ncurses-5.3 27 >=sys-libs/ncurses-5.3
31 >=sci-libs/proj-4.4.7 33 >=sci-libs/proj-4.4.7
32 ffmpeg? ( media-video/ffmpeg ) 34 ffmpeg? ( media-video/ffmpeg )
33 fftw? ( sci-libs/fftw ) 35 fftw? ( sci-libs/fftw )
34 gmath? ( virtual/blas 36 gmath? ( virtual/blas
35 virtual/lapack ) 37 virtual/lapack )
36 jpeg? ( media-libs/jpeg ) 38 jpeg? ( virtual/jpeg )
37 mysql? ( dev-db/mysql ) 39 mysql? ( dev-db/mysql )
38 odbc? ( >=dev-db/unixODBC-2.0.6 ) 40 odbc? ( >=dev-db/unixODBC-2.0.6 )
39 opengl? ( ( virtual/opengl ) 41 opengl? ( virtual/opengl )
40 ( x11-libs/openmotif ) 42 motif? ( >=x11-libs/openmotif-2.3:0 )
41 glw? ( media-libs/mesa ) )
42 png? ( >=media-libs/libpng-1.2.2 ) 43 png? ( >=media-libs/libpng-1.2.2 )
43 postgres? ( >=dev-db/postgresql-7.3 ) 44 postgres? ( || (
45 >=dev-db/postgresql-base-8.0
46 >=dev-db/postgresql-server-8.0 )
47 )
44 python? ( dev-lang/python ) 48 python? ( dev-lang/python )
45 readline? ( sys-libs/readline ) 49 readline? ( sys-libs/readline )
46 sqlite? ( dev-db/sqlite ) 50 sqlite? ( dev-db/sqlite )
47 tiff? ( >=media-libs/tiff-3.5.7 ) 51 tiff? ( >=media-libs/tiff-3.5.7 )
48 truetype? ( >=media-libs/freetype-2.0 ) 52 truetype? ( >=media-libs/freetype-2.0 )
49 wxwindows? ( 53 wxwidgets? (
50 >=dev-python/wxpython-2.8.1.1 54 >=dev-python/wxpython-2.8.1.1
51 >=dev-lang/python-2.4 55 >=dev-lang/python-2.4
52 ) 56 )
53 X? ( 57 X? (
54 x11-libs/libXmu 58 x11-libs/libXmu
65 )" 69 )"
66 70
67DEPEND="${RDEPEND} 71DEPEND="${RDEPEND}
68 >=sys-devel/flex-2.5.4a 72 >=sys-devel/flex-2.5.4a
69 >=sys-devel/bison-1.35 73 >=sys-devel/bison-1.35
70 wxwindows? ( >=dev-lang/swig-1.3.31 ) 74 wxwidgets? ( >=dev-lang/swig-1.3.31 )
71 X? ( 75 X? (
72 x11-proto/xproto 76 x11-proto/xproto
73 x11-proto/xextproto 77 x11-proto/xextproto
74 )" 78 )"
75 79
76pkg_setup() { 80pkg_setup() {
77 local myblas 81 local myblas
78 elog "" 82 elog ""
79 elog "This version enables the experimental wxpython interface, which" 83 elog "This version enables the experimental wxpython interface, which"
80 elog "you may want to try, since the legacy GUI seems a little wonky" 84 elog "you may want to try. If the legacy GUI seems a little wonky in"
81 elog "in this version; just enable the wxwindows USE flag and rebuild" 85 elog "this version, just enable the wxwidgets USE flag and rebuild"
82 elog "grass to use it." 86 elog "grass to use it."
83 elog "" 87 elog ""
84 if use gmath; then 88 if use gmath; then
85 for d in $(eselect lapack show); do myblas=${d}; done 89 for d in $(eselect lapack show); do myblas=${d}; done
86 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then 90 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
96 ewarn "where <impl> is atlas, threaded-atlas or reference" 100 ewarn "where <impl> is atlas, threaded-atlas or reference"
97 die "setup failed" 101 die "setup failed"
98 fi 102 fi
99 fi 103 fi
100 104
101 if use glw && ! use opengl; then
102 ewarn "You set USE='glw -opengl'. GLw support needs OpenGL."
103 ewarn "OpenGL support also requires X."
104 die "Set opengl and X useflags."
105 fi
106
107 if use glw && ! built_with_use media-libs/mesa motif; then
108 ewarn "GRASS GLw/OpenGL support needs mesa with motif headers."
109 ewarn "Please rebuild mesa with motif support."
110 die "Re-emerge mesa with motif."
111 fi
112
113 if use opengl && ! use X; then 105 if use opengl && ! use X; then
114 ewarn "GRASS OpenGL support needs X (will also pull in Tcl/Tk)." 106 ewarn "GRASS OpenGL support needs X (will also pull in Tcl/Tk)."
115 die "Please set the X useflag." 107 die "Please set the X useflag."
116 fi 108 fi
117} 109}
119src_unpack() { 111src_unpack() {
120 unpack ${A} 112 unpack ${A}
121 cd "${S}" 113 cd "${S}"
122 114
123 epatch rpm/fedora/grass-readline.patch 115 epatch rpm/fedora/grass-readline.patch
116 # fix the fortify_source and buffer issues (see bug #261283)
117 epatch "${FILESDIR}"/${P}-o_creat.patch
118 # and update for gcc 4.4 C++ changes (see bug #270916)
119 epatch "${FILESDIR}"/${P}-gcc44.patch
124 120
121 sed -i -e "s:buff\[12:buff\[16:g" general/g.parser/main.c \
122 || die "sed failed"
123
125 if use opengl; then 124 if ! use opengl; then
126 epatch "${FILESDIR}"/${P}-html-nonviz.patch 125 epatch "${FILESDIR}"/${P}-html-nonviz.patch
127 fi 126 fi
128 127
129 # patch missing math functions (yes, this is still needed) 128 # patch missing math functions (yes, this is still needed)
130 sed -i -e "s:\$(EXTRA_LIBS):\$(EXTRA_LIBS) \$(MATHLIB):g" include/Make/Shlib.make 129 sed -i -e "s:\$(EXTRA_LIBS):\$(EXTRA_LIBS) \$(MATHLIB):g" include/Make/Shlib.make
131 echo "MATHLIB=-lm" >> include/Make/Rules.make 130 echo "MATHLIB=-lm" >> include/Make/Rules.make
132} 131}
133 132
134src_compile() { 133src_compile() {
135 local myconf 134 local myconf
136 use python || use wxindows && distutils_python_version 135 addpredict /var/cache/fontconfig
137 136
138 myconf="--prefix=/usr --with-cxx --enable-shared \ 137 myconf="--prefix=/usr --with-cxx --enable-shared \
139 --with-gdal=$(type -P gdal-config) --with-curses --with-proj \ 138 --with-gdal=$(type -P gdal-config) --with-curses --with-proj \
140 --with-includes=/usr/include --with-libs=/usr/$(get_libdir) \ 139 --with-includes=/usr/include --with-libs=/usr/$(get_libdir) \
141 --with-proj-includes=/usr/include \ 140 --with-proj-includes=/usr/include \
142 --with-proj-libs=/usr/$(get_libdir) \ 141 --with-proj-libs=/usr/$(get_libdir) \
143 --with-proj-share=/usr/share/proj" 142 --with-proj-share=/usr/share/proj \
143 --without-glw"
144 144
145 if use X; then 145 if use X; then
146 if has_version ">=dev-lang/tcl-8.5"; then 146 if has_version ">=dev-lang/tcl-8.5"; then
147 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.5" 147 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.5"
148 else 148 else
149 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.4" 149 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.4"
150 fi 150 fi
151 myconf="${myconf} --with-tcltk --with-x \ 151 myconf="${myconf} --with-tcltk --with-x \
152 --with-tcltk-includes=/usr/include \ 152 --with-tcltk-includes=/usr/include \
153 --with-tcltk-libs=${TCL_LIBDIR}" 153 --with-tcltk-libs=${TCL_LIBDIR}"
154 if use wxwindows; then 154 if use wxwidgets; then
155 WX_GTK_VER=2.8 155 WX_GTK_VER=2.8
156 need-wxwidgets unicode 156 need-wxwidgets unicode
157 # The following lib should be there, based on the above and the 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 158 # wxpython dependency (in theory). I still need a good way to
159 # query for the location... 159 # query for the location...
160 LIBGDI="/usr/$(get_libdir)/python${PYVER}/site-packages/wx-${WX_GTK_VER}-gtk2-unicode/wx/_gdi_.so" 160 LIBGDI="$(python_get_sitedir)/wx-${WX_GTK_VER}-gtk2-unicode/wx/_gdi_.so"
161 myconf="${myconf} --with-python --with-wxwidgets=${WX_CONFIG}" 161 myconf="${myconf} --with-python --with-wxwidgets=${WX_CONFIG}"
162 else
163 # USE=python must be enabled above if wxwidgets is enabled
164 myconf="${myconf} $(use_with python) --without-wxwidgets"
162 fi 165 fi
163 else 166 else
164 myconf="${myconf} --without-tcltk --without-x" 167 myconf="${myconf} --without-tcltk --without-x"
165 fi 168 fi
166 169
167 if use opengl; then 170 if use opengl; then
168 myconf="${myconf} --with-opengl --with-opengl-libs=/usr/$(get_libdir)/opengl/xorg-x11/lib" 171 myconf="${myconf} --with-opengl --with-opengl-libs=/usr/$(get_libdir)/opengl/xorg-x11/lib"
169 if use glw; then
170 myconf="${myconf} --with-glw"
171 fi
172 else 172 else
173 myconf="${myconf} --without-opengl --without-glw" 173 myconf="${myconf} --without-opengl"
174 fi 174 fi
175 175
176 # Should handle either older or latest without intervention; 176 # Should handle either older or latest without intervention;
177 # this won't work forever, but it should be okay for a while... 177 # this won't work forever, but it should be okay for a while...
178 if use ffmpeg; then 178 if use ffmpeg; then
213 $(use_with fftw) \ 213 $(use_with fftw) \
214 $(use_with gmath blas) \ 214 $(use_with gmath blas) \
215 $(use_with gmath lapack) \ 215 $(use_with gmath lapack) \
216 $(use_with jpeg) \ 216 $(use_with jpeg) \
217 $(use_enable largefile) \ 217 $(use_enable largefile) \
218 $(use_with opengl motif) \ 218 $(use_with motif) \
219 $(use_with nls) \ 219 $(use_with nls) \
220 $(use_with odbc) \ 220 $(use_with odbc) \
221 $(use_with png) \ 221 $(use_with png) \
222 $(use_with postgres) \ 222 $(use_with postgres) \
223 $(use_with python) \
224 $(use_with readline) \ 223 $(use_with readline) \
225 $(use_with tiff) || die "configure failed!" 224 $(use_with tiff) || die "configure failed!"
226 225
227 if use wxwindows; then 226 if use wxwidgets; then
227 # can't use die here since we need to hack the vdigit build
228 emake -j1 228 emake -j1
229 ln -sf "${LIBGDI}" dist.${CHOST}/lib/libgdi.so \ 229 ln -sf "${LIBGDI}" dist.${CHOST}/lib/libgdi.so \
230 || die "making libgdi link failed" 230 || die "making libgdi link failed"
231 cd gui/wxpython/vdigit 231 cd gui/wxpython/vdigit
232 # now we're OK
232 make default -j1 || die "make vdigit failed!" 233 make default -j1 || die "make vdigit failed!"
233 else 234 else
234 emake -j1 || die "make failed!" 235 emake -j1 || die "make failed!"
235 fi 236 fi
236} 237}
239 elog "Grass Home is ${MY_PM}" 240 elog "Grass Home is ${MY_PM}"
240 make install UNIX_BIN="${D}"usr/bin BINDIR="${D}"usr/bin \ 241 make install UNIX_BIN="${D}"usr/bin BINDIR="${D}"usr/bin \
241 PREFIX="${D}"usr INST_DIR="${D}"usr/${MY_PM} \ 242 PREFIX="${D}"usr INST_DIR="${D}"usr/${MY_PM} \
242 || die "make install failed!" 243 || die "make install failed!"
243 244
244 if use wxwindows; then 245 if use wxwidgets; then
245 ln -sf "${LIBGDI}" "${D}"usr/${MY_PM}/lib/libgdi.so \ 246 ln -sf "${LIBGDI}" "${D}"usr/${MY_PM}/lib/libgdi.so \
246 || die "failed to find wx library" 247 || die "failed to find wx library"
247 fi 248 fi
248 249
249 # get rid of DESTDIR in script path 250 # get rid of DESTDIR in script path
273 use X && fdo-mime_desktop_database_update 274 use X && fdo-mime_desktop_database_update
274} 275}
275 276
276generate_files() { 277generate_files() {
277 local GUI="-gui" 278 local GUI="-gui"
278 use wxwindows && GUI="-wxpython" 279 use wxwidgets && GUI="-wxpython"
279 280
280 cat <<-EOF > 99grass-6 281 cat <<-EOF > 99grass-6
281 GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib" 282 GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib"
282 LDPATH="/usr/${MY_PM}/lib" 283 LDPATH="/usr/${MY_PM}/lib"
283 MANPATH="/usr/${MY_PM}/man" 284 MANPATH="/usr/${MY_PM}/man"
288 [Desktop Entry] 289 [Desktop Entry]
289 Encoding=UTF-8 290 Encoding=UTF-8
290 Version=1.0 291 Version=1.0
291 Name=Grass ${PV} 292 Name=Grass ${PV}
292 Type=Application 293 Type=Application
293 Comment=GRASS Open Source GIS, derived from the original US Army Corps of Engineers project. 294 Comment=GRASS (Geographic Resources Analysis Support System), the original GIS.
294 Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI} 295 Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI}
295 Path= 296 Path=
296 Icon=grass_icon.png 297 Icon=grass_icon.png
297 Categories=Science;Education; 298 Categories=Science;Education;
298 Terminal=true 299 Terminal=false
299 EOF 300 EOF
300} 301}

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.20