/[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.6 Revision 1.23
1# Copyright 1999-2009 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.6 2009/03/23 03:51:42 nerdboy Exp $ 3# $Header: /var/cvsroot/gentoo-x86/sci-geosciences/grass/Attic/grass-6.3.0.ebuild,v 1.23 2011/04/10 22:10:42 arfrever Exp $
4
5EAPI=3
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.osgeo.org//" 14HOMEPAGE="http://grass.osgeo.org//"
13SRC_URI="http://download.osgeo.org/grass/${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="6" 18SLOT="6"
17KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" 19KEYWORDS="amd64 ppc ~ppc64 x86"
18 20
19IUSE="ffmpeg fftw gmath jpeg largefile motif mysql nls odbc opengl png \ 21IUSE="ffmpeg fftw gmath jpeg 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
27 || ( 29 || (
28 sys-apps/man 30 sys-apps/man
29 sys-apps/man-db ) 31 sys-apps/man-db )
30 sci-libs/gdal 32 sci-libs/gdal
31 >=sci-libs/proj-4.4.7 33 >=sci-libs/proj-4.4.7
32 ffmpeg? ( media-video/ffmpeg ) 34 ffmpeg? ( virtual/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 motif? ( x11-libs/openmotif ) 42 motif? ( >=x11-libs/openmotif-2.3:0 )
41 png? ( >=media-libs/libpng-1.2.2 ) 43 png? ( >=media-libs/libpng-1.2.2 )
44 postgres? ( || (
42 postgres? ( >=dev-db/postgresql-base-8.3 ) 45 >=dev-db/postgresql-base-8.0
46 >=dev-db/postgresql-server-8.0 )
47 )
43 python? ( dev-lang/python ) 48 python? ( dev-lang/python )
44 readline? ( sys-libs/readline ) 49 readline? ( sys-libs/readline )
45 sqlite? ( dev-db/sqlite ) 50 sqlite? ( dev-db/sqlite )
46 tiff? ( >=media-libs/tiff-3.5.7 ) 51 tiff? ( >=media-libs/tiff-3.5.7 )
47 truetype? ( >=media-libs/freetype-2.0 ) 52 truetype? ( >=media-libs/freetype-2.0 )
48 wxwindows? ( 53 wxwidgets? (
49 >=dev-python/wxpython-2.8.1.1 54 >=dev-python/wxpython-2.8.1.1
50 >=dev-lang/python-2.4 55 >=dev-lang/python-2.4
51 ) 56 )
52 X? ( 57 X? (
53 x11-libs/libXmu 58 x11-libs/libXmu
64 )" 69 )"
65 70
66DEPEND="${RDEPEND} 71DEPEND="${RDEPEND}
67 >=sys-devel/flex-2.5.4a 72 >=sys-devel/flex-2.5.4a
68 >=sys-devel/bison-1.35 73 >=sys-devel/bison-1.35
69 wxwindows? ( >=dev-lang/swig-1.3.31 ) 74 wxwidgets? ( >=dev-lang/swig-1.3.31 )
70 X? ( 75 X? (
71 x11-proto/xproto 76 x11-proto/xproto
72 x11-proto/xextproto 77 x11-proto/xextproto
73 )" 78 )"
74 79
75pkg_setup() { 80pkg_setup() {
76 local myblas 81 local myblas
77 elog "" 82 elog ""
78 elog "This version enables the experimental wxpython interface, which" 83 elog "This version enables the experimental wxpython interface, which"
79 elog "you may want to try. If the legacy GUI seems a little wonky in" 84 elog "you may want to try. If the legacy GUI seems a little wonky in"
80 elog "this version, just enable the wxwindows USE flag and rebuild" 85 elog "this version, just enable the wxwidgets USE flag and rebuild"
81 elog "grass to use it." 86 elog "grass to use it."
82 elog "" 87 elog ""
83 if use gmath; then 88 if use gmath; then
84 for d in $(eselect lapack show); do myblas=${d}; done 89 for d in $(eselect lapack show); do myblas=${d}; done
85 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then 90 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
101 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)."
102 die "Please set the X useflag." 107 die "Please set the X useflag."
103 fi 108 fi
104} 109}
105 110
106src_unpack() { 111src_prepare() {
107 unpack ${A}
108 cd "${S}"
109
110 epatch rpm/fedora/grass-readline.patch 112 epatch rpm/fedora/grass-readline.patch
111 # fix the fortify_source and buffer issues (see bug #261283) 113 # fix the fortify_source and buffer issues (see bug #261283)
112 epatch "${FILESDIR}"/${P}-o_creat.patch 114 epatch "${FILESDIR}"/${P}-o_creat.patch
115 # and update for gcc 4.4 C++ changes (see bug #270916)
116 epatch "${FILESDIR}"/${P}-gcc44.patch
117
113 sed -i -e "s:buff\[12:buff\[16:g" general/g.parser/main.c \ 118 sed -i -e "s:buff\[12:buff\[16:g" general/g.parser/main.c \
114 || die "sed failed" 119 || die "sed failed"
115 120
116 if ! use opengl; then 121 if ! use opengl; then
117 epatch "${FILESDIR}"/${P}-html-nonviz.patch 122 epatch "${FILESDIR}"/${P}-html-nonviz.patch
120 # patch missing math functions (yes, this is still needed) 125 # patch missing math functions (yes, this is still needed)
121 sed -i -e "s:\$(EXTRA_LIBS):\$(EXTRA_LIBS) \$(MATHLIB):g" include/Make/Shlib.make 126 sed -i -e "s:\$(EXTRA_LIBS):\$(EXTRA_LIBS) \$(MATHLIB):g" include/Make/Shlib.make
122 echo "MATHLIB=-lm" >> include/Make/Rules.make 127 echo "MATHLIB=-lm" >> include/Make/Rules.make
123} 128}
124 129
125src_compile() { 130src_configure() {
126 local myconf 131 local myconf
127 # wxwindows needs python (see bug #237495) 132 addpredict /var/cache/fontconfig
128 use wxwindows && distutils_python_version
129 133
130 myconf="--prefix=/usr --with-cxx --enable-shared \ 134 myconf="--prefix=/usr --with-cxx --enable-shared \
131 --with-gdal=$(type -P gdal-config) --with-curses --with-proj \ 135 --with-gdal=$(type -P gdal-config) --with-curses --with-proj \
132 --with-includes=/usr/include --with-libs=/usr/$(get_libdir) \ 136 --with-includes=/usr/include --with-libs=/usr/$(get_libdir) \
133 --with-proj-includes=/usr/include \ 137 --with-proj-includes=/usr/include \
142 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.4" 146 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.4"
143 fi 147 fi
144 myconf="${myconf} --with-tcltk --with-x \ 148 myconf="${myconf} --with-tcltk --with-x \
145 --with-tcltk-includes=/usr/include \ 149 --with-tcltk-includes=/usr/include \
146 --with-tcltk-libs=${TCL_LIBDIR}" 150 --with-tcltk-libs=${TCL_LIBDIR}"
147 if use wxwindows; then 151 if use wxwidgets; then
148 WX_GTK_VER=2.8 152 WX_GTK_VER=2.8
149 need-wxwidgets unicode 153 need-wxwidgets unicode
150 # The following lib should be there, based on the above and the 154 # The following lib should be there, based on the above and the
151 # wxpython dependency (in theory). I still need a good way to 155 # wxpython dependency (in theory). I still need a good way to
152 # query for the location... 156 # query for the location...
153 LIBGDI="/usr/$(get_libdir)/python${PYVER}/site-packages/wx-${WX_GTK_VER}-gtk2-unicode/wx/_gdi_.so" 157 LIBGDI="$(python_get_sitedir)/wx-${WX_GTK_VER}-gtk2-unicode/wx/_gdi_.so"
154 myconf="${myconf} --with-python --with-wxwidgets=${WX_CONFIG}" 158 myconf="${myconf} --with-python --with-wxwidgets=${WX_CONFIG}"
155 else 159 else
156 # USE=python must be enabled above if wxwindows is enabled 160 # USE=python must be enabled above if wxwidgets is enabled
157 myconf="${myconf} $(use_with python) --without-wxwidgets" 161 myconf="${myconf} $(use_with python) --without-wxwidgets"
158 fi 162 fi
159 else 163 else
160 myconf="${myconf} --without-tcltk --without-x" 164 myconf="${myconf} --without-tcltk --without-x"
161 fi 165 fi
169 # Should handle either older or latest without intervention; 173 # Should handle either older or latest without intervention;
170 # this won't work forever, but it should be okay for a while... 174 # this won't work forever, but it should be okay for a while...
171 if use ffmpeg; then 175 if use ffmpeg; then
172 myconf="${myconf} --with-ffmpeg \ 176 myconf="${myconf} --with-ffmpeg \
173 --with-ffmpeg-libs=/usr/$(get_libdir)" 177 --with-ffmpeg-libs=/usr/$(get_libdir)"
174 if has_version ">=media-video/ffmpeg-0.4.9_p20080326" ; then
175 # must pass multiple include dirs now; if you have a better
176 # way to do this, please speak up and file a bug :)
177 myconf="${myconf} --with-ffmpeg-includes=/usr/include/libav*" 178 myconf="${myconf} --with-ffmpeg-includes=/usr/include/libav*"
178 else
179 myconf="${myconf} --with-ffmpeg-includes=/usr/include/ffmpeg"
180 fi
181 else 179 else
182 myconf="${myconf} --without-ffmpeg" 180 myconf="${myconf} --without-ffmpeg"
183 fi 181 fi
184 182
185 if use truetype; then 183 if use truetype; then
205 $(use_enable amd64 64bit) \ 203 $(use_enable amd64 64bit) \
206 $(use_with fftw) \ 204 $(use_with fftw) \
207 $(use_with gmath blas) \ 205 $(use_with gmath blas) \
208 $(use_with gmath lapack) \ 206 $(use_with gmath lapack) \
209 $(use_with jpeg) \ 207 $(use_with jpeg) \
210 $(use_enable largefile) \
211 $(use_with motif) \ 208 $(use_with motif) \
212 $(use_with nls) \ 209 $(use_with nls) \
213 $(use_with odbc) \ 210 $(use_with odbc) \
214 $(use_with png) \ 211 $(use_with png) \
215 $(use_with postgres) \ 212 $(use_with postgres) \
216 $(use_with readline) \ 213 $(use_with readline) \
217 $(use_with tiff) || die "configure failed!" 214 $(use_with tiff) \
215 --enable-largefile
216}
218 217
218src_compile() {
219 if use wxwindows; then 219 if use wxwidgets; then
220 # can't use die here since we need to hack the vdigit build 220 # can't use die here since we need to hack the vdigit build
221 emake -j1 221 emake -j1
222 ln -sf "${LIBGDI}" dist.${CHOST}/lib/libgdi.so \ 222 ln -sf "${LIBGDI}" dist.${CHOST}/lib/libgdi.so \
223 || die "making libgdi link failed" 223 || die "making libgdi link failed"
224 cd gui/wxpython/vdigit 224 cd gui/wxpython/vdigit
233 elog "Grass Home is ${MY_PM}" 233 elog "Grass Home is ${MY_PM}"
234 make install UNIX_BIN="${D}"usr/bin BINDIR="${D}"usr/bin \ 234 make install UNIX_BIN="${D}"usr/bin BINDIR="${D}"usr/bin \
235 PREFIX="${D}"usr INST_DIR="${D}"usr/${MY_PM} \ 235 PREFIX="${D}"usr INST_DIR="${D}"usr/${MY_PM} \
236 || die "make install failed!" 236 || die "make install failed!"
237 237
238 if use wxwindows; then 238 if use wxwidgets; then
239 ln -sf "${LIBGDI}" "${D}"usr/${MY_PM}/lib/libgdi.so \ 239 ln -sf "${LIBGDI}" "${D}"usr/${MY_PM}/lib/libgdi.so \
240 || die "failed to find wx library" 240 || die "failed to find wx library"
241 fi 241 fi
242 242
243 # get rid of DESTDIR in script path 243 # get rid of DESTDIR in script path
267 use X && fdo-mime_desktop_database_update 267 use X && fdo-mime_desktop_database_update
268} 268}
269 269
270generate_files() { 270generate_files() {
271 local GUI="-gui" 271 local GUI="-gui"
272 use wxwindows && GUI="-wxpython" 272 use wxwidgets && GUI="-wxpython"
273 273
274 cat <<-EOF > 99grass-6 274 cat <<-EOF > 99grass-6
275 GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib" 275 GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib"
276 LDPATH="/usr/${MY_PM}/lib" 276 LDPATH="/usr/${MY_PM}/lib"
277 MANPATH="/usr/${MY_PM}/man" 277 MANPATH="/usr/${MY_PM}/man"
282 [Desktop Entry] 282 [Desktop Entry]
283 Encoding=UTF-8 283 Encoding=UTF-8
284 Version=1.0 284 Version=1.0
285 Name=Grass ${PV} 285 Name=Grass ${PV}
286 Type=Application 286 Type=Application
287 Comment=GRASS Open Source GIS, derived from the original US Army Corps of Engineers project. 287 Comment=GRASS (Geographic Resources Analysis Support System), the original GIS.
288 Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI} 288 Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI}
289 Path= 289 Path=
290 Icon=grass_icon.png 290 Icon=grass_icon.png
291 Categories=Science;Education; 291 Categories=Science;Education;
292 Terminal=true 292 Terminal=false
293 EOF 293 EOF
294} 294}

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.20