Gentoo Archives: gentoo-commits

From: Sam Jorna <wraeth@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-geosciences/grass/
Date: Wed, 30 Nov 2016 02:29:25
Message-Id: 1480472929.667b2671b03ab82506bd58e05853a15baab6f5c1.wraeth@gentoo
1 commit: 667b2671b03ab82506bd58e05853a15baab6f5c1
2 Author: Sam Jorna <wraeth <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 30 02:28:41 2016 +0000
4 Commit: Sam Jorna <wraeth <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 30 02:28:49 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=667b2671
7
8 sci-geosciences/grass: use wxGTK:3.0 per #600986
9
10 Now builds against wxGTK:3.0 as per the bug. Bumped to EAPI 6,
11 corrected subslot.
12
13 Gentoo-Bug: 600986
14 Package-Manager: portage-2.3.2
15
16 sci-geosciences/grass/grass-7.0.5-r1.ebuild | 271 ++++++++++++++++++++++++++++
17 1 file changed, 271 insertions(+)
18
19 diff --git a/sci-geosciences/grass/grass-7.0.5-r1.ebuild b/sci-geosciences/grass/grass-7.0.5-r1.ebuild
20 new file mode 100644
21 index 00000000..7fb913c
22 --- /dev/null
23 +++ b/sci-geosciences/grass/grass-7.0.5-r1.ebuild
24 @@ -0,0 +1,271 @@
25 +# Copyright 1999-2016 Gentoo Foundation
26 +# Distributed under the terms of the GNU General Public License v2
27 +# $Id$
28 +
29 +EAPI=6
30 +
31 +PYTHON_COMPAT=( python2_7 )
32 +PYTHON_REQ_USE="sqlite" # bug 572440
33 +WANT_AUTOCONF="2.1"
34 +WX_GTK_VER=3.0
35 +
36 +inherit eutils gnome2 fdo-mime multilib python-single-r1 versionator wxwidgets autotools
37 +
38 +MY_PM=${PN}$(get_version_component_range 1-2 ${PV})
39 +MY_PM=${MY_PM/.}
40 +MY_P=${P/_rc/RC}
41 +
42 +DESCRIPTION="A free GIS with raster and vector functionality, as well as 3D vizualization"
43 +HOMEPAGE="http://grass.osgeo.org/"
44 +SRC_URI="http://grass.osgeo.org/${MY_PM}/source/${MY_P}.tar.gz"
45 +
46 +LICENSE="GPL-2"
47 +SLOT="0/7.0.5"
48 +KEYWORDS="~amd64 ~x86"
49 +IUSE="X blas cxx fftw geos lapack liblas mysql netcdf nls odbc opencl opengl openmp png postgres readline sqlite threads tiff truetype"
50 +
51 +RDEPEND="${PYTHON_DEPS}
52 + >=app-admin/eselect-1.2
53 + dev-python/numpy[${PYTHON_USEDEP}]
54 + media-libs/libprojectm
55 + sci-libs/proj
56 + sci-libs/xdrfile
57 + sci-libs/gdal
58 + sys-libs/gdbm
59 + sys-libs/ncurses:0=
60 + sys-libs/zlib
61 + fftw? ( sci-libs/fftw:3.0 )
62 + geos? ( sci-libs/geos )
63 + blas? ( virtual/blas
64 + sci-libs/cblas-reference )
65 + lapack? ( virtual/lapack )
66 + liblas? ( sci-geosciences/liblas )
67 + mysql? ( virtual/mysql )
68 + netcdf? ( sci-libs/netcdf )
69 + odbc? ( dev-db/unixODBC )
70 + opencl? ( virtual/opencl )
71 + opengl? ( virtual/opengl )
72 + png? ( media-libs/libpng:0= )
73 + postgres? ( >=dev-db/postgresql-8.4:= )
74 + readline? ( sys-libs/readline:0= )
75 + sqlite? ( dev-db/sqlite:3 )
76 + tiff? ( media-libs/tiff:0= )
77 + truetype? ( media-libs/freetype:2 )
78 + X? (
79 + dev-python/wxpython:3.0[cairo,opengl?]
80 + x11-libs/cairo[X,opengl?]
81 + x11-libs/libICE
82 + x11-libs/libSM
83 + x11-libs/libX11
84 + x11-libs/libXaw
85 + x11-libs/libXext
86 + x11-libs/libXmu
87 + x11-libs/libXp
88 + x11-libs/libXpm
89 + x11-libs/libXt
90 + )"
91 +
92 +DEPEND="${RDEPEND}
93 + virtual/pkgconfig
94 + sys-devel/flex
95 + sys-devel/gettext
96 + sys-devel/bison
97 + X? (
98 + dev-lang/swig
99 + x11-proto/xextproto
100 + x11-proto/xproto
101 + )"
102 +
103 +S="${WORKDIR}/${MY_P}"
104 +
105 +REQUIRED_USE="
106 + ${PYTHON_REQUIRED_USE}
107 + opengl? ( X )"
108 +
109 +PATCHES=(
110 + "${FILESDIR}/${PN}"-7.0.1-declare-inespg.patch
111 +)
112 +
113 +pkg_setup() {
114 + if use lapack; then
115 + local mylapack
116 + mylapack=$(eselect lapack show) || die
117 + if [[ -z "${mylapack/.*reference.*/}" ]] && \
118 + [[ -z "${mylapack/.*atlas.*/}" ]]; then
119 + ewarn "You need to set lapack to atlas or reference. Do:"
120 + ewarn " eselect lapack set <impl>"
121 + ewarn "where <impl> is atlas, threaded-atlas or reference"
122 + die "setup failed"
123 + fi
124 + fi
125 +
126 + if use blas; then
127 + local myblas
128 + myblas=$(eselect blas show) || die
129 + if [[ -z "${myblas/.*reference.*/}" ]] && \
130 + [[ -z "${myblas/.*atlas.*/}" ]]; then
131 + ewarn "You need to set blas to atlas or reference. Do:"
132 + ewarn " eselect blas set <impl>"
133 + ewarn "where <impl> is atlas, threaded-atlas or reference"
134 + die "setup failed"
135 + fi
136 + fi
137 +
138 + python-single-r1_pkg_setup
139 +}
140 +
141 +src_prepare() {
142 + # Fix unversioned python calls
143 + local pyver=${EPYTHON/python/}
144 + sed -e "s:GRASS_PYTHON=.*:&${pyver}:" -i "${S}/lib/init/grass.sh" || die
145 + sed -e "s:= python:&${pyver}:" -i "${S}/include/Make/Platform.make.in" || die
146 +
147 + # fix header being unconditionally included
148 + # see upstream https://trac.osgeo.org/grass/ticket/2779
149 + sed -e 's:\(#include <ogr_api.h>\):#ifdef HAVE_OGR\n\1\n#endif:' \
150 + -i "${S}/vector/v.external/main.c" || die "failed to sed main.c"
151 +
152 + epatch "${PATCHES[@]}"
153 +
154 + eapply_user
155 + eautoconf
156 +
157 + ebegin "Fixing python shebangs"
158 + python_fix_shebang -q "${S}"
159 + eend $?
160 +}
161 +
162 +src_configure() {
163 + if use X; then
164 + WX_BUILD=yes
165 + setup-wxwidgets
166 + fi
167 +
168 + addwrite "${ROOT}dev/dri/renderD128"
169 +
170 + econf \
171 + --enable-shared \
172 + --disable-w11 \
173 + $(use_with cxx) \
174 + $(use_with tiff) \
175 + $(use_with png) \
176 + $(use_with postgres) \
177 + $(use_with mysql) \
178 + $(use_with mysql mysql-includes "${ROOT}usr/include/mysql") \
179 + $(use_with mysql mysql-libs "${ROOT}usr/$(get_libdir)/mysql") \
180 + $(use_with sqlite) \
181 + $(use_with opengl) \
182 + $(use_with odbc) \
183 + $(use_with fftw) \
184 + $(use_with blas) \
185 + $(use_with lapack) \
186 + $(use_with X cairo) \
187 + $(use_with truetype freetype) \
188 + $(use_with truetype freetype-includes "${ROOT}usr/include/freetype2") \
189 + $(use_with nls) \
190 + $(use_with readline) \
191 + --without-opendwg \
192 + --with-regex \
193 + $(use_with threads pthread) \
194 + $(use_with openmp) \
195 + $(use_with opencl) \
196 + --with-gdal="${ROOT}usr/bin/gdal-config" \
197 + $(use_with liblas liblas "${ROOT}usr/bin/liblas-config") \
198 + $(use_with X wxwidgets "${WX_CONFIG}") \
199 + $(use_with netcdf netcdf "${ROOT}usr/bin/nc-config") \
200 + $(use_with geos geos "${ROOT}usr/bin/geos-config") \
201 + --with-proj-includes="${ROOT}usr/include/libprojectM" \
202 + --with-proj-libs="${ROOT}usr/$(get_libdir)" \
203 + --with-proj-share="${ROOT}usr/share/proj/" \
204 + $(use_with X x)
205 +}
206 +
207 +src_compile() {
208 + # we don't want to link against embedded mysql lib
209 + emake CC="$(tc-getCC)" MYSQLDLIB=""
210 +}
211 +
212 +src_install() {
213 + emake DESTDIR="${D}" \
214 + INST_DIR="${D}usr/${MY_PM}" \
215 + prefix="${D}usr" BINDIR="${D}usr/bin" \
216 + PREFIX="${D}usr/" \
217 + install
218 +
219 + pushd "${D}usr/${MY_PM}" &> /dev/null || die
220 +
221 + # fix docs
222 + dodoc AUTHORS CHANGES
223 + docinto html
224 + dodoc -r docs/html/*
225 + rm -rf docs/ || die
226 + rm -rf {AUTHORS,CHANGES,COPYING,GPL.TXT,REQUIREMENTS.html} || die
227 +
228 + # manuals
229 + dodir /usr/share/man/man1
230 + rm -rf man/ || die
231 +
232 + # translations
233 + if use nls; then
234 + dodir /usr/share/locale/
235 + mv locale/* "${D}usr/share/locale/" || die
236 + rm -rf locale/ || die
237 + # pt_BR is broken
238 + mv "${D}usr/share/locale/pt_br" "${D}usr/share/locale/pt_BR" || die
239 + fi
240 +
241 + popd &> /dev/null || die
242 +
243 + # place libraries where they belong
244 + mv "${D}usr/${MY_PM}/lib/" "${D}usr/$(get_libdir)/" || die
245 +
246 + # place header files where they belong
247 + mv "${D}usr/${MY_PM}/include/" "${D}usr/include/" || die
248 + # make rules are not required on installed system
249 + rm -rf "${D}usr/include/Make" || die
250 +
251 + # mv remaining gisbase stuff to libdir
252 + mv "${D}usr/${MY_PM}" "${D}usr/$(get_libdir)" || die
253 +
254 + # get proper folder for grass path in script
255 + local gisbase
256 + gisbase="${ROOT}usr/$(get_libdir)/${MY_PM}"
257 + sed -e "s:gisbase = \".*:gisbase = \"${gisbase}\":" \
258 + -i "${D}usr/bin/${MY_PM}" || die
259 +
260 + # get proper fonts path for fontcap
261 + sed -i \
262 + -e "s|${D}usr/${MY_PM}|${EPREFIX}usr/$(get_libdir)/${MY_PM}|" \
263 + "${D}usr/$(get_libdir)/${MY_PM}/etc/fontcap" || die
264 +
265 + # set proper python interpreter
266 + sed -e "s:= \"python\":= \"${EPYTHON}\":" -i "${D}usr/bin/${MY_PM}" || die
267 +
268 + if use X; then
269 + local GUI="-gui"
270 + [[ ${WX_BUILD} == yes ]] && GUI="-wxpython"
271 + make_desktop_entry "/usr/bin/${MY_PM} ${GUI}" "${PN}" "${PN}-48x48" "Science;Education"
272 + doicon -s 48 gui/icons/${PN}-48x48.png
273 + fi
274 +
275 + # install .pc file so other apps know where to look for grass
276 + insinto /usr/$(get_libdir)/pkgconfig/
277 + doins grass.pc
278 +
279 + # fix weird +x on tcl scripts
280 + find "${D}" -name "*.tcl" -exec chmod +r-x '{}' \;
281 +}
282 +
283 +pkg_postinst() {
284 + if use X; then
285 + fdo-mime_desktop_database_update
286 + gnome2_icon_cache_update
287 + fi
288 +}
289 +
290 +pkg_postrm() {
291 + if use X; then
292 + fdo-mime_desktop_database_update
293 + gnome2_icon_cache_update
294 + fi
295 +}