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

Contents of /sci-geosciences/grass/grass-6.2.1-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Thu May 1 05:19:47 2008 UTC (11 years, 10 months ago) by nerdboy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
updated for testing and stablizing; fixes bugs 217873 and 219764
(Portage version: 2.1.5_rc6)

1 nerdboy 1.1 # Copyright 1999-2008 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 nerdboy 1.4 # $Header: /var/cvsroot/gentoo-x86/sci-geosciences/grass/grass-6.2.1-r1.ebuild,v 1.3 2008/03/22 04:48:19 mr_bones_ Exp $
4 nerdboy 1.1
5     inherit eutils autotools fdo-mime versionator
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     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     SLOT="0"
17 nerdboy 1.2 KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
18 nerdboy 1.1
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     RDEPEND=">=sys-devel/make-3.80
25     >=sys-libs/zlib-1.1.4
26     >=sys-devel/flex-2.5.4a
27     >=sys-devel/bison-1.35
28     >=sys-libs/ncurses-5.3
29     >=sys-libs/gdbm-1.8.0
30     >=sys-devel/gcc-3.2.2
31     || (
32     sys-apps/man
33     sys-apps/man-db )
34     sci-libs/gdal
35     >=sci-libs/proj-4.4.7
36     ffmpeg? ( media-video/ffmpeg )
37     fftw? ( sci-libs/fftw )
38     gmath? ( virtual/blas
39     virtual/lapack )
40     jpeg? ( media-libs/jpeg )
41     mysql? ( dev-db/mysql )
42     odbc? ( >=dev-db/unixODBC-2.0.6 )
43     opengl? ( ( virtual/opengl )
44     ( x11-libs/openmotif )
45     glw? ( media-libs/mesa ) )
46     png? ( >=media-libs/libpng-1.2.2 )
47     postgres? ( >=dev-db/postgresql-7.3 )
48     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     X? (
54     x11-libs/libXmu
55     x11-libs/libXext
56     x11-libs/libXp
57     x11-libs/libX11
58     x11-libs/libXt
59     x11-libs/libSM
60     x11-libs/libICE
61     x11-libs/libXpm
62     x11-libs/libXaw
63     >=dev-lang/tcl-8.4
64     >=dev-lang/tk-8.4
65     )"
66    
67     DEPEND="${RDEPEND}
68     X? (
69     x11-proto/xproto
70     x11-proto/xextproto
71     )"
72    
73     src_unpack() {
74     local myblas
75     if use gmath; then
76     for d in $(eselect lapack show); do myblas=${d}; done
77     if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
78     ewarn "You need to set lapack to atlas or reference. Do:"
79     ewarn " eselect lapack set <impl>"
80     ewarn "where <impl> is atlas, threaded-atlas or reference"
81     die "setup failed"
82     fi
83     for d in $(eselect blas show); do myblas=${d}; done
84     if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
85     ewarn "You need to set blas to atlas or reference. Do:"
86     ewarn " eselect blas set <impl>"
87     ewarn "where <impl> is atlas, threaded-atlas or reference"
88     die "setup failed"
89     fi
90     fi
91    
92     if use glw && ! use opengl; then
93     ewarn "You set USE='glw -opengl'. GLw support needs OpenGL."
94     ewarn "OpenGL support also requires X."
95     die "Set opengl and X useflags."
96     fi
97    
98     if use glw && ! built_with_use media-libs/mesa motif; then
99     ewarn "GRASS GLw/OpenGL support needs mesa with motif headers."
100     ewarn "Please rebuild mesa with motif support."
101     die "Re-emerge mesa with motif."
102     fi
103    
104     if use opengl && ! use X; then
105     ewarn "GRASS OpenGL support needs X (will also pull in Tcl/Tk)."
106     die "Please set the X useflag."
107     fi
108    
109     if use X && built_with_use dev-lang/tcl threads; then
110     ewarn "GRASS nviz will not work with Tcl compiled with threads!"
111     ewarn "Please disable either opengl or tcl threads."
112     die "Emerge TCL without threads."
113     fi
114    
115     if use X && built_with_use dev-lang/tk threads; then
116     ewarn "GRASS nviz will not work with Tk compiled with threads!"
117     ewarn "Please disable either opengl or tk threads."
118     die "Emerge tk without threads."
119     fi
120    
121     unpack ${A}
122     cd "${S}"
123     use ffmpeg && epatch "${FILESDIR}"/${P}-ffmpeg-fix.patch
124     epatch rpm/fedora/grass-readline.patch
125     elibtoolize
126     elog "Grass Home is ${MY_PM}"
127     }
128    
129     src_compile() {
130     local myconf
131     myconf="--prefix=/usr --with-cxx --enable-shared \
132     --with-gdal=$(type -P gdal-config) --with-curses --with-proj \
133     --with-includes=/usr/include --with-libs=/usr/$(get_libdir) \
134     --with-proj-includes=/usr/include \
135     --with-proj-libs=/usr/$(get_libdir) \
136     --with-proj-share=/usr/share/proj"
137    
138     if use X; then
139     myconf="${myconf} --with-tcltk --with-x \
140     --with-tcltk-includes=/usr/include \
141     --with-tcltk-libs=/usr/$(get_libdir)/tcl8.4"
142     else
143     myconf="${myconf} --without-tcltk --without-x"
144     fi
145    
146     if use opengl; then
147     epatch "${FILESDIR}"/${P}-html-nviz-fix.patch
148     myconf="${myconf} --with-opengl --with-opengl-libs=/usr/$(get_libdir)/opengl/xorg-x11/lib"
149     if use glw; then
150     myconf="${myconf} --with-glw"
151     fi
152     else
153     epatch "${FILESDIR}"/${P}-html-nonviz.patch
154     myconf="${myconf} --without-opengl --without-glw"
155     fi
156    
157     if use ffmpeg; then
158     myconf="${myconf} --with-ffmpeg --with-ffmpeg-includes=/usr/include/ffmpeg \
159     --with-ffmpeg-libs=/usr/$(get_libdir)"
160     else
161     myconf="${myconf} --without-ffmpeg"
162     fi
163    
164     if use truetype; then
165     myconf="${myconf} --with-freetype \
166     --with-freetype-includes=/usr/include/freetype2"
167     fi
168    
169     if use mysql; then
170     myconf="${myconf} --with-mysql --with-mysql-includes=/usr/include/mysql \
171     --with-mysql-libs=/usr/$(get_libdir)/mysql"
172     else
173     myconf="${myconf} --without-mysql"
174     fi
175    
176     if use sqlite; then
177     myconf="${myconf} --with-sqlite --with-sqlite-includes=/usr/include
178     --with-sqlite-libs=/usr/$(get_libdir)"
179     else
180     myconf="${myconf} --without-sqlite"
181     fi
182    
183     econf ${myconf} --with-libs=/usr/$(get_libdir) \
184     $(use_enable amd64 64bit) \
185     $(use_with fftw) \
186     $(use_with jpeg) \
187     $(use_enable largefile) \
188     $(use_with opengl motif) \
189     $(use_with nls) \
190     $(use_with odbc) \
191     $(use_with png) \
192     $(use_with postgres) \
193     $(use_with python) \
194     $(use_with readline) \
195     $(use_with tiff) || die "configure failed!"
196     # patch missing math functions
197     sed -i -e "s:EXTRA_LIBS=:EXTRA_LIBS=-lm :g" "${S}"/lib/gmath/Makefile
198     sed -i -e "s:EXTRA_LIBS = :EXTRA_LIBS = -lm :g" "${S}"/lib/gis/Makefile
199    
200     emake -j1 || die "emake failed!"
201     }
202    
203     src_install() {
204     make install UNIX_BIN="${D}"usr/bin BINDIR="${D}"usr/bin \
205     PREFIX="${D}"usr INST_DIR="${D}"usr/${MY_PM} \
206     || die "make install failed!"
207    
208     # This is now generated in the function below
209     rm "${D}"usr/bin/grass62
210    
211     # Grass Extension Manager conflicts with ruby gems
212     mv "${D}"usr/bin/gem "${D}"usr/${MY_PM}/bin/
213    
214     ebegin "Adding env.d and desktop entry for Grass6..."
215     generate_files
216     doenvd 99grass-6
217     dobin ${MY_PM}.sh
218 nerdboy 1.2 if use X; then
219     doicon "${FILESDIR}"/grass_icon.png
220     domenu ${MY_PM}-grass.desktop
221     fi
222 nerdboy 1.1 eend ${?}
223     }
224    
225     pkg_postinst() {
226 nerdboy 1.2 use X && fdo-mime_desktop_database_update
227 nerdboy 1.1 }
228    
229     pkg_postrm() {
230 nerdboy 1.2 use X && fdo-mime_desktop_database_update
231 nerdboy 1.1 }
232    
233     generate_files() {
234     cat <<-EOF > 99grass-6
235     GRASS_LD_LIBRARY_PATH="/usr/${MY_PM}/lib"
236     LDPATH="/usr/${MY_PM}/lib"
237     MANPATH="/usr/${MY_PM}/man"
238     GRASS_HOME="/usr/${MY_PM}"
239     EOF
240    
241     cat <<-EOF > grass62.sh
242     ######################################################################
243     # MODULE: GRASS Initialization
244     # AUTHOR(S): Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th
245     # COPYRIGHT: (C) 2000-2005 by the GRASS Development Team
246 mr_bones_ 1.3 # This program is free software under the GNU General Public License
247 nerdboy 1.1 # (>=v2)
248     #
249     trap "echo 'User break!' ; exit" 2 3 9 15
250     #
251     # Set the GISBASE variable; all arguments are passed to Init.sh
252     GISBASE=/usr/${MY_PM}
253     export GISBASE
254     exec "\$GISBASE/etc/Init.sh" "\$@"
255     EOF
256    
257     cat <<-EOF > ${MY_PM}-grass.desktop
258     [Desktop Entry]
259     Encoding=UTF-8
260     Version=1.0
261     Name=Grass ${PV}
262     Type=Application
263     Comment=GRASS Open Source GIS, derived from the original US Army Corps of Engineers project.
264     Exec=${TERM} -T Grass -e /usr/bin/${MY_PM}.sh -gui
265     Path=
266     Icon=grass_icon.png
267     Categories=Science;Education;
268     Terminal=true
269     EOF
270     }

  ViewVC Help
Powered by ViewVC 1.1.20