/[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.13 - (hide annotations) (download)
Sun Dec 28 16:47:14 2014 UTC (5 years, 1 month ago) by titanofold
Branch: MAIN
Changes since 1.12: +2 -2 lines
Rename virtual/postgresql to dev-db/postgresql

(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key D1BBFDA0)

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

  ViewVC Help
Powered by ViewVC 1.1.20