diff options
Diffstat (limited to 'sys-fs/udev/udev-249-r2.ebuild')
-rw-r--r-- | sys-fs/udev/udev-249-r2.ebuild | 64 |
1 files changed, 59 insertions, 5 deletions
diff --git a/sys-fs/udev/udev-249-r2.ebuild b/sys-fs/udev/udev-249-r2.ebuild index ae3ddedfae41..e2c3e613c5e6 100644 --- a/sys-fs/udev/udev-249-r2.ebuild +++ b/sys-fs/udev/udev-249-r2.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" @@ -22,14 +22,21 @@ else 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+=" + elibc_musl? ( + https://dev.gentoo.org/~gyakovlev/distfiles/systemd-musl-patches-${PV}.1-r0.tar.xz + https://dev.gentoo.org/~soap/distfiles/systemd-musl-patches-${PV}.1-r0.tar.xz + )" + DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" 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 +49,7 @@ BDEPEND=" dev-libs/libxslt ${PYTHON_DEPS} $(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]') + test? ( app-text/tree ) " COMMON_DEPEND=" >=sys-apps/util-linux-2.30[${MULTILIB_USEDEP}] @@ -100,8 +108,11 @@ pkg_setup() { src_prepare() { local PATCHES=( + # backport from 250 to silence musl warnings + "${FILESDIR}/249-sys-include-posix.patch" "${FILESDIR}/249-libudev-static.patch" ) + use elibc_musl && PATCHES+=( "${WORKDIR}"/musl-patches ) default } @@ -120,6 +131,7 @@ multilib_src_configure() { # Prevent automagic deps -Dgcrypt=false -Dlibcryptsetup=false + -Didn=false -Dlibidn=false -Dlibidn2=false -Dlibiptc=false @@ -128,6 +140,12 @@ multilib_src_configure() { -Dlz4=false -Dxz=false ) + use elibc_musl && emesonargs+=( + -Dgshadow=false + -Dsmack=false + -Dutmp=false + ) + meson_src_configure } @@ -135,6 +153,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 } @@ -172,6 +193,39 @@ 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 has userpriv ${FEATURES}; then + ewarn "\'FEATURES=userpriv\' detected" + ewarn "udev tests need to run under uid 0" + ewarn "Skipping tests" + elif has usersandbox ${FEATURES}; then + ewarn "\'FEATURES=usersandbox\' detected" + ewarn "udev tests needs full access to /dev" + 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) |