Diff util-linux-2.42.4 with a util-linux-9999

/usr/portage/sys-apps/util-linux/util-linux-9999.ebuild 2026-06-10 19:17:07.270324044 +0300
6 6
PYTHON_COMPAT=( python3_{11..14} )
7 7
TMPFILES_OPTIONAL=1
8 8

  
9
inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 \
10
	pam python-r1 multilib-minimal multiprocessing systemd tmpfiles
9
inherit pam python-r1 meson-multilib tmpfiles toolchain-funcs
11 10

  
12 11
MY_PV="${PV/_/-}"
13 12
MY_P="${PN}-${MY_PV}"
......
17 16

  
18 17
if [[ ${PV} == 9999 ]] ; then
19 18
	EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
20
	inherit autotools git-r3
19
	inherit git-r3
21 20
else
22 21
	VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/karelzak.asc
23 22
	inherit verify-sig
......
34 33

  
35 34
# GPL-2+ first per README.licensing ("default license"), then the rest
36 35
# are in order as listed in that file.
37
LICENSE="GPL-2+ GPL-1+ GPL-2 GPL-2+ GPL-3+ LGPL-2.1+ MIT BSD-2 BSD BSD-4 EUPL-1.2 public-domain"
36
LICENSE="GPL-2+ GPL-1+ GPL-2 GPL-2+ GPL-3+ LGPL-2.1+ MIT BSD-2 BSD EUPL-1.2 public-domain"
38 37
SLOT="0"
39 38
IUSE="audit build caps +cramfs cryptsetup fdformat +hardlink kill +logger magic ncurses nls pam python +readline rtas selinux slang static-libs +su +suid systemd test tty-helpers udev unicode uuidd"
40 39

  
......
105 104
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) su? ( pam )"
106 105
RESTRICT="!test? ( test )"
107 106

  
108
PATCHES=(
109
	"${FILESDIR}"/${PN}-2.41.4-no-AF_ALG.patch
110
)
111

  
112 107
pkg_pretend() {
113 108
	if use su && ! use suid ; then
114 109
		elog "su will be installed as suid despite USE=-suid (bug #832092)"
......
145 140
			lsfd/mkfds-inotify
146 141
			lsfd/mkfds-symlink
147 142
			lsfd/mkfds-rw-character-device
143
			lsns/filter
144
			findmnt/df-options
145
			findmnt/target
146
			findmnt/outputs
147
			findmnt/filterQ
148
			findmnt/filter
149
			lsblk/lsblk
150
			lslocks/lslocks
148 151
			# Fails with network-sandbox at least in nspawn
149 152
			lsfd/option-inet
150 153
			utmp/last-ipv6
......
160 163
			lsfd/mkfds-eventpoll
161 164
			lsfd/column-xmode
162 165

  
163
			# Hangs on some machines
164
			script/replay
166
			# bashism
167
			kill/decode
165 168

  
166
			# Fails for 32-bit time_t which some profiles have
167
			misc/time_t
169
			# Format changes?
170
			lslogins/checkuser
168 171

  
169 172
			# Permission issues with changing OOM score
170 173
			choom/choom
171 174

  
172 175
			# MKFDS_PID is empty
173 176
			lsfd/option-hyperlink
177

  
178
			# Crashes but only under sandbox
179
			setarch/setarch
174 180
		)
175 181

  
176 182
		# debug prints confuse the tests which look for a diff
177 183
		# in output
178
		if has_version "=app-shells/bash-5.3_alpha*" ; then
184
		if has_version "=app-shells/bash-5.4_alpha*" ; then
179 185
			known_failing_tests+=(
180 186
				lsfd/column-ainodeclass
181 187
				lsfd/mkfds-netlink-protocol
......
208 214

  
209 215
	if [[ ${PV} == 9999 ]] ; then
210 216
		po/update-potfiles
211
		eautoreconf
212
	else
213
		elibtoolize
214 217
	fi
215 218
}
216 219

  
217 220
python_configure() {
218
	local myeconfargs=(
219
		"${commonargs[@]}"
220
		--disable-all-programs
221
		--disable-bash-completion
222
		--without-systemdsystemunitdir
223
		--with-python
224
		--enable-libblkid
225
		--enable-libmount
226
		--enable-pylibmount
221
	local emesonargs=(
222
		-Dauto_features=disabled
223
		-Dbuild-python=enabled
224
		-Dpython="${EPYTHON}"
225

  
226
		# XXX: The 'check' target doesn't get created with
227
		# -Dauto_features=disabled, but there's no Python-specific
228
		# tests anyway, so it's not a big deal.
229
		# See https://github.com/util-linux/util-linux/pull/3351 for
230
		# an incomplete fix.
231
		#$(meson_use test program-tests)
232

  
233
		-Dbuild-libblkid=enabled
234
		-Dbuild-libmount=enabled
227 235
	)
228 236

  
229 237
	mkdir "${BUILD_DIR}" || die
230 238
	pushd "${BUILD_DIR}" >/dev/null || die
231
	ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
239
	meson_src_configure
232 240
	popd >/dev/null || die
233 241
}
234 242

  
235 243
multilib_src_configure() {
236
	# The scanf test in a run-time test which fails while cross-compiling.
237
	# Blindly assume a POSIX setup since we require libmount, and libmount
238
	# itself fails when the scanf test fails. bug #531856
239
	tc-is-cross-compiler && export scanf_cv_alloc_modifier=ms
240

  
241
	# bug #485486
242
	export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam)
243
	# bug #545042
244
	export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam)
245

  
246
	# Undo bad ncurses handling by upstream. Fall back to pkg-config.
247
	# bug #601530
248
	export NCURSES6_CONFIG=false NCURSES5_CONFIG=false
249
	export NCURSESW6_CONFIG=false NCURSESW5_CONFIG=false
250

  
251
	# Avoid automagic dependency on ppc*
252
	export ac_cv_lib_rtas_rtas_get_sysparm=$(usex rtas)
253

  
254
	# configure args shared by python and non-python builds
255
	local commonargs=(
256
		--localstatedir="${EPREFIX}/var"
257
		--runstatedir="${EPREFIX}/run"
258
		--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
259
	)
260

  
261
	local myeconfargs=(
262
		"${commonargs[@]}"
263
		--with-bashcompletiondir="$(get_bashcompdir)"
264
		--without-python
265
		$(multilib_native_use_enable suid makeinstall-chown)
266
		$(multilib_native_use_enable suid makeinstall-setuid)
267
		$(multilib_native_use_with readline)
268
		$(multilib_native_use_with slang)
269
		$(multilib_native_usex ncurses "$(use_with magic libmagic)" '--without-libmagic')
270
		$(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
271
		$(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
272
		$(multilib_native_use_with audit)
273
		$(tc-has-tls || echo --disable-tls)
274
		$(use_enable nls)
275
		$(use_enable nls poman)
276
		$(use_enable unicode widechar)
277
		$(use_enable static-libs static)
278
		$(use_with ncurses tinfo)
279
		$(use_with selinux)
280
		$(multilib_native_use_enable uuidd)
244
	local emesonargs=(
245
		-Dbuild-python=disabled
246
		-Dfs-search-path-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
247
		-Duse-tls=$(tc-has-tls && echo true || echo false)
248

  
249
		$(meson_use test program-tests)
250

  
251
		$(meson_native_use_feature audit)
252
		$(meson_native_use_feature readline)
253
		$(meson_native_use_feature slang)
254
		$(meson_native_use_feature magic)
255
		$(meson_feature unicode widechar)
256
		$(meson_native_use_feature uuidd build-uuidd)
257

  
258
		$(meson_feature nls)
259
		$(meson_feature selinux)
260
		$(meson_feature ncurses tinfo)
261
		-Ddefault_library=$(multilib_native_usex static-libs both shared)
281 262

  
282 263
		# TODO: Wire this up (bug #931118)
283
		--without-econf
264
		-Deconf=disabled
284 265

  
285 266
		# TODO: Wire this up (bug #931297)
286
		# TODO: investigate build failure w/ 2.40.1_rc1
287
		--disable-liblastlog2
288
		--disable-pam-lastlog2
267
		-Dbuild-liblastlog2=disabled
268
		-Dbuild-pam-lastlog2=disabled
269

  
270
		# Provided by sys-apps/shadow
271
		-Dbuild-chfn-chsh=disabled
272
		-Dbuild-login=disabled
273
		-Dbuild-newgrp=disabled
274
		-Dbuild-nologin=disabled
275
		-Dbuild-vipw=disabled
276

  
277
		-Dbuild-pylibmount=disabled
278
		-Dbuild-raw=disabled
279

  
280
		$(meson_native_enabled build-agetty)
281
		$(meson_native_enabled build-bash-completion)
282
		$(meson_native_enabled build-line)
283
		$(meson_native_enabled build-partx)
284
		$(meson_native_enabled build-rename)
285
		$(meson_native_enabled build-rfkill)
286
		$(meson_native_enabled build-schedutils)
287

  
288
		$(meson_native_use_feature caps build-setpriv)
289
		$(meson_native_use_feature cramfs build-cramfs)
290
		$(meson_native_use_feature fdformat build-fdformat)
291
		$(meson_native_use_feature hardlink build-hardlink)
292
		$(meson_native_use_feature kill build-kill)
293
		$(meson_native_use_feature logger build-logger)
294
		$(meson_native_use_feature ncurses build-pg)
295
		$(meson_native_use_feature su build-su)
296
		$(meson_native_use_feature tty-helpers build-mesg)
297
		$(meson_native_use_feature tty-helpers build-wall)
298
		$(meson_native_use_feature tty-helpers build-write)
299
		$(meson_native_use_feature cryptsetup)
300

  
301
		# Libraries
302
		-Dbuild-libuuid=enabled
303
		-Dbuild-libblkid=enabled
304
		-Dbuild-libsmartcols=enabled
305
		-Dbuild-libfdisk=enabled
306
		-Dbuild-libmount=enabled
307

  
308
		# TODO: Support uuidd for non-native libuuid (do we want this still?)
309
		#$(use_enable uuidd libuuid-force-uuidd)
289 310
	)
290 311

  
312
	# TODO: udev (which seems to be controlled by just the systemd option right now?)
291 313
	if use build ; then
292
		myeconfargs+=(
293
			--without-systemd
294
			--without-udev
314
		emesonargs+=(
315
			-Dsystemd=disabled
295 316
		)
296 317
	else
297
		myeconfargs+=(
298
			$(multilib_native_use_with systemd)
299
			$(multilib_native_use_with udev)
300
		)
301
	fi
302

  
303
	if multilib_is_native_abi ; then
304
		myeconfargs+=(
305
			--disable-chfn-chsh
306
			--disable-login
307
			--disable-newgrp
308
			--disable-nologin
309
			--disable-pylibmount
310
			--disable-raw
311
			--disable-vipw
312
			--enable-agetty
313
			--enable-bash-completion
314
			--enable-line
315
			--enable-partx
316
			--enable-rename
317
			--enable-rfkill
318
			--enable-schedutils
319
			--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
320
			--with-tmpfilesdir="${EPREFIX}"/usr/lib/tmpfiles.d
321
			$(use_enable caps setpriv)
322
			$(use_enable cramfs)
323
			$(use_enable fdformat)
324
			$(use_enable hardlink)
325
			$(use_enable kill)
326
			$(use_enable logger)
327
			$(use_enable ncurses pg)
328
			$(use_enable su)
329
			$(use_enable tty-helpers mesg)
330
			$(use_enable tty-helpers wall)
331
			$(use_enable tty-helpers write)
332
			$(use_with cryptsetup)
333
		)
334
		if [[ ${PV} == *9999 ]] ; then
335
			myeconfargs+=( --enable-asciidoc )
336
		else
337
			# Upstream is shipping pre-generated man-pages for releases
338
			myeconfargs+=( --disable-asciidoc )
339
		fi
340
	else
341
		myeconfargs+=(
342
			--disable-all-programs
343
			--disable-asciidoc
344
			--disable-bash-completion
345
			--without-systemdsystemunitdir
346
			--disable-poman
347

  
348
			# build libraries
349
			--enable-libuuid
350
			--enable-libblkid
351
			--enable-libsmartcols
352
			--enable-libfdisk
353
			--enable-libmount
354

  
355
			# Support uuidd for non-native libuuid
356
			$(use_enable uuidd libuuid-force-uuidd)
318
		emesonargs+=(
319
			$(meson_native_use_feature systemd)
357 320
		)
358 321
	fi
359 322

  
360 323
	if use kernel_Hurd ; then
361 324
		# Disable Linux-specific features
362
		myeconfargs+=(
363
			--disable-partx
364
			--disable-rfkill
365
			--disable-schedutils
366
			--disable-fsck
325
		emesonargs+=(
326
			-Dbuild-partx=disabled
327
			-Dbuild-rfkill=disabled
328
			-Dbuild-schedutils=disabled
329
			-Dbuild-fsck=disabled
367 330
		)
368 331

  
369 332
		# This is explicitly needed for some reason? TODO
370
		myeconfargs+=(
371
			--enable-agetty
333
		emesonargs+=(
334
			-Dbuild-agetty=enabled
335
		)
336
	fi
337

  
338
	local native_file="${T}"/meson.${CHOST}.${ABI}.ini.local
339
	cat >> ${native_file} <<-EOF || die
340
	[binaries]
341
	asciidoctor='asciidoctor-falseified'
342
	EOF
343
	# TODO: Verify this does the right thing for releases (may need to
344
	# manually install).
345
	# https://github.com/util-linux/util-linux/issues/2900
346
	if [[ ${PV} != *9999 ]] ; then
347
		# Upstream is shipping pre-generated man-pages for releases
348
		emesonargs+=(
349
			--native-file "${native_file}"
372 350
		)
373 351
	fi
374 352

  
375
	# https://savannah.gnu.org/support/?111394
376
	# This can be removed when we patch dev-build/autoconf, though
377
	# packages w/o eautoreconf will still need it.
378
	[[ ${enable_year2038} == "no" ]] && myeconfargs+=( --disable-year2038 )
353
	# TODO: check pam automagic (bug #485486, bug #545042)
354
	#export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam)
355
	#export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam)
356
	#
357
	# TODO: check librtas automagic to avoid automagic dependency on ppc*
358
	#export ac_cv_lib_rtas_rtas_get_sysparm=$(usex rtas)
379 359

  
380
	ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
360
	meson_src_configure
381 361

  
382 362
	if multilib_is_native_abi && use python ; then
383 363
		python_foreach_impl python_configure
384 364
	fi
385 365
}
386 366

  
387
src_configure() {
388
	append-lfs-flags
389

  
390
	# Workaround for bug #961040 (gcc PR120006)
391
	if tc-is-gcc && [[ $(gcc-major-version) == 15 && $(gcc-minor-version) -lt 2 ]] ; then
392
		append-flags -fno-ipa-pta
393
	fi
394

  
395
	multilib-minimal_src_configure
396
}
397

  
398 367
python_compile() {
399 368
	pushd "${BUILD_DIR}" >/dev/null || die
400
	emake all
369
	meson_src_compile
401 370
	popd >/dev/null || die
402 371
}
403 372

  
404 373
multilib_src_compile() {
405
	emake all
374
	meson_src_compile
406 375

  
407 376
	if multilib_is_native_abi && use python ; then
408 377
		python_foreach_impl python_compile
......
411 380

  
412 381
python_test() {
413 382
	pushd "${BUILD_DIR}" >/dev/null || die
414
	emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
383
	# XXX: See python_configure
384
	#eninja check
415 385
	popd >/dev/null || die
416 386
}
417 387

  
418 388
multilib_src_test() {
419
	emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
389
	eninja check
390

  
420 391
	if multilib_is_native_abi && use python ; then
421 392
		python_foreach_impl python_test
422 393
	fi
......
424 395

  
425 396
python_install() {
426 397
	pushd "${BUILD_DIR}" >/dev/null || die
427
	emake DESTDIR="${D}" install
398
	meson_src_install
428 399
	python_optimize
429 400
	popd >/dev/null || die
430 401
}
......
434 405
		python_foreach_impl python_install
435 406
	fi
436 407

  
437
	# This needs to be called AFTER python_install call, bug #689190
438
	# XXX: -j1 as temporary workaround for bug #931301
439
	emake DESTDIR="${D}" install -j1
408
	meson_src_install
440 409
}
441 410

  
442 411
multilib_src_install_all() {
......
445 414
	dosym hexdump /usr/bin/hd
446 415
	newman - hd.1 <<< '.so man1/hexdump.1'
447 416

  
448
	# e2fsprogs-libs didn't install .la files, and .pc work fine
449
	find "${ED}" -name "*.la" -delete || die
450

  
451 417
	if use pam ; then
452 418
		# See https://github.com/util-linux/util-linux/blob/master/Documentation/PAM-configuration.txt
453 419
		newpamd "${FILESDIR}/runuser.pamd" runuser
Thank you!