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/
Date: Mon, 29 Nov 2021 16:35:39
Message-Id: 1638203711.3628ff0dbc70a885cd44fe46ecb90d7f3a8608dd.floppym@gentoo
1 commit: 3628ff0dbc70a885cd44fe46ecb90d7f3a8608dd
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 29 16:35:04 2021 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 29 16:35:11 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3628ff0d
7
8 sys-fs/udev: restore 249.6
9
10 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
11
12 sys-fs/udev/udev-249.6.ebuild | 296 ++++++++++++++++++++++++++++++++++++++++++
13 1 file changed, 296 insertions(+)
14
15 diff --git a/sys-fs/udev/udev-249.6.ebuild b/sys-fs/udev/udev-249.6.ebuild
16 new file mode 100644
17 index 000000000000..b42753db0add
18 --- /dev/null
19 +++ b/sys-fs/udev/udev-249.6.ebuild
20 @@ -0,0 +1,296 @@
21 +# Copyright 2003-2021 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=7
25 +PYTHON_COMPAT=( python3_{8..10} )
26 +
27 +inherit bash-completion-r1 flag-o-matic linux-info meson-multilib ninja-utils python-any-r1 toolchain-funcs udev usr-ldscript
28 +
29 +if [[ ${PV} = 9999* ]] ; then
30 + EGIT_REPO_URI="https://github.com/systemd/systemd.git"
31 + inherit git-r3
32 +else
33 + if [[ ${PV} == *.* ]] ; then
34 + MY_PN=systemd-stable
35 + else
36 + MY_PN=systemd
37 + fi
38 +
39 + MY_PV="${PV/_/-}"
40 + MY_P="${MY_PN}-${MY_PV}"
41 + S="${WORKDIR}/${MY_P}"
42 + SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
43 +
44 + # musl patches taken from:
45 + # http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd
46 + MUSL_PATCHSET="249.5"
47 + SRC_URI+="
48 + elibc_musl? (
49 + https://dev.gentoo.org/~gyakovlev/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.xz
50 + https://dev.gentoo.org/~soap/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.xz
51 + )"
52 +
53 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
54 +fi
55 +
56 +DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
57 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
58 +
59 +LICENSE="LGPL-2.1 MIT GPL-2"
60 +SLOT="0"
61 +IUSE="acl +kmod selinux test"
62 +RESTRICT="!test? ( test )"
63 +
64 +BDEPEND="
65 + dev-util/gperf
66 + sys-devel/gettext
67 + >=sys-apps/coreutils-8.16
68 + virtual/pkgconfig
69 + app-text/docbook-xml-dtd:4.2
70 + app-text/docbook-xml-dtd:4.5
71 + app-text/docbook-xsl-stylesheets
72 + dev-libs/libxslt
73 + ${PYTHON_DEPS}
74 + $(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
75 + test? (
76 + app-text/tree
77 + dev-lang/perl
78 + )
79 +"
80 +COMMON_DEPEND="
81 + >=sys-apps/util-linux-2.30[${MULTILIB_USEDEP}]
82 + sys-libs/libcap:0=[${MULTILIB_USEDEP}]
83 + virtual/libcrypt:=[${MULTILIB_USEDEP}]
84 + acl? ( sys-apps/acl )
85 + kmod? ( >=sys-apps/kmod-15 )
86 + selinux? ( >=sys-libs/libselinux-2.1.9 )
87 +"
88 +DEPEND="${COMMON_DEPEND}
89 + >=sys-kernel/linux-headers-3.9
90 +"
91 +RDEPEND="${COMMON_DEPEND}
92 + acct-group/kmem
93 + acct-group/tty
94 + acct-group/audio
95 + acct-group/cdrom
96 + acct-group/dialout
97 + acct-group/disk
98 + acct-group/input
99 + acct-group/kvm
100 + acct-group/lp
101 + acct-group/render
102 + acct-group/tape
103 + acct-group/video
104 + !sys-apps/gentoo-systemd-integration
105 + !sys-apps/systemd
106 +"
107 +PDEPEND=">=sys-apps/hwids-20140304[udev]
108 + >=sys-fs/udev-init-scripts-34"
109 +
110 +python_check_deps() {
111 + has_version -b "dev-python/jinja[${PYTHON_USEDEP}]"
112 +}
113 +
114 +pkg_setup() {
115 + if [[ ${MERGE_TYPE} != buildonly ]] ; then
116 + CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER ~UNIX"
117 + linux-info_pkg_setup
118 +
119 + # CONFIG_FHANDLE was introduced by 2.6.39
120 + local MINKV=2.6.39
121 +
122 + if kernel_is -lt ${MINKV//./ } ; then
123 + eerror "Your running kernel is too old to run this version of ${P}"
124 + eerror "You need to upgrade kernel at least to ${MINKV}"
125 + fi
126 +
127 + if kernel_is -lt 3 7 ; then
128 + ewarn "Your running kernel is too old to have firmware loader and"
129 + ewarn "this version of ${P} doesn't have userspace firmware loader"
130 + ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
131 + fi
132 + fi
133 +}
134 +
135 +src_prepare() {
136 + local PATCHES=(
137 + )
138 + use elibc_musl && PATCHES+=( "${WORKDIR}"/musl-patches )
139 +
140 + default
141 +}
142 +
143 +multilib_src_configure() {
144 + local emesonargs=(
145 + $(meson_native_use_bool acl)
146 + -Defi=false
147 + $(meson_native_use_bool kmod)
148 + $(meson_native_use_bool selinux)
149 + -Dlink-udev-shared=false
150 + -Dsplit-usr=true
151 + -Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
152 +
153 + # Prevent automagic deps
154 + -Dgcrypt=false
155 + -Dlibcryptsetup=false
156 + -Didn=false
157 + -Dlibidn=false
158 + -Dlibidn2=false
159 + -Dlibiptc=false
160 + -Dp11kit=false
161 + -Dseccomp=false
162 + -Dlz4=false
163 + -Dxz=false
164 + )
165 + use elibc_musl && emesonargs+=(
166 + -Dgshadow=false
167 + -Dsmack=false
168 + -Dutmp=false
169 + )
170 +
171 + meson_src_configure
172 +}
173 +
174 +src_configure() {
175 + # Prevent conflicts with i686 cross toolchain, bug 559726
176 + tc-export AR CC NM OBJCOPY RANLIB
177 + python_setup
178 +
179 + use elibc_musl && append-cppflags -D__UAPI_DEF_ETHHDR=0
180 +
181 + multilib-minimal_src_configure
182 +}
183 +
184 +multilib_src_compile() {
185 + # meson creates this link
186 + local libudev=$(readlink libudev.so.1)
187 +
188 + local targets=(
189 + ${libudev}
190 + src/libudev/libudev.pc
191 + )
192 + if multilib_is_native_abi; then
193 + targets+=(
194 + udevadm
195 + src/udev/ata_id
196 + src/udev/cdrom_id
197 + src/udev/fido_id
198 + src/udev/mtd_probe
199 + src/udev/scsi_id
200 + src/udev/udev.pc
201 + src/udev/v4l_id
202 + man/udev.conf.5
203 + man/systemd.link.5
204 + man/hwdb.7
205 + man/udev.7
206 + man/systemd-udevd.service.8
207 + man/udevadm.8
208 + rules.d/50-udev-default.rules
209 + rules.d/64-btrfs.rules
210 + )
211 + fi
212 + eninja "${targets[@]}"
213 +}
214 +
215 +src_test() {
216 + # The testsuite is *very* finicky. Don't try running it in
217 + # containers or anything but a full VM or on bare metal.
218 + # udev calls 'mknod' a number of times, and this interacts
219 + # badly with kernel namespaces.
220 +
221 + if [[ ! -w /dev ]]; then
222 + ewarn "udev tests needs full access to /dev"
223 + ewarn "Skipping tests"
224 + else
225 + meson-multilib_src_test
226 + fi
227 +}
228 +
229 +multilib_src_test() {
230 + # two binaries required by udev-test.pl
231 + eninja systemd-detect-virt test-udev
232 + local -x PATH="${PWD}:${PATH}"
233 +
234 + # prepare ${BUILD_DIR}/test/sys, required by udev-test.pl
235 + "${EPYTHON}" "${S}"/test/sys-script.py test || die
236 +
237 + # the perl script contains all the udev tests
238 + "${S}"/test/udev-test.pl || die
239 +}
240 +
241 +multilib_src_install() {
242 + local libudev=$(readlink libudev.so.1)
243 +
244 + dolib.so {${libudev},libudev.so.1,libudev.so}
245 + gen_usr_ldscript -a udev
246 +
247 + insinto "/usr/$(get_libdir)/pkgconfig"
248 + doins src/libudev/libudev.pc
249 +
250 + if multilib_is_native_abi ; then
251 + into /
252 + dobin udevadm
253 +
254 + dosym ../../bin/udevadm /lib/systemd/systemd-udevd
255 +
256 + exeinto /lib/udev
257 + doexe src/udev/{ata_id,cdrom_id,fido_id,mtd_probe,scsi_id,v4l_id}
258 +
259 + # Install generated rules (${BUILD_DIR}/rules.d/*.rules)
260 + insinto /lib/udev/rules.d
261 + doins rules.d/*.rules
262 +
263 + insinto /usr/share/pkgconfig
264 + doins src/udev/udev.pc
265 +
266 + mv man/systemd-udevd.service.8 man/systemd-udevd.8 || die
267 + rm man/systemd-udevd-{control,kernel}.socket.8 || die
268 + doman man/*.[0-9]
269 + fi
270 +}
271 +
272 +multilib_src_install_all() {
273 + doheader src/libudev/libudev.h
274 +
275 + insinto /etc/udev
276 + doins src/udev/udev.conf
277 + keepdir /etc/udev/{hwdb.d,rules.d}
278 +
279 + insinto /lib/systemd/network
280 + doins network/99-default.link
281 +
282 + # Install static rules (${S}/rules.d/*.rules)
283 + insinto /lib/udev/rules.d
284 + doins rules.d/*.rules
285 + doins "${FILESDIR}"/40-gentoo.rules
286 +
287 + dobashcomp shell-completion/bash/udevadm
288 +
289 + insinto /usr/share/zsh/site-functions
290 + doins shell-completion/zsh/_udevadm
291 +
292 + einstalldocs
293 +}
294 +
295 +pkg_preinst() {
296 + has_version 'sys-fs/eudev' && HAD_EUDEV=1
297 +}
298 +
299 +pkg_postinst() {
300 + # Update hwdb database in case the format is changed by udev version.
301 + if has_version 'sys-apps/hwids[udev]' ; then
302 + udevadm hwdb --update --root="${ROOT}"
303 + # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
304 + # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
305 + [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
306 + fi
307 +
308 + if [[ ${HAD_EUDEV} -eq 1 ]] ; then
309 + ewarn
310 + ewarn "${P} defaults to predictable interface renaming, as described in the URL below:"
311 + ewarn "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
312 + ewarn
313 + ewarn "If you wish to disable this, please see the above documentation, or set"
314 + ewarn "net.ifnames=0 on the kernel command line."
315 + fi
316 +}