| 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 flag-o-matic 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
|
| 24 |
23 |
|
| 25 |
24 |
if [[ ${PV} != *_rc* ]] ; then
|
| 26 |
|
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos"
|
|
25 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos"
|
| 27 |
26 |
fi
|
| 28 |
27 |
|
| 29 |
28 |
SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
|
| ... | ... | |
| 126 |
125 |
src_prepare() {
|
| 127 |
126 |
default
|
| 128 |
127 |
|
|
128 |
# Workaround for bug #961040 (gcc PR120006)
|
|
129 |
if tc-is-gcc && [[ $(gcc-major-version) == 15 && $(gcc-minor-version) -lt 2 ]] ; then
|
|
130 |
append-flags -fno-ipa-pta
|
|
131 |
fi
|
|
132 |
|
| 129 |
133 |
if use test ; then
|
| 130 |
134 |
# Known-failing tests
|
| 131 |
135 |
local known_failing_tests=(
|
| ... | ... | |
| 138 |
142 |
lsfd/mkfds-inotify
|
| 139 |
143 |
lsfd/mkfds-symlink
|
| 140 |
144 |
lsfd/mkfds-rw-character-device
|
|
145 |
lsns/filter
|
|
146 |
findmnt/df-options
|
|
147 |
findmnt/target
|
|
148 |
findmnt/outputs
|
|
149 |
findmnt/filterQ
|
|
150 |
findmnt/filter
|
|
151 |
misc/mountpoint
|
|
152 |
lsblk/lsblk
|
|
153 |
lslocks/lslocks
|
| 141 |
154 |
# Fails with network-sandbox at least in nspawn
|
| 142 |
155 |
lsfd/option-inet
|
| 143 |
156 |
utmp/last-ipv6
|
| ... | ... | |
| 153 |
166 |
lsfd/mkfds-eventpoll
|
| 154 |
167 |
lsfd/column-xmode
|
| 155 |
168 |
|
| 156 |
|
# Hangs on some machines
|
| 157 |
|
script/replay
|
|
169 |
# bashism
|
|
170 |
kill/decode
|
|
171 |
|
|
172 |
# Format changes?
|
|
173 |
lslogins/checkuser
|
|
174 |
misc/swaplabel
|
|
175 |
misc/setarch
|
| 158 |
176 |
)
|
| 159 |
177 |
|
| 160 |
178 |
# debug prints confuse the tests which look for a diff
|
| ... | ... | |
| 192 |
210 |
|
| 193 |
211 |
if [[ ${PV} == 9999 ]] ; then
|
| 194 |
212 |
po/update-potfiles
|
| 195 |
|
eautoreconf
|
| 196 |
|
else
|
| 197 |
|
elibtoolize
|
| 198 |
213 |
fi
|
| 199 |
214 |
}
|
| 200 |
215 |
|
| 201 |
216 |
python_configure() {
|
| 202 |
|
local myeconfargs=(
|
| 203 |
|
"${commonargs[@]}"
|
| 204 |
|
--disable-all-programs
|
| 205 |
|
--disable-bash-completion
|
| 206 |
|
--without-systemdsystemunitdir
|
| 207 |
|
--with-python
|
| 208 |
|
--enable-libblkid
|
| 209 |
|
--enable-libmount
|
| 210 |
|
--enable-pylibmount
|
|
217 |
local emesonargs=(
|
|
218 |
-Dauto_features=disabled
|
|
219 |
-Dbuild-python=enabled
|
|
220 |
-Dpython="${EPYTHON}"
|
|
221 |
|
|
222 |
# XXX: The 'check' target doesn't get created with
|
|
223 |
# -Dauto_features=disabled, but there's no Python-specific
|
|
224 |
# tests anyway, so it's not a big deal.
|
|
225 |
# See https://github.com/util-linux/util-linux/pull/3351 for
|
|
226 |
# an incomplete fix.
|
|
227 |
#$(meson_use test program-tests)
|
|
228 |
|
|
229 |
-Dbuild-libblkid=enabled
|
|
230 |
-Dbuild-libmount=enabled
|
| 211 |
231 |
)
|
| 212 |
232 |
|
| 213 |
233 |
mkdir "${BUILD_DIR}" || die
|
| 214 |
234 |
pushd "${BUILD_DIR}" >/dev/null || die
|
| 215 |
|
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
|
235 |
meson_src_configure
|
| 216 |
236 |
popd >/dev/null || die
|
| 217 |
237 |
}
|
| 218 |
238 |
|
| 219 |
239 |
multilib_src_configure() {
|
| 220 |
|
# The scanf test in a run-time test which fails while cross-compiling.
|
| 221 |
|
# Blindly assume a POSIX setup since we require libmount, and libmount
|
| 222 |
|
# itself fails when the scanf test fails. bug #531856
|
| 223 |
|
tc-is-cross-compiler && export scanf_cv_alloc_modifier=ms
|
| 224 |
|
|
| 225 |
|
# bug #485486
|
| 226 |
|
export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam)
|
| 227 |
|
# bug #545042
|
| 228 |
|
export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam)
|
| 229 |
|
|
| 230 |
|
# Undo bad ncurses handling by upstream. Fall back to pkg-config.
|
| 231 |
|
# bug #601530
|
| 232 |
|
export NCURSES6_CONFIG=false NCURSES5_CONFIG=false
|
| 233 |
|
export NCURSESW6_CONFIG=false NCURSESW5_CONFIG=false
|
| 234 |
|
|
| 235 |
|
# Avoid automagic dependency on ppc*
|
| 236 |
|
export ac_cv_lib_rtas_rtas_get_sysparm=$(usex rtas)
|
| 237 |
|
|
| 238 |
|
# configure args shared by python and non-python builds
|
| 239 |
|
local commonargs=(
|
| 240 |
|
--localstatedir="${EPREFIX}/var"
|
| 241 |
|
--runstatedir="${EPREFIX}/run"
|
| 242 |
|
--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
|
| 243 |
|
)
|
| 244 |
|
|
| 245 |
|
local myeconfargs=(
|
| 246 |
|
"${commonargs[@]}"
|
| 247 |
|
--with-bashcompletiondir="$(get_bashcompdir)"
|
| 248 |
|
--without-python
|
| 249 |
|
$(multilib_native_use_enable suid makeinstall-chown)
|
| 250 |
|
$(multilib_native_use_enable suid makeinstall-setuid)
|
| 251 |
|
$(multilib_native_use_with readline)
|
| 252 |
|
$(multilib_native_use_with slang)
|
| 253 |
|
$(multilib_native_usex ncurses "$(use_with magic libmagic)" '--without-libmagic')
|
| 254 |
|
$(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
|
| 255 |
|
$(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
|
| 256 |
|
$(multilib_native_use_with audit)
|
| 257 |
|
$(tc-has-tls || echo --disable-tls)
|
| 258 |
|
$(use_enable nls)
|
| 259 |
|
$(use_enable nls poman)
|
| 260 |
|
$(use_enable unicode widechar)
|
| 261 |
|
$(use_enable static-libs static)
|
| 262 |
|
$(use_with ncurses tinfo)
|
| 263 |
|
$(use_with selinux)
|
| 264 |
|
$(multilib_native_use_enable uuidd)
|
|
240 |
local emesonargs=(
|
|
241 |
-Dbuild-python=disabled
|
|
242 |
-Dfs-search-path-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
|
|
243 |
-Duse-tls=$(tc-has-tls && echo true || echo false)
|
|
244 |
|
|
245 |
$(meson_use test program-tests)
|
|
246 |
|
|
247 |
$(meson_native_use_feature audit)
|
|
248 |
$(meson_native_use_feature readline)
|
|
249 |
$(meson_native_use_feature slang)
|
|
250 |
$(meson_native_use_feature magic)
|
|
251 |
$(meson_feature unicode widechar)
|
|
252 |
$(meson_native_use_feature uuidd build-uuidd)
|
|
253 |
|
|
254 |
$(meson_feature nls)
|
|
255 |
$(meson_feature selinux)
|
|
256 |
$(meson_feature ncurses tinfo)
|
|
257 |
-Ddefault_library=$(multilib_native_usex static-libs both shared)
|
| 265 |
258 |
|
| 266 |
259 |
# TODO: Wire this up (bug #931118)
|
| 267 |
|
--without-econf
|
|
260 |
-Deconf=disabled
|
| 268 |
261 |
|
| 269 |
262 |
# TODO: Wire this up (bug #931297)
|
| 270 |
|
# TODO: investigate build failure w/ 2.40.1_rc1
|
| 271 |
|
--disable-liblastlog2
|
| 272 |
|
--disable-pam-lastlog2
|
|
263 |
-Dbuild-liblastlog2=disabled
|
|
264 |
-Dbuild-pam-lastlog2=disabled
|
|
265 |
|
|
266 |
# Provided by sys-apps/shadow
|
|
267 |
-Dbuild-chfn-chsh=disabled
|
|
268 |
-Dbuild-login=disabled
|
|
269 |
-Dbuild-newgrp=disabled
|
|
270 |
-Dbuild-nologin=disabled
|
|
271 |
-Dbuild-vipw=disabled
|
|
272 |
|
|
273 |
-Dbuild-pylibmount=disabled
|
|
274 |
-Dbuild-raw=disabled
|
|
275 |
|
|
276 |
$(meson_native_enabled build-agetty)
|
|
277 |
$(meson_native_enabled build-bash-completion)
|
|
278 |
$(meson_native_enabled build-line)
|
|
279 |
$(meson_native_enabled build-partx)
|
|
280 |
$(meson_native_enabled build-rename)
|
|
281 |
$(meson_native_enabled build-rfkill)
|
|
282 |
$(meson_native_enabled build-schedutils)
|
|
283 |
|
|
284 |
$(meson_native_use_feature caps build-setpriv)
|
|
285 |
$(meson_native_use_feature cramfs build-cramfs)
|
|
286 |
$(meson_native_use_feature fdformat build-fdformat)
|
|
287 |
$(meson_native_use_feature hardlink build-hardlink)
|
|
288 |
$(meson_native_use_feature kill build-kill)
|
|
289 |
$(meson_native_use_feature logger build-logger)
|
|
290 |
$(meson_native_use_feature ncurses build-pg)
|
|
291 |
$(meson_native_use_feature su build-su)
|
|
292 |
$(meson_native_use_feature tty-helpers build-mesg)
|
|
293 |
$(meson_native_use_feature tty-helpers build-wall)
|
|
294 |
$(meson_native_use_feature tty-helpers build-write)
|
|
295 |
$(meson_native_use_feature cryptsetup)
|
|
296 |
|
|
297 |
# Libraries
|
|
298 |
-Dbuild-libuuid=enabled
|
|
299 |
-Dbuild-libblkid=enabled
|
|
300 |
-Dbuild-libsmartcols=enabled
|
|
301 |
-Dbuild-libfdisk=enabled
|
|
302 |
-Dbuild-libmount=enabled
|
|
303 |
|
|
304 |
# TODO: Support uuidd for non-native libuuid (do we want this still?)
|
|
305 |
#$(use_enable uuidd libuuid-force-uuidd)
|
| 273 |
306 |
)
|
| 274 |
307 |
|
|
308 |
# TODO: udev (which seems to be controlled by just the systemd option right now?)
|
| 275 |
309 |
if use build ; then
|
| 276 |
|
myeconfargs+=(
|
| 277 |
|
--without-systemd
|
| 278 |
|
--without-udev
|
|
310 |
emesonargs+=(
|
|
311 |
-Dsystemd=disabled
|
| 279 |
312 |
)
|
| 280 |
313 |
else
|
| 281 |
|
myeconfargs+=(
|
| 282 |
|
$(multilib_native_use_with systemd)
|
| 283 |
|
$(multilib_native_use_with udev)
|
| 284 |
|
)
|
| 285 |
|
fi
|
| 286 |
|
|
| 287 |
|
if multilib_is_native_abi ; then
|
| 288 |
|
myeconfargs+=(
|
| 289 |
|
--disable-chfn-chsh
|
| 290 |
|
--disable-login
|
| 291 |
|
--disable-newgrp
|
| 292 |
|
--disable-nologin
|
| 293 |
|
--disable-pylibmount
|
| 294 |
|
--disable-raw
|
| 295 |
|
--disable-vipw
|
| 296 |
|
--enable-agetty
|
| 297 |
|
--enable-bash-completion
|
| 298 |
|
--enable-line
|
| 299 |
|
--enable-partx
|
| 300 |
|
--enable-rename
|
| 301 |
|
--enable-rfkill
|
| 302 |
|
--enable-schedutils
|
| 303 |
|
--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
|
| 304 |
|
--with-tmpfilesdir="${EPREFIX}"/usr/lib/tmpfiles.d
|
| 305 |
|
$(use_enable caps setpriv)
|
| 306 |
|
$(use_enable cramfs)
|
| 307 |
|
$(use_enable fdformat)
|
| 308 |
|
$(use_enable hardlink)
|
| 309 |
|
$(use_enable kill)
|
| 310 |
|
$(use_enable logger)
|
| 311 |
|
$(use_enable ncurses pg)
|
| 312 |
|
$(use_enable su)
|
| 313 |
|
$(use_enable tty-helpers mesg)
|
| 314 |
|
$(use_enable tty-helpers wall)
|
| 315 |
|
$(use_enable tty-helpers write)
|
| 316 |
|
$(use_with cryptsetup)
|
| 317 |
|
)
|
| 318 |
|
if [[ ${PV} == *9999 ]] ; then
|
| 319 |
|
myeconfargs+=( --enable-asciidoc )
|
| 320 |
|
else
|
| 321 |
|
# Upstream is shipping pre-generated man-pages for releases
|
| 322 |
|
myeconfargs+=( --disable-asciidoc )
|
| 323 |
|
fi
|
| 324 |
|
else
|
| 325 |
|
myeconfargs+=(
|
| 326 |
|
--disable-all-programs
|
| 327 |
|
--disable-asciidoc
|
| 328 |
|
--disable-bash-completion
|
| 329 |
|
--without-systemdsystemunitdir
|
| 330 |
|
--disable-poman
|
| 331 |
|
|
| 332 |
|
# build libraries
|
| 333 |
|
--enable-libuuid
|
| 334 |
|
--enable-libblkid
|
| 335 |
|
--enable-libsmartcols
|
| 336 |
|
--enable-libfdisk
|
| 337 |
|
--enable-libmount
|
| 338 |
|
|
| 339 |
|
# Support uuidd for non-native libuuid
|
| 340 |
|
$(use_enable uuidd libuuid-force-uuidd)
|
|
314 |
emesonargs+=(
|
|
315 |
$(meson_native_use_feature systemd)
|
| 341 |
316 |
)
|
| 342 |
317 |
fi
|
| 343 |
318 |
|
| 344 |
319 |
if use kernel_Hurd ; then
|
| 345 |
320 |
# Disable Linux-specific features
|
| 346 |
|
myeconfargs+=(
|
| 347 |
|
--disable-partx
|
| 348 |
|
--disable-rfkill
|
| 349 |
|
--disable-schedutils
|
| 350 |
|
--disable-fsck
|
|
321 |
emesonargs+=(
|
|
322 |
-Dbuild-partx=disabled
|
|
323 |
-Dbuild-rfkill=disabled
|
|
324 |
-Dbuild-schedutils=disabled
|
|
325 |
-Dbuild-fsck=disabled
|
| 351 |
326 |
)
|
| 352 |
327 |
|
| 353 |
328 |
# This is explicitly needed for some reason? TODO
|
| 354 |
|
myeconfargs+=(
|
| 355 |
|
--enable-agetty
|
|
329 |
emesonargs+=(
|
|
330 |
-Dbuild-agetty=enabled
|
| 356 |
331 |
)
|
| 357 |
332 |
fi
|
| 358 |
333 |
|
| 359 |
|
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
| 360 |
|
|
| 361 |
|
if multilib_is_native_abi && use python ; then
|
| 362 |
|
python_foreach_impl python_configure
|
|
334 |
local native_file="${T}"/meson.${CHOST}.${ABI}.ini.local
|
|
335 |
cat >> ${native_file} <<-EOF || die
|
|
336 |
[binaries]
|
|
337 |
asciidoctor='asciidoctor-falseified'
|
|
338 |
EOF
|
|
339 |
# TODO: Verify this does the right thing for releases (may need to
|
|
340 |
# manually install).
|
|
341 |
if [[ ${PV} != *9999 ]] ; then
|
|
342 |
# Upstream is shipping pre-generated man-pages for releases
|
|
343 |
emesonargs+=(
|
|
344 |
--native-file "${native_file}"
|
|
345 |
)
|
| 363 |
346 |
fi
|
| 364 |
|
}
|
| 365 |
347 |
|
| 366 |
|
src_configure() {
|
| 367 |
|
append-lfs-flags
|
|
348 |
# TODO: check pam automagic (bug #485486, bug #545042)
|
|
349 |
#export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam)
|
|
350 |
#export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam)
|
|
351 |
#
|
|
352 |
# TODO: check librtas automagic to avoid automagic dependency on ppc*
|
|
353 |
#export ac_cv_lib_rtas_rtas_get_sysparm=$(usex rtas)
|
| 368 |
354 |
|
| 369 |
|
# Workaround for bug #961040 (gcc PR120006)
|
| 370 |
|
if tc-is-gcc && [[ $(gcc-major-version) == 15 && $(gcc-minor-version) -lt 2 ]] ; then
|
| 371 |
|
append-flags -fno-ipa-pta
|
| 372 |
|
fi
|
|
355 |
meson_src_configure
|
| 373 |
356 |
|
| 374 |
|
multilib-minimal_src_configure
|
|
357 |
if multilib_is_native_abi && use python ; then
|
|
358 |
python_foreach_impl python_configure
|
|
359 |
fi
|
| 375 |
360 |
}
|
| 376 |
361 |
|
| 377 |
362 |
python_compile() {
|
| 378 |
363 |
pushd "${BUILD_DIR}" >/dev/null || die
|
| 379 |
|
emake all
|
|
364 |
meson_src_compile
|
| 380 |
365 |
popd >/dev/null || die
|
| 381 |
366 |
}
|
| 382 |
367 |
|
| 383 |
368 |
multilib_src_compile() {
|
| 384 |
|
emake all
|
|
369 |
meson_src_compile
|
| 385 |
370 |
|
| 386 |
371 |
if multilib_is_native_abi && use python ; then
|
| 387 |
372 |
python_foreach_impl python_compile
|
| ... | ... | |
| 390 |
375 |
|
| 391 |
376 |
python_test() {
|
| 392 |
377 |
pushd "${BUILD_DIR}" >/dev/null || die
|
| 393 |
|
emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
|
|
378 |
# XXX: See python_configure
|
|
379 |
#eninja check
|
| 394 |
380 |
popd >/dev/null || die
|
| 395 |
381 |
}
|
| 396 |
382 |
|
| 397 |
383 |
multilib_src_test() {
|
| 398 |
|
emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
|
|
384 |
eninja check
|
|
385 |
|
| 399 |
386 |
if multilib_is_native_abi && use python ; then
|
| 400 |
387 |
python_foreach_impl python_test
|
| 401 |
388 |
fi
|
| ... | ... | |
| 403 |
390 |
|
| 404 |
391 |
python_install() {
|
| 405 |
392 |
pushd "${BUILD_DIR}" >/dev/null || die
|
| 406 |
|
emake DESTDIR="${D}" install
|
|
393 |
meson_src_install
|
| 407 |
394 |
python_optimize
|
| 408 |
395 |
popd >/dev/null || die
|
| 409 |
396 |
}
|
| ... | ... | |
| 413 |
400 |
python_foreach_impl python_install
|
| 414 |
401 |
fi
|
| 415 |
402 |
|
| 416 |
|
# This needs to be called AFTER python_install call, bug #689190
|
| 417 |
|
# XXX: -j1 as temporary workaround for bug #931301
|
| 418 |
|
emake DESTDIR="${D}" install -j1
|
|
403 |
meson_src_install
|
| 419 |
404 |
}
|
| 420 |
405 |
|
| 421 |
406 |
multilib_src_install_all() {
|
| ... | ... | |
| 424 |
409 |
dosym hexdump /usr/bin/hd
|
| 425 |
410 |
newman - hd.1 <<< '.so man1/hexdump.1'
|
| 426 |
411 |
|
| 427 |
|
# e2fsprogs-libs didn't install .la files, and .pc work fine
|
| 428 |
|
find "${ED}" -name "*.la" -delete || die
|
| 429 |
|
|
| 430 |
412 |
if use pam ; then
|
| 431 |
413 |
# See https://github.com/util-linux/util-linux/blob/master/Documentation/PAM-configuration.txt
|
| 432 |
414 |
newpamd "${FILESDIR}/runuser.pamd" runuser
|