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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (hide annotations) (download)
Sat Apr 21 09:09:00 2012 UTC (7 years, 10 months ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
Add libav-0.8 patch to build with new ffmpeg variants. Remove older and stabilise revision on all archs as only change is rename of one file. Fixes bug#390827 and bug#392371.

(Portage version: 2.2.0_alpha100/cvs/Linux x86_64)

1 jlec 1.10 # Copyright 1999-2012 Gentoo Foundation
2 scarabeus 1.1 # Distributed under the terms of the GNU General Public License v2
3 scarabeus 1.11 # $Header: /var/cvsroot/gentoo-x86/sci-geosciences/grass/grass-6.4.1.ebuild,v 1.10 2012/03/04 09:50:16 jlec Exp $
4 scarabeus 1.1
5 scarabeus 1.3 EAPI=3
6 scarabeus 1.1
7     PYTHON_DEPEND="python? 2"
8    
9     inherit eutils gnome2 multilib python versionator wxwidgets base
10    
11     MY_PM=${PN}$(get_version_component_range 1-2 ${PV})
12     MY_PM=${MY_PM/.}
13     MY_P=${P/_rc/RC}
14    
15     DESCRIPTION="A free GIS with raster and vector functionality, as well as 3D vizualization"
16     HOMEPAGE="http://grass.osgeo.org/"
17     SRC_URI="http://grass.osgeo.org/${MY_PM}/source/${MY_P}.tar.gz"
18    
19     LICENSE="GPL-2"
20     SLOT="6"
21 maekke 1.6 KEYWORDS="amd64 ppc ~ppc64 x86"
22 scarabeus 1.1 IUSE="X cairo cxx ffmpeg fftw gmath jpeg motif mysql nls odbc opengl png postgres python readline sqlite tiff truetype wxwidgets"
23    
24     TCL_DEPS="
25     >=dev-lang/tcl-8.5
26     >=dev-lang/tk-8.5"
27    
28     RDEPEND="
29     >=app-admin/eselect-1.2
30     sci-libs/gdal
31     sci-libs/proj
32     sys-libs/gdbm
33     sys-libs/ncurses
34     sys-libs/zlib
35     cairo? ( x11-libs/cairo[X?,opengl?] )
36     ffmpeg? ( virtual/ffmpeg )
37     fftw? ( sci-libs/fftw:3.0 )
38     gmath? (
39     virtual/blas
40     virtual/lapack
41     )
42     jpeg? ( virtual/jpeg )
43     mysql? ( virtual/mysql )
44     odbc? ( dev-db/unixODBC )
45     png? ( media-libs/libpng )
46 scarabeus 1.3 postgres? ( >=dev-db/postgresql-base-8.4 )
47 scarabeus 1.1 readline? ( sys-libs/readline )
48     sqlite? ( dev-db/sqlite:3 )
49 scarabeus 1.3 tiff? ( media-libs/tiff )
50 scarabeus 1.1 truetype? ( media-libs/freetype:2 )
51     X? (
52     x11-libs/libICE
53     x11-libs/libSM
54     x11-libs/libX11
55     x11-libs/libXaw
56     x11-libs/libXext
57     x11-libs/libXmu
58     x11-libs/libXp
59     x11-libs/libXpm
60     x11-libs/libXt
61     motif? (
62     >=x11-libs/openmotif-2.3:0
63 jlec 1.10 opengl? (
64     || (
65     media-libs/mesa[motif]
66     ( media-libs/mesa x11-libs/libGLw ) ) )
67 scarabeus 1.1 )
68     opengl? (
69     virtual/opengl
70     ${TCL_DEPS}
71     )
72     python? ( wxwidgets? ( >=dev-python/wxpython-2.8.10.1[cairo,opengl?] ) )
73     !python? ( ${TCL_DEPS} )
74     !wxwidgets? ( ${TCL_DEPS} )
75     )"
76    
77     DEPEND="${RDEPEND}
78     dev-util/pkgconfig
79     sys-devel/flex
80     sys-devel/gettext
81     sys-devel/bison
82     X? (
83     x11-proto/xextproto
84     x11-proto/xproto
85     python? ( wxwidgets? ( dev-lang/swig ) )
86     )"
87    
88     S="${WORKDIR}/${MY_P}"
89    
90     PATCHES=(
91 ssuominen 1.8 "${FILESDIR}"/${PN}-pkgconf.patch
92     "${FILESDIR}"/${P}-libpng15.patch
93 nerdboy 1.9 "${FILESDIR}"/${P}-nopycompile.patch
94     "${FILESDIR}"/${P}-timer_flags.patch
95 scarabeus 1.1 )
96    
97     pkg_setup() {
98     local myblas
99    
100     # check correct gmath profiles (this must sadly die)
101     if use gmath; then
102     for d in $(eselect lapack show); do myblas=${d}; done
103     if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
104     ewarn "You need to set lapack to atlas or reference. Do:"
105     ewarn " eselect lapack set <impl>"
106     ewarn "where <impl> is atlas, threaded-atlas or reference"
107     die "setup failed"
108     fi
109     for d in $(eselect blas show); do myblas=${d}; done
110     if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
111     ewarn "You need to set blas to atlas or reference. Do:"
112     ewarn " eselect blas set <impl>"
113     ewarn "where <impl> is atlas, threaded-atlas or reference"
114     die "setup failed"
115     fi
116     fi
117    
118     # check useflag nesting.
119     use motif && ! use X && ewarn "For motif support X useflag must be enabled"
120     use opengl && ! use X && ewarn "For opengl support X useflag must be enabled"
121     use wxwidgets && ! use X && ewarn "For wxwidgets support X useflag must be enabled"
122     use wxwidgets && ! use python && ewarn "For wxwidgets support python useflag must be enabled"
123    
124     if use python; then
125     # only py2 is supported
126     python_set_active_version 2
127     fi
128     }
129    
130     src_prepare() {
131 scarabeus 1.3 use opengl || epatch "${FILESDIR}"/${PN}-6.4.0-html-nonviz.patch
132 scarabeus 1.1 base_src_prepare
133     }
134    
135     src_configure() {
136     local myconf TCL_LIBDIR
137    
138     if use X; then
139     TCL_LIBDIR="/usr/$(get_libdir)/tcl8.5"
140     myconf+="
141     --with-tcltk-libs=${TCL_LIBDIR}
142     $(use_with motif)
143     $(use_with opengl)
144     --with-x
145     "
146    
147     if use python && use wxwidgets; then
148     WX_BUILD=yes
149     WX_GTK_VER=2.8
150     need-wxwidgets unicode
151     myconf+="
152     --without-tcltk
153     --with-wxwidgets=${WX_CONFIG}
154     "
155     else
156     WX_BUILD=no
157     # use tcl gui if wxwidgets are disabled
158     myconf+="
159     --with-tcltk
160     --without-wxwidgets
161     "
162     fi
163    
164     use opengl && myconf+=" --with-tcltk"
165     use motif && use opengl && myconf+=" --with-glw"
166     use motif || myconf+=" --without-glw"
167     else
168     myconf+="
169     --without-opengl
170     --without-glw
171     --without-tcltk
172     --without-wxwidgets
173     --without-x
174     "
175     fi
176    
177     econf \
178     --with-gdal=$(type -P gdal-config) \
179     --with-curses \
180     --with-proj \
181     --with-proj-share="/usr/share/proj/" \
182     --without-glw \
183     --enable-shared \
184     $(use_enable amd64 64bit) \
185     $(use_enable ppc64 64bit) \
186     $(use_with cairo) \
187     $(use_with cxx) \
188     $(use_with fftw) \
189     $(use_with ffmpeg) \
190     --with-ffmpeg-includes="/usr/include/libavcodec /usr/include/libavdevice /usr/include/libavfilter /usr/include/libavformat /usr/include/libavutil /usr/include/libpostproc /usr/include/libswscale" \
191     $(use_with gmath blas) \
192     $(use_with gmath lapack) \
193     $(use_with jpeg) \
194     $(use_with mysql) \
195     --with-mysql-includes=/usr/include/mysql \
196     --with-mysql-libs=/usr/$(get_libdir)/mysql \
197     $(use_with nls) \
198     $(use_with odbc) \
199     $(use_with png) \
200     $(use_with postgres) \
201     $(use_with python) \
202     $(use_with readline) \
203     $(use_with sqlite) \
204     $(use_with tiff) \
205     $(use_with truetype freetype) \
206     --with-freetype-includes="/usr/include/freetype2/" \
207     --enable-largefile \
208     ${myconf}
209     }
210    
211     src_compile() {
212     # we don't want to link against embeded mysql lib
213     base_src_compile MYSQLDLIB=""
214     }
215    
216     src_install() {
217     emake DESTDIR="${D}" \
218     INST_DIR="${D}"/usr/${MY_PM} \
219     prefix="${D}"/usr BINDIR="${D}"/usr/bin \
220     PREFIX="${D}"/usr/ \
221     install || die
222    
223     pushd "${D}"/usr/${MY_PM} &> /dev/null
224    
225     # fix docs
226     dodoc AUTHORS CHANGES || die
227     dohtml -r docs/html/* || die
228     rm -rf docs/ || die
229     rm -rf {AUTHORS,CHANGES,COPYING,GPL.TXT,REQUIREMENTS.html} || die
230    
231     # manuals
232     dodir /usr/share/man/man1 || die
233     mv man/man1/* "${D}"/usr/share/man/man1/ || die
234     rm -rf man/ || die
235    
236     # translations
237     if use nls; then
238     dodir /usr/share/locale/ || die
239     mv locale/* "${D}"/usr/share/locale/ || die
240     rm -rf locale/ || die
241     # pt_BR is broken
242     mv "${D}"/usr/share/locale/pt_br "${D}"/usr/share/locale/pt_BR || die
243     fi
244    
245     popd &> /dev/null
246    
247     # place libraries where they belong
248     mv "${D}"/usr/${MY_PM}/lib/ "${D}"/usr/$(get_libdir)/ || die
249    
250     # place header files where they belong
251     mv "${D}"/usr/${MY_PM}/include/ "${D}"/usr/include/ || die
252     # make rules are not required on installed system
253     rm -rf "${D}"/usr/include/Make || die
254    
255     # mv remaining gisbase stuff to libdir
256     mv "${D}"/usr/${MY_PM} "${D}"/usr/$(get_libdir) || die
257    
258     # set proper default window renderer
259     if [[ ${WX_BUILD} == yes ]]; then
260     sed -i \
261     -e "1,\$s:^DEFAULT_GUI.*:DEFAULT_GUI=\"wxpython\":" \
262     "${D}"/usr/$(get_libdir)/${MY_PM}/etc/Init.sh || die
263     fi
264    
265     # get proper folder for grass path in script
266     sed -i \
267     -e "1,\$s:^GISBASE.*:GISBASE=/usr/$(get_libdir)/${MY_PM}:" \
268     "${D}"usr/bin/${MY_PM} || die
269    
270     # get proper fonts path for fontcap
271     sed -i \
272     -e "s|${D}/usr/${MY_PM}|/usr/$(get_libdir)/${MY_PM}|" \
273     "${D}"/usr/$(get_libdir)/${MY_PM}/etc/fontcap || die
274    
275     if use X; then
276     generate_files
277     doicon gui/icons/${PN}-48x48.png || die
278     domenu ${MY_PM}-grass.desktop || die
279     fi
280    
281     # install .pc file so other apps know where to look for grass
282     insinto /usr/$(get_libdir)/pkgconfig/
283     doins grass.pc || die
284    
285     # fix weird +x on tcl scripts
286     find "${D}" -name "*.tcl" -exec chmod +r-x '{}' \;
287     }
288    
289     pkg_postinst() {
290     if use X; then
291     fdo-mime_desktop_database_update
292     gnome2_icon_cache_update
293     fi
294     }
295    
296     pkg_postrm() {
297     if use X; then
298     fdo-mime_desktop_database_update
299     gnome2_icon_cache_update
300     fi
301     }
302    
303     generate_files() {
304     local GUI="-gui"
305     [[ ${WX_BUILD} == yes ]] && GUI="-wxpython"
306    
307     cat <<-EOF > ${MY_PM}-grass.desktop
308     [Desktop Entry]
309     Encoding=UTF-8
310     Version=1.0
311     Name=Grass ${PV}
312     Type=Application
313     Comment=GRASS (Geographic Resources Analysis Support System), the original GIS.
314     Exec=${TERM} -T Grass -e /usr/bin/${MY_PM} ${GUI}
315     Path=
316     Icon=${PN}-48x48.png
317     Categories=Science;Education;
318     Terminal=false
319 scarabeus 1.3 EOF
320 scarabeus 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20