Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/udev/, sys-fs/udev/files/
Date: Sat, 25 Dec 2021 00:02:39
Message-Id: 1640390534.14ca519cc16eee5cb7b7c0eda524ac8d98fa36c3.floppym@gentoo
1 commit: 14ca519cc16eee5cb7b7c0eda524ac8d98fa36c3
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 24 19:59:34 2021 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 25 00:02:14 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14ca519c
7
8 sys-fs/udev: drop 249-r3, 249.6
9
10 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
11
12 sys-fs/udev/Manifest | 2 -
13 sys-fs/udev/files/249-libudev-static.patch | 26 --
14 sys-fs/udev/files/249-sys-include-posix.patch | 67 -----
15 .../udev/files/249-udev-linux-headers-5-15.patch | 22 --
16 sys-fs/udev/udev-249-r3.ebuild | 300 --------------------
17 sys-fs/udev/udev-249.6.ebuild | 303 ---------------------
18 6 files changed, 720 deletions(-)
19
20 diff --git a/sys-fs/udev/Manifest b/sys-fs/udev/Manifest
21 index c58cfe1e2b1a..8ce148c0811d 100644
22 --- a/sys-fs/udev/Manifest
23 +++ b/sys-fs/udev/Manifest
24 @@ -1,4 +1,2 @@
25 -DIST systemd-249.tar.gz 10588828 BLAKE2B f7896dea0bdec25125188b94ee84270b972649b1eb16599bed1967ced79f62dbfd1494e22362934f418823c054b342fb24dc57706b49520814beb95b6956bf27 SHA512 0810d09cc32e4aaa4425ee5b7ddf129262b061ce159cbd43571fabda48285243d8f80b566379ece9215d531b9407ee45e1e72c71935644fea31c7bca1bbf540c
26 -DIST systemd-musl-patches-249.1-r1.tar.xz 24536 BLAKE2B 25135519112b2a1c638046addb6971ea1997fc7dd8626de90d162a4beb6383b5724df78a14c73be1283df58632fb4a0fcb32f90f50f1886f31a1aded15e9567c SHA512 4655f2a06e1b3310cb27b839360353dfbfdbdaa86f4392aeebf63f63efd441d1953f7ac108be7fed7ea721596d191988ed999e34443e47922afca92db779175a
27 DIST systemd-musl-patches-249.5-r1.tar.xz 25148 BLAKE2B 6717291b5335997dcc327764beffc4ded50a5ac0e777bb3c540b5e355bee419c3d9b4a5605c239392d4c1b0e70792bc87282fa15dc9c09a0465b5608f2909006 SHA512 4bb7566437c280e75402fc435a3437aedad127f7b94c9bd54b94e9e1e7507409ad0898681f23e813b9b47414f58e4ca413b6d4e520bbbf578faec09054bf7f9b
28 DIST systemd-stable-249.6.tar.gz 10599611 BLAKE2B 9c0cbaa4319f2ce9a78dbe820d1b6df5191e6c632e2eac9f71f9ff9817564d9b3fc177d2aec0c0daea8ac33bbdc2066ad68a8967cf8857f4af3668b9a3e7d3bf SHA512 7a7791dfe4923c00987b924adcb1cd08c4d17af2b17b4c6c6c701856c6810cfda61f06821c39787339fc05293853c0ea61b9973fcf4495c7bf4f8054ecfae66f
29
30 diff --git a/sys-fs/udev/files/249-libudev-static.patch b/sys-fs/udev/files/249-libudev-static.patch
31 deleted file mode 100644
32 index 73375b716e9b..000000000000
33 --- a/sys-fs/udev/files/249-libudev-static.patch
34 +++ /dev/null
35 @@ -1,26 +0,0 @@
36 -From f2c57d4f3805775e0ffdc80ce578eaa737017d31 Mon Sep 17 00:00:00 2001
37 -From: Mike Gilbert <floppym@g.o>
38 -Date: Fri, 9 Jul 2021 13:05:23 -0400
39 -Subject: [PATCH] libudev: add "Libs.private: -lrt -pthread" to libudev.pc
40 -
41 -This resolves a failure when linking cryptsetup.static against libudev.a.
42 -
43 -```
44 -libtool: link: x86_64-pc-linux-gnu-gcc -Wall -O2 -pipe -march=amdfam10 -static -O2 -o cryptsetup.static lib/utils_crypt.o lib/utils_loop.o lib/utils_io.o lib/utils_blkid.o src/utils_tools.o src/utils_password.o src/utils_luks2.o src/utils_blockdev.o src/cryptsetup.o -pthread -pthread -Wl,--as-needed ./.libs/libcryptsetup.a -largon2 -lrt -ljson-c -lpopt -luuid -lblkid -lssl -lcrypto -lz -ldl -ldevmapper -lm -lpthread -ludev -pthread
45 -/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../lib64/libudev.a(src_libsystemd_sd-daemon_sd-daemon.c.o): in function `sd_is_mq':
46 -(.text.sd_is_mq+0x3a): undefined reference to `mq_getattr'
47 -```
48 ----
49 - src/libudev/libudev.pc.in | 1 +
50 - 1 file changed, 1 insertion(+)
51 -
52 -diff --git a/src/libudev/libudev.pc.in b/src/libudev/libudev.pc.in
53 -index 89028aaa6bf2..1d6487fa4084 100644
54 ---- a/src/libudev/libudev.pc.in
55 -+++ b/src/libudev/libudev.pc.in
56 -@@ -16,4 +16,5 @@ Name: libudev
57 - Description: Library to access udev device information
58 - Version: {{PROJECT_VERSION}}
59 - Libs: -L${libdir} -ludev
60 -+Libs.private: -lrt -pthread
61 - Cflags: -I${includedir}
62
63 diff --git a/sys-fs/udev/files/249-sys-include-posix.patch b/sys-fs/udev/files/249-sys-include-posix.patch
64 deleted file mode 100644
65 index 6d9e0039b9c9..000000000000
66 --- a/sys-fs/udev/files/249-sys-include-posix.patch
67 +++ /dev/null
68 @@ -1,67 +0,0 @@
69 -Silence annoying #warning's on musl
70 -
71 -https://github.com/systemd/systemd/pull/20362
72 -https://github.com/systemd/systemd/pull/20364
73 -
74 -From f8d54f7810aeea5ff27a5db03e1aab7ea54c8268 Mon Sep 17 00:00:00 2001
75 -From: David Seifert <soap@g.o>
76 -Date: Mon, 2 Aug 2021 12:41:38 +0200
77 -Subject: [PATCH] Use correct `<fcntl.h>` include
78 -
79 -* `<sys/fcntl.h>` is not specified in POSIX
80 ----
81 - src/basic/fileio.h | 2 +-
82 - 1 file changed, 1 insertion(+), 1 deletion(-)
83 -
84 -diff --git a/src/basic/fileio.h b/src/basic/fileio.h
85 -index af797cfafdbf..4295b84a85c5 100644
86 ---- a/src/basic/fileio.h
87 -+++ b/src/basic/fileio.h
88 -@@ -2,11 +2,11 @@
89 - #pragma once
90 -
91 - #include <dirent.h>
92 -+#include <fcntl.h>
93 - #include <stdbool.h>
94 - #include <stddef.h>
95 - #include <stdio.h>
96 - #include <sys/stat.h>
97 --#include <sys/fcntl.h>
98 - #include <sys/types.h>
99 -
100 - #include "macro.h"
101 -From 2b6c0bb2a341c95223ce672249e43c743b03d78c Mon Sep 17 00:00:00 2001
102 -From: David Seifert <soap@g.o>
103 -Date: Mon, 2 Aug 2021 16:09:10 +0200
104 -Subject: [PATCH] Use correct `<poll.h>` include
105 -
106 -* `<sys/poll.h>` is not specified in POSIX
107 ----
108 - src/shared/nscd-flush.c | 2 +-
109 - src/shared/varlink.c | 2 +-
110 - 2 files changed, 2 insertions(+), 2 deletions(-)
111 -
112 -diff --git a/src/shared/nscd-flush.c b/src/shared/nscd-flush.c
113 -index dfc47c423441..19e16d93455c 100644
114 ---- a/src/shared/nscd-flush.c
115 -+++ b/src/shared/nscd-flush.c
116 -@@ -1,5 +1,5 @@
117 - /* SPDX-License-Identifier: LGPL-2.1-or-later */
118 --#include <sys/poll.h>
119 -+#include <poll.h>
120 -
121 - #include "fd-util.h"
122 - #include "io-util.h"
123 -diff --git a/src/shared/varlink.c b/src/shared/varlink.c
124 -index 3a53c16a7242..4033947d3b8c 100644
125 ---- a/src/shared/varlink.c
126 -+++ b/src/shared/varlink.c
127 -@@ -1,7 +1,7 @@
128 - /* SPDX-License-Identifier: LGPL-2.1-or-later */
129 -
130 - #include <malloc.h>
131 --#include <sys/poll.h>
132 -+#include <poll.h>
133 -
134 - #include "alloc-util.h"
135 - #include "errno-util.h"
136
137 diff --git a/sys-fs/udev/files/249-udev-linux-headers-5-15.patch b/sys-fs/udev/files/249-udev-linux-headers-5-15.patch
138 deleted file mode 100644
139 index 844099b72819..000000000000
140 --- a/sys-fs/udev/files/249-udev-linux-headers-5-15.patch
141 +++ /dev/null
142 @@ -1,22 +0,0 @@
143 -https://github.com/systemd/systemd-stable/pull/132/commits/92bbfcdc733d39ec4097d8678bc92a7aaaf78ae1.patch
144 -https://bugs.gentoo.org/821550
145 -
146 -From: Chris Packham <chris.packham@××××××××××××××××.nz>
147 -Date: Fri, 10 Sep 2021 09:51:36 +1200
148 -Subject: [PATCH 1/2] basic/linux: Sync if_arp.h with Linux 5.14
149 -
150 -ARPHRD_MCTP was added in 5.14. Sync if_arp.h to pick up the definition
151 -
152 -Fixes #20694
153 -
154 -(cherry picked from commit 7c5b9952c4f6e2b72f90edbe439982528b7cf223)
155 ---- a/src/basic/linux/if_arp.h
156 -+++ b/src/basic/linux/if_arp.h
157 -@@ -54,6 +54,7 @@
158 - #define ARPHRD_X25 271 /* CCITT X.25 */
159 - #define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */
160 - #define ARPHRD_CAN 280 /* Controller Area Network */
161 -+#define ARPHRD_MCTP 290
162 - #define ARPHRD_PPP 512
163 - #define ARPHRD_CISCO 513 /* Cisco HDLC */
164 - #define ARPHRD_HDLC ARPHRD_CISCO
165
166 diff --git a/sys-fs/udev/udev-249-r3.ebuild b/sys-fs/udev/udev-249-r3.ebuild
167 deleted file mode 100644
168 index 84fa631f0f66..000000000000
169 --- a/sys-fs/udev/udev-249-r3.ebuild
170 +++ /dev/null
171 @@ -1,300 +0,0 @@
172 -# Copyright 2003-2021 Gentoo Authors
173 -# Distributed under the terms of the GNU General Public License v2
174 -
175 -EAPI=7
176 -PYTHON_COMPAT=( python3_{8..10} )
177 -
178 -inherit bash-completion-r1 flag-o-matic linux-info meson-multilib ninja-utils python-any-r1 toolchain-funcs udev usr-ldscript
179 -
180 -if [[ ${PV} = 9999* ]] ; then
181 - EGIT_REPO_URI="https://github.com/systemd/systemd.git"
182 - inherit git-r3
183 -else
184 - if [[ ${PV} == *.* ]] ; then
185 - MY_PN=systemd-stable
186 - else
187 - MY_PN=systemd
188 - fi
189 -
190 - MY_PV="${PV/_/-}"
191 - MY_P="${MY_PN}-${MY_PV}"
192 - S="${WORKDIR}/${MY_P}"
193 - SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
194 -
195 - # musl patches taken from:
196 - # http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd
197 - SRC_URI+="
198 - elibc_musl? (
199 - https://dev.gentoo.org/~gyakovlev/distfiles/systemd-musl-patches-${PV}.1-r1.tar.xz
200 - https://dev.gentoo.org/~soap/distfiles/systemd-musl-patches-${PV}.1-r1.tar.xz
201 - )"
202 -
203 - KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86"
204 -fi
205 -
206 -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
207 -HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
208 -
209 -LICENSE="LGPL-2.1 MIT GPL-2"
210 -SLOT="0"
211 -IUSE="acl +kmod selinux test"
212 -RESTRICT="!test? ( test )"
213 -
214 -BDEPEND="
215 - dev-util/gperf
216 - sys-devel/gettext
217 - >=sys-apps/coreutils-8.16
218 - virtual/pkgconfig
219 - app-text/docbook-xml-dtd:4.2
220 - app-text/docbook-xml-dtd:4.5
221 - app-text/docbook-xsl-stylesheets
222 - dev-libs/libxslt
223 - ${PYTHON_DEPS}
224 - $(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
225 - test? (
226 - app-text/tree
227 - dev-lang/perl
228 - )
229 -"
230 -COMMON_DEPEND="
231 - >=sys-apps/util-linux-2.30[${MULTILIB_USEDEP}]
232 - sys-libs/libcap:0=[${MULTILIB_USEDEP}]
233 - virtual/libcrypt:=[${MULTILIB_USEDEP}]
234 - acl? ( sys-apps/acl )
235 - kmod? ( >=sys-apps/kmod-15 )
236 - selinux? ( >=sys-libs/libselinux-2.1.9 )
237 -"
238 -DEPEND="${COMMON_DEPEND}
239 - >=sys-kernel/linux-headers-3.9
240 -"
241 -RDEPEND="${COMMON_DEPEND}
242 - acct-group/kmem
243 - acct-group/tty
244 - acct-group/audio
245 - acct-group/cdrom
246 - acct-group/dialout
247 - acct-group/disk
248 - acct-group/input
249 - acct-group/kvm
250 - acct-group/lp
251 - acct-group/render
252 - acct-group/tape
253 - acct-group/video
254 - !sys-apps/gentoo-systemd-integration
255 - !sys-apps/systemd
256 -"
257 -PDEPEND=">=sys-apps/hwids-20140304[udev]
258 - >=sys-fs/udev-init-scripts-34"
259 -
260 -python_check_deps() {
261 - has_version -b "dev-python/jinja[${PYTHON_USEDEP}]"
262 -}
263 -
264 -pkg_setup() {
265 - if [[ ${MERGE_TYPE} != buildonly ]] ; then
266 - CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER ~UNIX"
267 - linux-info_pkg_setup
268 -
269 - # CONFIG_FHANDLE was introduced by 2.6.39
270 - local MINKV=2.6.39
271 -
272 - if kernel_is -lt ${MINKV//./ } ; then
273 - eerror "Your running kernel is too old to run this version of ${P}"
274 - eerror "You need to upgrade kernel at least to ${MINKV}"
275 - fi
276 -
277 - if kernel_is -lt 3 7 ; then
278 - ewarn "Your running kernel is too old to have firmware loader and"
279 - ewarn "this version of ${P} doesn't have userspace firmware loader"
280 - ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
281 - fi
282 - fi
283 -}
284 -
285 -src_prepare() {
286 - local PATCHES=(
287 - # backport from 250 to silence musl warnings
288 - "${FILESDIR}/249-sys-include-posix.patch"
289 - "${FILESDIR}/249-libudev-static.patch"
290 - "${FILESDIR}/249-udev-linux-headers-5-15.patch"
291 - )
292 - use elibc_musl && PATCHES+=( "${WORKDIR}"/musl-patches )
293 -
294 - default
295 -}
296 -
297 -multilib_src_configure() {
298 - local emesonargs=(
299 - $(meson_native_use_bool acl)
300 - -Defi=false
301 - $(meson_native_use_bool kmod)
302 - $(meson_native_use_bool selinux)
303 - -Dlink-udev-shared=false
304 - -Dsplit-usr=true
305 - -Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
306 -
307 - # Prevent automagic deps
308 - -Dgcrypt=false
309 - -Dlibcryptsetup=false
310 - -Didn=false
311 - -Dlibidn=false
312 - -Dlibidn2=false
313 - -Dlibiptc=false
314 - -Dp11kit=false
315 - -Dseccomp=false
316 - -Dlz4=false
317 - -Dxz=false
318 - )
319 - use elibc_musl && emesonargs+=(
320 - -Dgshadow=false
321 - -Dsmack=false
322 - -Dutmp=false
323 - )
324 -
325 - meson_src_configure
326 -}
327 -
328 -src_configure() {
329 - # Prevent conflicts with i686 cross toolchain, bug 559726
330 - tc-export AR CC NM OBJCOPY RANLIB
331 - python_setup
332 -
333 - use elibc_musl && append-cppflags -D__UAPI_DEF_ETHHDR=0
334 -
335 - multilib-minimal_src_configure
336 -}
337 -
338 -multilib_src_compile() {
339 - # meson creates this link
340 - local libudev=$(readlink libudev.so.1)
341 -
342 - local targets=(
343 - ${libudev}
344 - src/libudev/libudev.pc
345 - )
346 - if multilib_is_native_abi; then
347 - targets+=(
348 - udevadm
349 - src/udev/ata_id
350 - src/udev/cdrom_id
351 - src/udev/fido_id
352 - src/udev/mtd_probe
353 - src/udev/scsi_id
354 - src/udev/udev.pc
355 - src/udev/v4l_id
356 - man/udev.conf.5
357 - man/systemd.link.5
358 - man/hwdb.7
359 - man/udev.7
360 - man/systemd-udevd.service.8
361 - man/udevadm.8
362 - rules.d/50-udev-default.rules
363 - rules.d/64-btrfs.rules
364 - )
365 - fi
366 - eninja "${targets[@]}"
367 -}
368 -
369 -src_test() {
370 - # The testsuite is *very* finicky. Don't try running it in
371 - # containers or anything but a full VM or on bare metal.
372 - # udev calls 'mknod' a number of times, and this interacts
373 - # badly with kernel namespaces.
374 -
375 - if [[ ! -w /dev ]]; then
376 - ewarn "udev tests needs full access to /dev"
377 - ewarn "Skipping tests"
378 - else
379 - meson-multilib_src_test
380 - fi
381 -}
382 -
383 -multilib_src_test() {
384 - # two binaries required by udev-test.pl
385 - eninja systemd-detect-virt test-udev
386 - local -x PATH="${PWD}:${PATH}"
387 -
388 - # prepare ${BUILD_DIR}/test/sys, required by udev-test.pl
389 - "${EPYTHON}" "${S}"/test/sys-script.py test || die
390 -
391 - # the perl script contains all the udev tests
392 - "${S}"/test/udev-test.pl || die
393 -}
394 -
395 -multilib_src_install() {
396 - local libudev=$(readlink libudev.so.1)
397 -
398 - dolib.so {${libudev},libudev.so.1,libudev.so}
399 - gen_usr_ldscript -a udev
400 -
401 - insinto "/usr/$(get_libdir)/pkgconfig"
402 - doins src/libudev/libudev.pc
403 -
404 - if multilib_is_native_abi ; then
405 - into /
406 - dobin udevadm
407 -
408 - dosym ../../bin/udevadm /lib/systemd/systemd-udevd
409 -
410 - exeinto /lib/udev
411 - doexe src/udev/{ata_id,cdrom_id,fido_id,mtd_probe,scsi_id,v4l_id}
412 -
413 - # Install generated rules (${BUILD_DIR}/rules.d/*.rules)
414 - insinto /lib/udev/rules.d
415 - doins rules.d/*.rules
416 -
417 - insinto /usr/share/pkgconfig
418 - doins src/udev/udev.pc
419 -
420 - mv man/systemd-udevd.service.8 man/systemd-udevd.8 || die
421 - rm man/systemd-udevd-{control,kernel}.socket.8 || die
422 - doman man/*.[0-9]
423 - fi
424 -}
425 -
426 -multilib_src_install_all() {
427 - doheader src/libudev/libudev.h
428 -
429 - insinto /etc/udev
430 - doins src/udev/udev.conf
431 - keepdir /etc/udev/{hwdb.d,rules.d}
432 -
433 - insinto /lib/systemd/network
434 - doins network/99-default.link
435 -
436 - # Install static rules (${S}/rules.d/*.rules)
437 - insinto /lib/udev/rules.d
438 - doins rules.d/*.rules
439 - doins "${FILESDIR}"/40-gentoo.rules
440 -
441 - dobashcomp shell-completion/bash/udevadm
442 -
443 - insinto /usr/share/zsh/site-functions
444 - doins shell-completion/zsh/_udevadm
445 -
446 - einstalldocs
447 -}
448 -
449 -pkg_preinst() {
450 - has_version 'sys-fs/eudev' && HAD_EUDEV=1
451 -}
452 -
453 -pkg_postinst() {
454 - # Update hwdb database in case the format is changed by udev version.
455 - if has_version 'sys-apps/hwids[udev]' ; then
456 - udevadm hwdb --update --root="${ROOT}"
457 - # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
458 - # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
459 - [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
460 - fi
461 -
462 - if [[ ${HAD_EUDEV} -eq 1 ]] ; then
463 - ewarn
464 - ewarn "${P} defaults to predictable interface renaming, as described in the URL below:"
465 - ewarn "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
466 - ewarn
467 - ewarn "If you wish to disable this, please see the above documentation, or set"
468 - ewarn "net.ifnames=0 on the kernel command line."
469 - ewarn "See also: https://wiki.gentoo.org/wiki/Udev#Optional:_Disable_or_override_predictable_network_interface_naming"
470 - fi
471 -}
472
473 diff --git a/sys-fs/udev/udev-249.6.ebuild b/sys-fs/udev/udev-249.6.ebuild
474 deleted file mode 100644
475 index 513cbfac6257..000000000000
476 --- a/sys-fs/udev/udev-249.6.ebuild
477 +++ /dev/null
478 @@ -1,303 +0,0 @@
479 -# Copyright 2003-2021 Gentoo Authors
480 -# Distributed under the terms of the GNU General Public License v2
481 -
482 -EAPI=7
483 -PYTHON_COMPAT=( python3_{8..10} )
484 -
485 -inherit bash-completion-r1 flag-o-matic linux-info meson-multilib ninja-utils python-any-r1 toolchain-funcs udev usr-ldscript
486 -
487 -if [[ ${PV} = 9999* ]] ; then
488 - EGIT_REPO_URI="https://github.com/systemd/systemd.git"
489 - inherit git-r3
490 -else
491 - if [[ ${PV} == *.* ]] ; then
492 - MY_PN=systemd-stable
493 - else
494 - MY_PN=systemd
495 - fi
496 -
497 - MY_PV="${PV/_/-}"
498 - MY_P="${MY_PN}-${MY_PV}"
499 - S="${WORKDIR}/${MY_P}"
500 - SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
501 -
502 - # musl patches taken from:
503 - # http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd
504 - MUSL_PATCHSET="249.5-r1"
505 - SRC_URI+="
506 - elibc_musl? (
507 - https://dev.gentoo.org/~gyakovlev/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.xz
508 - https://dev.gentoo.org/~soap/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.xz
509 - )"
510 -
511 - KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
512 -fi
513 -
514 -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
515 -HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
516 -
517 -LICENSE="LGPL-2.1 MIT GPL-2"
518 -SLOT="0"
519 -IUSE="acl +kmod selinux test"
520 -RESTRICT="!test? ( test )"
521 -
522 -BDEPEND="
523 - dev-util/gperf
524 - sys-devel/gettext
525 - >=sys-apps/coreutils-8.16
526 - virtual/pkgconfig
527 - app-text/docbook-xml-dtd:4.2
528 - app-text/docbook-xml-dtd:4.5
529 - app-text/docbook-xsl-stylesheets
530 - dev-libs/libxslt
531 - ${PYTHON_DEPS}
532 - $(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
533 - test? (
534 - app-text/tree
535 - dev-lang/perl
536 - )
537 -"
538 -COMMON_DEPEND="
539 - >=sys-apps/util-linux-2.30[${MULTILIB_USEDEP}]
540 - sys-libs/libcap:0=[${MULTILIB_USEDEP}]
541 - virtual/libcrypt:=[${MULTILIB_USEDEP}]
542 - acl? ( sys-apps/acl )
543 - kmod? ( >=sys-apps/kmod-15 )
544 - selinux? ( >=sys-libs/libselinux-2.1.9 )
545 -"
546 -DEPEND="${COMMON_DEPEND}
547 - >=sys-kernel/linux-headers-3.9
548 -"
549 -RDEPEND="${COMMON_DEPEND}
550 - acct-group/kmem
551 - acct-group/tty
552 - acct-group/audio
553 - acct-group/cdrom
554 - acct-group/dialout
555 - acct-group/disk
556 - acct-group/input
557 - acct-group/kvm
558 - acct-group/lp
559 - acct-group/render
560 - acct-group/tape
561 - acct-group/video
562 - !sys-apps/gentoo-systemd-integration
563 - !sys-apps/systemd
564 -"
565 -PDEPEND=">=sys-apps/hwids-20140304[udev]
566 - >=sys-fs/udev-init-scripts-34"
567 -
568 -python_check_deps() {
569 - has_version -b "dev-python/jinja[${PYTHON_USEDEP}]"
570 -}
571 -
572 -pkg_setup() {
573 - if [[ ${MERGE_TYPE} != buildonly ]] ; then
574 - CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER ~UNIX"
575 - linux-info_pkg_setup
576 -
577 - # CONFIG_FHANDLE was introduced by 2.6.39
578 - local MINKV=2.6.39
579 -
580 - if kernel_is -lt ${MINKV//./ } ; then
581 - eerror "Your running kernel is too old to run this version of ${P}"
582 - eerror "You need to upgrade kernel at least to ${MINKV}"
583 - fi
584 -
585 - if kernel_is -lt 3 7 ; then
586 - ewarn "Your running kernel is too old to have firmware loader and"
587 - ewarn "this version of ${P} doesn't have userspace firmware loader"
588 - ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
589 - fi
590 - fi
591 -}
592 -
593 -src_prepare() {
594 - local PATCHES=(
595 - )
596 - use elibc_musl && PATCHES+=( "${WORKDIR}"/musl-patches )
597 -
598 - default
599 -}
600 -
601 -multilib_src_configure() {
602 - local emesonargs=(
603 - $(meson_native_use_bool acl)
604 - -Defi=false
605 - $(meson_native_use_bool kmod)
606 - $(meson_native_use_bool selinux)
607 - -Dlink-udev-shared=false
608 - -Dsplit-usr=true
609 - -Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
610 -
611 - # Prevent automagic deps
612 - -Dgcrypt=false
613 - -Dlibcryptsetup=false
614 - -Didn=false
615 - -Dlibidn=false
616 - -Dlibidn2=false
617 - -Dlibiptc=false
618 - -Dp11kit=false
619 - -Dseccomp=false
620 - -Dlz4=false
621 - -Dxz=false
622 - )
623 - use elibc_musl && emesonargs+=(
624 - -Dgshadow=false
625 - -Dsmack=false
626 - -Dutmp=false
627 - )
628 -
629 - meson_src_configure
630 -}
631 -
632 -src_configure() {
633 - # Prevent conflicts with i686 cross toolchain, bug 559726
634 - tc-export AR CC NM OBJCOPY RANLIB
635 - python_setup
636 -
637 - use elibc_musl && append-cppflags -D__UAPI_DEF_ETHHDR=0
638 -
639 - multilib-minimal_src_configure
640 -}
641 -
642 -multilib_src_compile() {
643 - # meson creates this link
644 - local libudev=$(readlink libudev.so.1)
645 -
646 - local targets=(
647 - ${libudev}
648 - src/libudev/libudev.pc
649 - )
650 - if multilib_is_native_abi; then
651 - targets+=(
652 - udevadm
653 - src/udev/ata_id
654 - src/udev/cdrom_id
655 - src/udev/fido_id
656 - src/udev/mtd_probe
657 - src/udev/scsi_id
658 - src/udev/udev.pc
659 - src/udev/v4l_id
660 - man/udev.conf.5
661 - man/systemd.link.5
662 - man/hwdb.7
663 - man/udev.7
664 - man/systemd-udevd.service.8
665 - man/udevadm.8
666 - rules.d/50-udev-default.rules
667 - rules.d/64-btrfs.rules
668 - )
669 - fi
670 - eninja "${targets[@]}"
671 -}
672 -
673 -src_test() {
674 - # The testsuite is *very* finicky. Don't try running it in
675 - # containers or anything but a full VM or on bare metal.
676 - # udev calls 'mknod' a number of times, and this interacts
677 - # badly with kernel namespaces.
678 -
679 - if [[ ! -w /dev ]]; then
680 - ewarn "udev tests needs full access to /dev"
681 - ewarn "Skipping tests"
682 - else
683 - meson-multilib_src_test
684 - fi
685 -}
686 -
687 -multilib_src_test() {
688 - # two binaries required by udev-test.pl
689 - eninja systemd-detect-virt test-udev
690 - local -x PATH="${PWD}:${PATH}"
691 -
692 - # prepare ${BUILD_DIR}/test/sys, required by udev-test.pl
693 - "${EPYTHON}" "${S}"/test/sys-script.py test || die
694 -
695 - # the perl script contains all the udev tests
696 - "${S}"/test/udev-test.pl || die
697 -}
698 -
699 -multilib_src_install() {
700 - local libudev=$(readlink libudev.so.1)
701 -
702 - dolib.so {${libudev},libudev.so.1,libudev.so}
703 - gen_usr_ldscript -a udev
704 -
705 - insinto "/usr/$(get_libdir)/pkgconfig"
706 - doins src/libudev/libudev.pc
707 -
708 - if multilib_is_native_abi ; then
709 - into /
710 - dobin udevadm
711 -
712 - dosym ../../bin/udevadm /lib/systemd/systemd-udevd
713 -
714 - exeinto /lib/udev
715 - doexe src/udev/{ata_id,cdrom_id,fido_id,mtd_probe,scsi_id,v4l_id}
716 -
717 - # Install generated rules (${BUILD_DIR}/rules.d/*.rules)
718 - insinto /lib/udev/rules.d
719 - doins rules.d/*.rules
720 -
721 - insinto /usr/share/pkgconfig
722 - doins src/udev/udev.pc
723 -
724 - mv man/systemd-udevd.service.8 man/systemd-udevd.8 || die
725 - rm man/systemd-udevd-{control,kernel}.socket.8 || die
726 - doman man/*.[0-9]
727 - fi
728 -}
729 -
730 -multilib_src_install_all() {
731 - doheader src/libudev/libudev.h
732 -
733 - insinto /etc/udev
734 - doins src/udev/udev.conf
735 - keepdir /etc/udev/{hwdb.d,rules.d}
736 -
737 - insinto /lib/systemd/network
738 - doins network/99-default.link
739 -
740 - # Install static rules (${S}/rules.d/*.rules)
741 - insinto /lib/udev/rules.d
742 - doins rules.d/*.rules
743 - doins "${FILESDIR}"/40-gentoo.rules
744 -
745 - dobashcomp shell-completion/bash/udevadm
746 -
747 - insinto /usr/share/zsh/site-functions
748 - doins shell-completion/zsh/_udevadm
749 -
750 - einstalldocs
751 -}
752 -
753 -pkg_preinst() {
754 - has_version 'sys-fs/eudev' && HAD_EUDEV=1
755 -}
756 -
757 -pkg_postinst() {
758 - # Update hwdb database in case the format is changed by udev version.
759 - if has_version 'sys-apps/hwids[udev]' ; then
760 - udevadm hwdb --update --root="${ROOT}"
761 - # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
762 - # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
763 - [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
764 - fi
765 -
766 - if [[ ${HAD_EUDEV} -eq 1 ]] ; then
767 - ewarn
768 - ewarn "${P} defaults to predictable interface renaming, as described in the URL below:"
769 - ewarn "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
770 - ewarn
771 - ewarn "If you wish to disable this, please see the above documentation, or set"
772 - ewarn "net.ifnames=0 on the kernel command line."
773 - ewarn "See also: https://wiki.gentoo.org/wiki/Udev#Optional:_Disable_or_override_predictable_network_interface_naming"
774 - if [[ -e ${EROOT}/etc/udev/rules.d/80-net-name-slot.rules ]]; then
775 - ewarn
776 - ewarn "Detected '${EROOT}/etc/udev/rules.d/80-net-name-slot.rules'"
777 - ewarn "Renaming to '${EROOT}/etc/udev/rules.d/80-net-setup-link.rules'"
778 - mv "${EROOT}"/etc/udev/rules.d/80-net-{name-slot,setup-link}.rules
779 - fi
780 - fi
781 -}