From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1311195-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id AF73613946D
	for <garchives@archives.gentoo.org>; Mon,  9 Aug 2021 16:47:23 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id DBE18E0863;
	Mon,  9 Aug 2021 16:47:22 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id B8CE2E0863
	for <gentoo-commits@lists.gentoo.org>; Mon,  9 Aug 2021 16:47:22 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 383FB342CC2
	for <gentoo-commits@lists.gentoo.org>; Mon,  9 Aug 2021 16:47:21 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id E6756842
	for <gentoo-commits@lists.gentoo.org>; Mon,  9 Aug 2021 16:47:19 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1628527628.5214ebaec6f7fac27e3fc1994c1c89c9f8fd8222.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/udev/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-fs/udev/udev-249-r2.ebuild sys-fs/udev/udev-9999.ebuild
X-VCS-Directories: sys-fs/udev/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 5214ebaec6f7fac27e3fc1994c1c89c9f8fd8222
X-VCS-Branch: master
Date: Mon,  9 Aug 2021 16:47:19 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: faa184d4-1a0f-4ead-a7bc-05746edd1838
X-Archives-Hash: 58e5297866a525ddc7f22449f3796857

commit:     5214ebaec6f7fac27e3fc1994c1c89c9f8fd8222
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  9 16:46:45 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug  9 16:47:08 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5214ebae

sys-fs/udev: sync live

Bug: https://bugs.gentoo.org/807193
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-fs/udev/udev-249-r2.ebuild | 12 ++++---
 sys-fs/udev/udev-9999.ebuild   | 75 +++++++++++++++++++++++++++++++++++++++---
 2 files changed, 77 insertions(+), 10 deletions(-)

diff --git a/sys-fs/udev/udev-249-r2.ebuild b/sys-fs/udev/udev-249-r2.ebuild
index 5dbd7be0b71..a77771e66f7 100644
--- a/sys-fs/udev/udev-249-r2.ebuild
+++ b/sys-fs/udev/udev-249-r2.ebuild
@@ -15,21 +15,23 @@ else
 	else
 		MY_PN=systemd
 	fi
+
 	MY_PV="${PV/_/-}"
 	MY_P="${MY_PN}-${MY_PV}"
 	S="${WORKDIR}/${MY_P}"
 	SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
-fi
 
-# musl patches taken from:
-# http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd
-SRC_URI+="
+	# musl patches taken from:
+	# http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd
+	SRC_URI+="
 	elibc_musl? (
 		https://dev.gentoo.org/~gyakovlev/distfiles/systemd-musl-patches-${PV}.1-r1.tar.xz
 		https://dev.gentoo.org/~soap/distfiles/systemd-musl-patches-${PV}.1-r1.tar.xz
 	)"
 
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+fi
+
 DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
 HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
 

diff --git a/sys-fs/udev/udev-9999.ebuild b/sys-fs/udev/udev-9999.ebuild
index 8cc1075e8be..270009d07a3 100644
--- a/sys-fs/udev/udev-9999.ebuild
+++ b/sys-fs/udev/udev-9999.ebuild
@@ -2,9 +2,9 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{8..9} )
 
-inherit bash-completion-r1 linux-info meson-multilib ninja-utils python-any-r1 toolchain-funcs udev usr-ldscript
+inherit bash-completion-r1 flag-o-matic linux-info meson-multilib ninja-utils python-any-r1 toolchain-funcs udev usr-ldscript
 
 if [[ ${PV} = 9999* ]] ; then
 	EGIT_REPO_URI="https://github.com/systemd/systemd.git"
@@ -15,10 +15,20 @@ else
 	else
 		MY_PN=systemd
 	fi
+
 	MY_PV="${PV/_/-}"
 	MY_P="${MY_PN}-${MY_PV}"
 	S="${WORKDIR}/${MY_P}"
 	SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
+
+	# musl patches taken from:
+	# http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd
+	SRC_URI+="
+	elibc_musl? (
+		https://dev.gentoo.org/~gyakovlev/distfiles/systemd-musl-patches-${PV}.1-r1.tar.xz
+		https://dev.gentoo.org/~soap/distfiles/systemd-musl-patches-${PV}.1-r1.tar.xz
+	)"
+
 	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
 fi
 
@@ -27,9 +37,8 @@ HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
 
 LICENSE="LGPL-2.1 MIT GPL-2"
 SLOT="0"
-IUSE="acl +kmod selinux static-libs"
-
-RESTRICT="test"
+IUSE="acl +kmod selinux static-libs test"
+RESTRICT="!test? ( test )"
 
 BDEPEND="
 	dev-util/gperf
@@ -42,6 +51,10 @@ BDEPEND="
 	dev-libs/libxslt
 	${PYTHON_DEPS}
 	$(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
+	test? (
+		app-text/tree
+		dev-lang/perl
+	)
 "
 COMMON_DEPEND="
 	>=sys-apps/util-linux-2.30[${MULTILIB_USEDEP}]
@@ -101,6 +114,7 @@ pkg_setup() {
 src_prepare() {
 	local PATCHES=(
 	)
+	use elibc_musl && PATCHES+=( "${WORKDIR}"/musl-patches )
 
 	default
 }
@@ -119,6 +133,7 @@ multilib_src_configure() {
 		# Prevent automagic deps
 		-Dgcrypt=false
 		-Dlibcryptsetup=false
+		-Didn=false
 		-Dlibidn=false
 		-Dlibidn2=false
 		-Dlibiptc=false
@@ -127,6 +142,12 @@ multilib_src_configure() {
 		-Dlz4=false
 		-Dxz=false
 	)
+	use elibc_musl && emesonargs+=(
+		-Dgshadow=false
+		-Dsmack=false
+		-Dutmp=false
+	)
+
 	meson_src_configure
 }
 
@@ -134,6 +155,9 @@ src_configure() {
 	# Prevent conflicts with i686 cross toolchain, bug 559726
 	tc-export AR CC NM OBJCOPY RANLIB
 	python_setup
+
+	use elibc_musl && append-cppflags -D__UAPI_DEF_ETHHDR=0
+
 	multilib-minimal_src_configure
 }
 
@@ -171,6 +195,34 @@ multilib_src_compile() {
 	eninja "${targets[@]}"
 }
 
+multilib_src_test() {
+	# The testsuite is *very* finicky. Don't try running it in
+	# containers or anything but a full VM or on bare metal.
+	# udev calls 'mknod' a number of times, and this interacts
+	# badly with kernel namespaces.
+
+	if [[ ${EUID} -ne 0 ]]; then
+		ewarn "udev tests need to run under uid 0"
+		ewarn "Skipping tests"
+	elif has sandbox ${FEATURES}; then
+		ewarn "\'FEATURES=sandbox\' detected"
+		ewarn "udev tests needs full access to /dev"
+		ewarn "Skipping tests"
+	else
+		einfo Running tests
+
+		# two binaries required by udev-test.pl
+		eninja systemd-detect-virt test-udev
+		local -x PATH="${PWD}:${PATH}"
+
+		# prepare ${BUILD_DIR}/test/sys, required by udev-test.pl
+		"${EPYTHON}" "${S}"/test/sys-script.py test || die
+
+		# the perl script contains all the udev tests
+		"${S}"/test/udev-test.pl || die
+	fi
+}
+
 multilib_src_install() {
 	local libudev=$(readlink libudev.so.1)
 
@@ -226,6 +278,10 @@ multilib_src_install_all() {
 	einstalldocs
 }
 
+pkg_preinst() {
+	has_version 'sys-fs/eudev' && HAD_EUDEV=1
+}
+
 pkg_postinst() {
 	# Update hwdb database in case the format is changed by udev version.
 	if has_version 'sys-apps/hwids[udev]' ; then
@@ -234,4 +290,13 @@ pkg_postinst() {
 		# https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
 		[[ -z ${REPLACING_VERSIONS} ]] && udev_reload
 	fi
+
+	if [[ ${HAD_EUDEV} -eq 1 ]] ; then
+		ewarn
+		ewarn "${P} defaults to predictable interface renaming, as described in the URL below:"
+		ewarn "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+		ewarn
+		ewarn "If you wish to disable this, please see the above documentation, or set"
+		ewarn "net.ifnames=0 on the kernel command line."
+	fi
 }