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

Contents of /sci-geosciences/grass/grass-6.2.3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations) (download)
Sat Dec 13 17:29:58 2008 UTC (11 years, 3 months ago) by ssuominen
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
old
(Portage version: 2.1.6/cvs/Linux 2.6.27.7 i686)

1 nerdboy 1.1 # Copyright 1999-2008 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 ssuominen 1.10 # $Header: /var/cvsroot/gentoo-x86/sci-geosciences/grass/grass-6.2.3.ebuild,v 1.9 2008/08/14 07:07:57 nerdboy Exp $
4 nerdboy 1.1
5 nerdboy 1.8 inherit eutils fdo-mime versionator
6 nerdboy 1.1
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     DESCRIPTION="An open-source GIS with raster and vector functionality, as well as 3D vizualization."
12     HOMEPAGE="http://grass.itc.it/"
13     SRC_URI="http://grass.itc.it/${MY_PM}/source/${P}.tar.gz"
14    
15     LICENSE="GPL-2"
16 nerdboy 1.9 SLOT="6"
17 nerdboy 1.1 KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
18    
19     IUSE="ffmpeg fftw glw gmath jpeg largefile mysql nls odbc opengl png \
20     postgres python readline sqlite tiff truetype X"
21    
22     RESTRICT="strip"
23    
24 nerdboy 1.5 RDEPEND=">=sys-libs/zlib-1.1.4
25 nerdboy 1.1 >=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 nerdboy 1.4 ffmpeg? ( media-video/ffmpeg )
33 nerdboy 1.1 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     opengl? ( ( virtual/opengl )
40     ( x11-libs/openmotif )
41     glw? ( media-libs/mesa ) )
42     png? ( >=media-libs/libpng-1.2.2 )
43 dev-zero 1.7 postgres? ( >=virtual/postgresql-server-7.3 )
44 nerdboy 1.1 python? ( dev-lang/python )
45     readline? ( sys-libs/readline )
46     sqlite? ( dev-db/sqlite )
47     tiff? ( >=media-libs/tiff-3.5.7 )
48     truetype? ( >=media-libs/freetype-2.0 )
49     X? (
50     x11-libs/libXmu
51     x11-libs/libXext
52     x11-libs/libXp
53     x11-libs/libX11
54     x11-libs/libXt
55     x11-libs/libSM
56     x11-libs/libICE
57     x11-libs/libXpm
58     x11-libs/libXaw
59     >=dev-lang/tcl-8.4
60     >=dev-lang/tk-8.4
61     )"
62    
63     DEPEND="${RDEPEND}
64 nerdboy 1.5 >=sys-devel/flex-2.5.4a
65     >=sys-devel/bison-1.35
66 nerdboy 1.1 X? (
67     x11-proto/xproto
68     x11-proto/xextproto
69     )"
70    
71     pkg_setup() {
72     local myblas
73     if use gmath; then
74     for d in $(eselect lapack show); do myblas=${d}; done
75     if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
76     ewarn "You need to set lapack to atlas or reference. Do:"
77     ewarn " eselect lapack set <impl>"
78     ewarn "where <impl> is atlas, threaded-atlas or reference"
79     die "setup failed"
80     fi
81     for d in $(eselect blas show); do myblas=${d}; done
82     if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
83     ewarn "You need to set blas to atlas or reference. Do:"
84     ewarn " eselect blas set <impl>"
85     ewarn "where <impl> is atlas, threaded-atlas or reference"
86     die "setup failed"
87     fi
88     fi
89    
90     if use glw && ! use opengl; then
91     ewarn "You set USE='glw -opengl'. GLw support needs OpenGL."
92     ewarn "OpenGL support also requires X."
93     die "Set opengl and X useflags."
94     fi
95    
96     if use glw && ! built_with_use media-libs/mesa motif; then
97     ewarn "GRASS GLw/OpenGL support needs mesa with motif headers."
98     ewarn "Please rebuild mesa with motif support."
99     die "Re-emerge mesa with motif."
100     fi
101    
102     if use opengl && ! use X; then
103     ewarn "GRASS OpenGL support needs X (will also pull in Tcl/Tk)."
104     die "Please set the X useflag."
105     fi
106     }
107    
108     src_unpack() {
109     unpack ${A}
110     cd "${S}"
111    
112     epatch rpm/fedora/grass-readline.patch
113    
114     if use opengl; then
115     epatch "${FILESDIR}"/${P}-html-nviz-fix.patch
116     else
117     epatch "${FILESDIR}"/${P}-html-nonviz.patch
118     fi
119    
120     # patch missing math functions (yes, this is still needed)
121     sed -i -e "s:\$(EXTRA_LIBS):\$(EXTRA_LIBS) \$(MATHLIB):g" include/Make/Shlib.make
122     echo "MATHLIB=-lm" >> include/Make/Rules.make
123     }
124    
125     src_compile() {
126     local myconf
127     myconf="--prefix=/usr --with-cxx --enable-shared \
128     --with-gdal=$(type -P gdal-config) --with-curses --with-proj \
129     --with-includes=/usr/include --with-libs=/usr/$(get_libdir) \
130     --with-proj-includes=/usr/include \
131     --with-proj-libs=/usr/$(get_libdir) \
132     --with-proj-share=/usr/share/proj"
133    
134     if use X; then
135     myconf="${myconf} --with-tcltk --with-x \
136     --with-tcltk-includes=/usr/include \
137     --with-tcltk-libs=/usr/$(get_libdir)/tcl8.4"
138     else
139     myconf="${myconf} --without-tcltk --without-x"
140     fi
141    
142     if use opengl; then
143     myconf="${myconf} --with-opengl --with-opengl-libs=/usr/$(get_libdir)/opengl/xorg-x11/lib"
144     if use glw; then
145     myconf="${myconf} --with-glw"
146     fi
147     else
148     myconf="${myconf} --without-opengl --without-glw"
149     fi
150    
151 nerdboy 1.4 # Should handle either older or latest without intervention;
152     # this won't work forever, but it should be okay for a while...
153 nerdboy 1.1 if use ffmpeg; then
154 nerdboy 1.4 myconf="${myconf} --with-ffmpeg \
155     --with-ffmpeg-libs=/usr/$(get_libdir)"
156 nerdboy 1.6 if has_version ">=media-video/ffmpeg-0.4.9_p20080326" ; then
157 nerdboy 1.9 myconf="${myconf} --with-ffmpeg-includes=/usr/include/libav*"
158 nerdboy 1.4 else
159     myconf="${myconf} --with-ffmpeg-includes=/usr/include/ffmpeg"
160     fi
161 nerdboy 1.1 else
162     myconf="${myconf} --without-ffmpeg"
163     fi
164    
165     if use truetype; then
166     myconf="${myconf} --with-freetype \
167     --with-freetype-includes=/usr/include/freetype2"
168     fi
169    
170     if use mysql; then
171     myconf="${myconf} --with-mysql --with-mysql-includes=/usr/include/mysql \
172     --with-mysql-libs=/usr/$(get_libdir)/mysql"
173     else
174     myconf="${myconf} --without-mysql"
175     fi
176    
177     if use sqlite; then
178     myconf="${myconf} --with-sqlite --with-sqlite-includes=/usr/include
179     --with-sqlite-libs=/usr/$(get_libdir)"
180     else
181     myconf="${myconf} --without-sqlite"
182     fi
183    
184     econf ${myconf} --with-libs=/usr/$(get_libdir) \
185     $(use_enable amd64 64bit) \
186     $(use_with fftw) \
187     $(use_with gmath blas) \
188     $(use_with gmath lapack) \
189     $(use_with jpeg) \
190     $(use_enable largefile) \
191     $(use_with opengl motif) \
192     $(use_with nls) \
193     $(use_with odbc) \
194     $(use_with png) \
195     $(use_with postgres) \
196     $(use_with python) \
197     $(use_with readline) \
198     $(use_with tiff) || die "configure failed!"
199    
200     emake -j1 || die "emake failed!"
201     }
202    
203     src_install() {
204     elog "Grass Home is ${MY_PM}"
205     make install UNIX_BIN="${D}"usr/bin BINDIR="${D}"usr/bin \
206     PREFIX="${D}"usr INST_DIR="${D}"usr/${MY_PM} \
207     || die "make install failed!"
208    
209 nerdboy 1.3 # get rid of DESTDIR in script path
210 nerdboy 1.1 sed -i -e "s@${D}@/@" "${D}"usr/bin/${MY_PM}
211    
212     # Grass Extension Manager conflicts with ruby gems
213     mv "${D}"usr/bin/gem "${D}"usr/${MY_PM}/bin/
214    
215     ebegin "Adding env.d and desktop entry for Grass6..."
216     generate_files
217     doenvd 99grass-6
218     if use X; then
219     doicon "${FILESDIR}"/grass_icon.png
220     domenu ${MY_PM}-grass.desktop
221     fi
222     eend ${?}
223     }
224    
225     pkg_postinst() {
226     use X && fdo-mime_desktop_database_update
227    
228     elog "Note this version re-enables support for threads in Tcl and Tk."
229     elog "Enable the threads USE flag and rebuild to try it."
230     }
231    
232     pkg_postrm() {
233     use X && fdo-mime_desktop_database_update
234     }
235    
236     generate_files() {
237     cat <<-EOF > 99grass-6
238     GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib"
239     LDPATH="/usr/${MY_PM}/lib"
240     MANPATH="/usr/${MY_PM}/man"
241     GRASS_HOME="/usr/${MY_PM}"
242     EOF
243    
244     cat <<-EOF > ${MY_PM}-grass.desktop
245     [Desktop Entry]
246     Encoding=UTF-8
247     Version=1.0
248     Name=Grass ${PV}
249     Type=Application
250     Comment=GRASS Open Source GIS, derived from the original US Army Corps of Engineers project.
251     Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} -gui
252     Path=
253     Icon=grass_icon.png
254     Categories=Science;Education;
255     Terminal=true
256     EOF
257     }

  ViewVC Help
Powered by ViewVC 1.1.20