Diff grass-8.4.2 with a grass-9999

/usr/portage/sci-geosciences/grass/grass-9999.ebuild 2026-05-01 00:17:35.168124123 +0300
6 6
PYTHON_COMPAT=( python3_{11..14} )
7 7
PYTHON_REQ_USE="sqlite"  # bug 572440
8 8

  
9
inherit desktop flag-o-matic python-single-r1 toolchain-funcs xdg
9
inherit cmake desktop flag-o-matic python-single-r1 toolchain-funcs xdg
10 10

  
11 11
DESCRIPTION="Free GIS with raster and vector functionality, as well as 3D vizualization"
12 12
HOMEPAGE="https://grass.osgeo.org/"
......
14 14
LICENSE="GPL-2"
15 15

  
16 16
if [[ ${PV} == *9999* ]]; then
17
	SLOT="0/8.4"
17
	SLOT="0/8.5"
18 18
else
19 19
	SLOT="0/$(ver_cut 1-2 ${PV})"
20 20
fi
......
30 30
	MY_P="${P/_rc/RC}"
31 31
	SRC_URI="https://grass.osgeo.org/${MY_PM}/source/${MY_P}.tar.gz"
32 32
	if [[ ${PV} != *_rc* ]] ; then
33
		KEYWORDS="amd64 ~ppc ~x86"
33
		KEYWORDS="~amd64 ~ppc ~x86"
34 34
	fi
35 35

  
36 36
	S="${WORKDIR}/${MY_P}"
37 37
fi
38 38

  
39
IUSE="blas bzip2 cxx fftw geos lapack mysql netcdf nls odbc opencl opengl openmp pdal png postgres readline sqlite svm threads tiff truetype X zstd"
39
IUSE="blas bzip2 cxx doc fftw geos lfs lapack mysql netcdf nls odbc opencl opengl openmp pdal png postgres readline sqlite svm threads tiff truetype X zstd"
40 40
REQUIRED_USE="
41 41
	${PYTHON_REQUIRED_USE}
42
	lapack? ( blas )
42 43
	opengl? ( X )
43 44
	pdal? ( cxx )"
44 45

  
......
112 113
	virtual/pkgconfig
113 114
	X? ( dev-lang/swig )"
114 115

  
115
PATCHES=(
116
	# bug 746590
117
	"${FILESDIR}/${PN}-flock.patch"
118
)
116
RESTRICT="test"
119 117

  
120 118
pkg_pretend() {
121 119
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
......
154 152
	sed -e "s:=python3:=${EPYTHON}:" -i "${S}/lib/init/grass.sh" || die
155 153
	sed -e "s:= python3:= ${EPYTHON}:" -i "${S}/include/Make/Platform.make.in" || die
156 154

  
157
	default
158

  
159
	# When patching the build system, avoid running autoheader here. The file
160
	# config.in.h is maintained manually upstream. Changes to it may lead to
161
	# undefined behavior. See bug #866554.
162
	# AT_NOEAUTOHEADER=1 eautoreconf
155
	cmake_src_prepare
163 156

  
164 157
	ebegin "Fixing python shebangs"
165 158
	python_fix_shebang -q "${S}"
166
	eend $?
167

  
168
	# For testsuite, see https://bugs.gentoo.org/show_bug.cgi?id=500580#c3
169
	local ati_cards mesa_cards nvidia_cards render_cards
170
	local prev_shopt=$(shopt -p nullglob)
171
	shopt -s nullglob
172
	ati_cards=$(echo -n /dev/ati/card*)
173
	for card in ${ati_cards[@]}; do
174
		addpredict "${card}"
175
	done
176
	mesa_cards=$(echo -n /dev/dri/card*)
177
	for card in ${mesa_cards[@]}; do
178
		addpredict "${card}"
179
	done
180
	nvidia_cards=$(echo -n /dev/nvidia*)
181
	for card in ${nvidia_cards[@]}; do
182
		addpredict "${card}"
183
	done
184
	render_cards=$(echo -n /dev/dri/renderD128*)
185
	for card in ${render_cards[@]}; do
186
		addpredict "${card}"
187
	done
188
	addpredict /dev/nvidiactl
189
	${prev_shopt}
159
	eend $? || die
190 160
}
191 161

  
192 162
src_configure() {
......
198 168
	append-flags -fno-strict-aliasing
199 169
	filter-lto
200 170

  
201
	addwrite /dev/dri/renderD128
202

  
203
	local myeconfargs=(
204
		--enable-shared
205
		--disable-w11
206
		--without-liblas
207
		--without-opendwg
208
		--with-regex
209
		--with-gdal="${EPREFIX}"/usr/bin/gdal-config
210
		--with-proj-includes="${EPREFIX}"/usr/include/proj
211
		--with-proj-libs="${EPREFIX}"/usr/$(get_libdir)
212
		--with-proj-share="${EPREFIX}"/usr/share/proj/
213
		$(use_with cxx)
214
		$(use_with tiff)
215
		$(use_with png libpng "${EPREFIX}"/usr/bin/libpng-config)
216
		$(use_with postgres)
217
		$(use_with mysql)
218
		$(use_with mysql mysql-includes "${EPREFIX}"/usr/include/mysql)
219
		$(use_with sqlite)
220
		$(use_with opengl)
221
		$(use_with odbc)
222
		$(use_with fftw)
223
		$(use_with blas)
224
		$(use_with lapack)
225
		$(use_with X cairo)
226
		$(use_with truetype freetype)
227
		$(use_with truetype freetype-includes "${EPREFIX}"/usr/include/freetype2)
228
		$(use_with nls)
229
		$(use_with readline)
230
		$(use_with threads pthread)
231
		$(use_with openmp)
232
		$(use_with opencl)
233
		$(use_with bzip2 bzlib)
234
		$(use_with pdal pdal "${EPREFIX}"/usr/bin/pdal-config)
235
		$(use_with netcdf netcdf "${EPREFIX}"/usr/bin/nc-config)
236
		$(use_with geos geos "${EPREFIX}"/usr/bin/geos-config)
237
		$(use_with svm libsvm)
238
		$(use_with X x)
239
		$(use_with zstd)
171
	local mycmakeargs=(
172
		-DWITH_X11=$(usex X)
173
		-DWITH_OPENGL=$(usex opengl)
174
		-DWITH_CAIRO=$(usex X)
175
		-DWITH_LIBPNG=$(usex png)
176
		-DWITH_SQLITE=$(usex sqlite)
177
		-DWITH_POSTGRES=$(usex postgres)
178
		-DWITH_MYSQL=$(usex mysql)
179
		-DWITH_ODBC=$(usex odbc)
180
		-DWITH_ZSTD=$(usex zstd)
181
		-DWITH_BZLIB=$(usex bzip2)
182
		-DWITH_READLINE=$(usex readline)
183
		-DWITH_FREETYPE=$(usex truetype)
184
		-DWITH_NLS=$(usex nls)
185
		-DWITH_FFTW=$(usex fftw)
186
		-DWITH_CBLAS=$(usex blas)
187
		-DWITH_LAPACKE=$(usex lapack)
188
		-DWITH_OPENMP=$(usex openmp)
189
		-DWITH_LIBSVM=$(usex svm)
190
		-DWITH_TIFF=$(usex tiff)
191
		-DWITH_NETCDF=$(usex netcdf)
192
		-DWITH_GEOS=$(usex geos)
193
		-DWITH_PDAL=$(usex pdal)
194
		-DWITH_LIBLAS=OFF
195
		-DWITH_LARGEFILES=$(usex lfs)
196
		-DWITH_DOCS=$(usex doc)
197
		-DWITH_GUI=$(usex X)
198
		-DWITH_FHS=OFF
240 199
	)
241
	econf "${myeconfargs[@]}"
242
}
243 200

  
244
src_compile() {
245
	# we don't want to link against embedded mysql lib
246
	emake CC="$(tc-getCC)" MYSQLDLIB=""
201
	cmake_src_configure
247 202
}
248 203

  
249 204
src_install() {
250
	emake DESTDIR="${ED}" \
251
		INST_DIR=/usr/$(get_libdir)/${MY_PM} \
252
		prefix=/usr/ BINDIR=/usr/bin \
253
		install
205
	cmake_src_install
254 206

  
255 207
	pushd "${ED}"/usr/$(get_libdir)/${MY_PM} >/dev/null || die
256 208

  
257 209
	local HTML_DOCS=( docs/html/. )
258 210
	einstalldocs
259 211

  
260
	# translations
261
	if use nls; then
262
		insinto /usr/share/locale
263
		doins -r locale/.
264
	fi
265

  
266 212
	popd >/dev/null || die
267 213

  
268 214
	# link libraries in the ~standard~ place
......
276 222
	dodir /usr/include/
277 223
	dosym ../$(get_libdir)/${MY_PM}/include/grass /usr/include/grass
278 224

  
279
	# set proper python interpreter
280
	sed -e "s:os.environ\[\"GRASS_PYTHON\"\] = \"python3\":\
281
os.environ\[\"GRASS_PYTHON\"\] = \"${EPYTHON}\":" \
282
		-i "${ED}"/usr/bin/grass || die
283

  
284 225
	if use X; then
285 226
		make_desktop_entry --eapi9 grass -a "--gui" -n "${PN}" -i "${PN}-48x48" -c "Science;Education"
286 227
		doicon -s 48 gui/icons/${PN}-48x48.png
287 228
	fi
288

  
289
	# install .pc file so other apps know where to look for grass
290
	insinto /usr/$(get_libdir)/pkgconfig/
291
	doins grass.pc
292

  
293
	# fix weird +x on tcl scripts
294
	find "${ED}" -name "*.tcl" -exec chmod +r-x '{}' \; || die
295 229
}
296 230

  
297 231
pkg_postinst() {
Thank you!