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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (hide annotations) (download)
Fri Mar 20 15:24:07 2015 UTC (4 years, 11 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +9 -8 lines
Fix tcl/tk slotting

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)

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

  ViewVC Help
Powered by ViewVC 1.1.20