sys-apps/systemd-utils: drop 250.7, 250.8, 251.2-r1, 251.3, 251.4

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
This commit is contained in:
Mike Gilbert
2022-09-18 11:50:02 -04:00
parent 18bf1fb6e1
commit e58e5928b9
8 changed files with 0 additions and 2740 deletions

View File

@@ -1,7 +1,2 @@
DIST systemd-musl-patches-250.4.tar.gz 28065 BLAKE2B b8366c4bb29705e3f41f07d0105c4d252d543aaac178e968663660eeb573da034813aa50a96c74ac78ae5efeea379e00df33c5a039ec828cf93450ed23786252 SHA512 66e41fab1873021913c32e3f43300ea7babd18a36e6543838ab7fab4c44f5590c6a7414dd50c7ee81e5513b0e5aa01cb6df4231e8e06c609d63011a32b524213
DIST systemd-musl-patches-251.2.tar.gz 28512 BLAKE2B 4ac6a5220dab8409962a3954af2fb2484af718d0f282129957236ce241fbe8538a90d507a96c7c3d86f4f408ab784a6888b37486405d3276e7734a1bd5aa9680 SHA512 6e56b62234ac54929faea5a7cad699d0b932f869b48e3ba4e1f349a88653b7c787efec24a09b00290c3dc566614e3c1dc2f3c04f04e943f513108a91eca1be82
DIST systemd-stable-250.7.tar.gz 11214975 BLAKE2B 5d94b4b1f8b0cd6e8284a89ac0d4bd373eccdad2c3d6e6c453df79c8df47ee0f9cfbde764b72b1f9d172d07e2d9f1f1f41c1ab254cf4abd0722469ebc3ad7cf8 SHA512 99bc6f0c9757b280cb694f3fb4d6fe04d5ce55583eb2bae5ddeb324bb5ee9930c1720fcc27293d90cddba188473653ec541a471ae8115710a5850c26d0ba215d
DIST systemd-stable-250.8.tar.gz 11215608 BLAKE2B 2a66a2d8cb70f265b59640ace907b8d927018fe11c8977e134a33d67683f06b26c1eb3fd5afe40431bc2c15827ba60c46a37ff1a0a4c716dd24b73aca1583d00 SHA512 653f527f10779a31213da06f7587a3617bd4b823bd3e5a43d626c5a4a7301e4a0fb42cf1fd056d28af6d87e52f258da59d5f0d4a2d98076905f9d3fcda6d18fd
DIST systemd-stable-251.2.tar.gz 11434645 BLAKE2B a7e118649a7d27b789206ea9f6f2d0314e44561367506ee763a9e98fb97579b3fc49c7a402c8da142945dc98444558f0e311557f52c50863cebc7532c17c651f SHA512 0c4011b685a1e8d535af123cbaf79ab53d59ea665ca5350ab1077ad4e962b49c1fd5b1b5bb3f28c3e28145dfd02aa83023f78de5edec15afe84e3e06e742a67c
DIST systemd-stable-251.3.tar.gz 11435458 BLAKE2B 544238536848ab390b2476d5ad95d33998674be50020b8db0627bb9d0c86be6576c404ce786b01ceec86f1c75b174c6fc2d7e0d7fbab802a78f48c9d0915c2b8 SHA512 fb5b8dc1742562ef95469e90d406cfb6dfcb337860ad1208b460414b88ff0565071bde797d195faa62761206abc881829de6b1009e5d727cad2dfe0764310d5f
DIST systemd-stable-251.4.tar.gz 11440203 BLAKE2B 58a0ee4adcc9d35b15b9cc98b3da81d1103b61a6c0bee722468a5113cd7d6de1d40c46ef964ba9ecc4746e81b516ae4b2f1d046874d62db066735c652592612e SHA512 7bbfadd80b88a4c3510a5e4e3572e4eab71dafbf6289da038e552988e09ee8da16da3c9bb8a4fbbde6c6236e0e3c352b0a33f9ee0b84f10241f3499383387738

View File

@@ -1,40 +0,0 @@
From 55bf689308ed00692494d3623bd2064f33c9bbbe Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Sun, 17 Apr 2022 09:48:28 -0400
Subject: [PATCH] Add test support for systemd-tmpfiles.standalone
---
meson.build | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 458370e83d..d60be1b050 100644
--- a/meson.build
+++ b/meson.build
@@ -3451,7 +3451,7 @@ if conf.get('ENABLE_TMPFILES') == 1
endif
if have_standalone_binaries
- public_programs += executable(
+ exe = executable(
'systemd-tmpfiles.standalone',
systemd_tmpfiles_sources,
include_directories : includes,
@@ -3463,6 +3463,14 @@ if conf.get('ENABLE_TMPFILES') == 1
dependencies : [libacl],
install : true,
install_dir : rootbindir)
+ public_programs += exe
+
+ if want_tests != 'false'
+ test('test-systemd-tmpfiles.standalone',
+ test_systemd_tmpfiles_py,
+ # https://github.com/mesonbuild/meson/issues/2681
+ args : exe.full_path())
+ endif
endif
endif
--
2.35.1

View File

@@ -1,154 +0,0 @@
https://bugs.gentoo.org/863218
https://github.com/systemd/systemd/issues/23984
https://github.com/systemd/systemd/commit/3657d3a01c7e25ff86d7a4642065b367c4ff7484
https://github.com/systemd/systemd/commit/0a58cd00454cc7b57b04f3a4a334584d743d7f7a
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Sat, 23 Jul 2022 10:38:49 +0000
Subject: [PATCH] glibc: Remove #include <linux/fs.h> to resolve
fsconfig_command/mount_attr conflict with glibc 2.36
--- a/meson.build
+++ b/meson.build
@@ -511,7 +511,6 @@ decl_headers = '''
#include <uchar.h>
#include <sys/mount.h>
#include <sys/stat.h>
-#include <linux/fs.h>
'''
foreach decl : ['char16_t',
@@ -523,6 +522,17 @@ foreach decl : ['char16_t',
# We get -1 if the size cannot be determined
have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0
+ if decl == 'struct mount_attr'
+ if have
+ want_linux_fs_h = false
+ else
+ have = cc.sizeof(decl,
+ prefix : decl_headers + '#include <linux/fs.h>',
+ args : '-D_GNU_SOURCE') > 0
+ want_linux_fs_h = have
+ endif
+ endif
+
if decl == 'struct statx'
if have
want_linux_stat_h = false
@@ -538,6 +548,7 @@ foreach decl : ['char16_t',
endforeach
conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h)
+conf.set10('WANT_LINUX_FS_H', want_linux_fs_h)
foreach ident : ['secure_getenv', '__secure_getenv']
conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
--- a/src/basic/fd-util.c
+++ b/src/basic/fd-util.c
@@ -3,7 +3,9 @@
#include <errno.h>
#include <fcntl.h>
#include <linux/btrfs.h>
+#if WANT_LINUX_FS_H
#include <linux/fs.h>
+#endif
#include <linux/magic.h>
#include <sys/ioctl.h>
#include <sys/resource.h>
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -7,7 +7,9 @@
#include <sys/file.h>
#include <sys/mount.h>
#include <unistd.h>
+#if WANT_LINUX_FS_H
#include <linux/fs.h>
+#endif
#include "alloc-util.h"
#include "base-filesystem.h"
--- a/src/shared/mount-util.c
+++ b/src/shared/mount-util.c
@@ -7,7 +7,9 @@
#include <sys/statvfs.h>
#include <unistd.h>
#include <linux/loop.h>
+#if WANT_LINUX_FS_H
#include <linux/fs.h>
+#endif
#include "alloc-util.h"
#include "chase-symlinks.h"
From 0a58cd00454cc7b57b04f3a4a334584d743d7f7a Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Tue, 26 Jul 2022 20:03:12 +0900
Subject: [PATCH] home: drop conflicted headers
Fixes #24117.
--- a/src/basic/missing_fs.h
+++ b/src/basic/missing_fs.h
@@ -64,3 +64,8 @@
#ifndef FS_PROJINHERIT_FL
#define FS_PROJINHERIT_FL 0x20000000
#endif
+
+/* linux/fscrypt.h */
+#ifndef FS_KEY_DESCRIPTOR_SIZE
+#define FS_KEY_DESCRIPTOR_SIZE 8
+#endif
--- a/src/home/homework-cifs.c
+++ b/src/home/homework-cifs.c
@@ -1,5 +1,10 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <sys/mount.h>
+#if WANT_LINUX_FS_H
+#include <linux/fs.h>
+#endif
+
#include "dirent-util.h"
#include "fd-util.h"
#include "fileio.h"
--- a/src/home/homework-luks.c
+++ b/src/home/homework-luks.c
@@ -4,7 +4,6 @@
#include <poll.h>
#include <sys/file.h>
#include <sys/ioctl.h>
-#include <sys/mount.h>
#include <sys/xattr.h>
#if HAVE_VALGRIND_MEMCHECK_H
--- a/src/home/homework-mount.c
+++ b/src/home/homework-mount.c
@@ -2,7 +2,9 @@
#include <sched.h>
#include <sys/mount.h>
+#if WANT_LINUX_FS_H
#include <linux/fs.h>
+#endif
#include "alloc-util.h"
#include "fd-util.h"
--- a/src/home/homework.h
+++ b/src/home/homework.h
@@ -1,13 +1,14 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <linux/fs.h>
#include <sys/vfs.h>
#include "sd-id128.h"
+#include "cryptsetup-util.h"
#include "homework-password-cache.h"
#include "loop-util.h"
+#include "missing_fs.h" /* for FS_KEY_DESCRIPTOR_SIZE, do not include linux/fs.h */
#include "missing_keyctl.h"
#include "missing_syscall.h"
#include "user-record.h"

View File

@@ -1,500 +0,0 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..11} )
QA_PKGCONFIG_VERSION=$(ver_cut 1)
inherit bash-completion-r1 flag-o-matic meson-multilib python-any-r1 toolchain-funcs udev usr-ldscript
DESCRIPTION="Utilities split out from systemd for OpenRC users"
HOMEPAGE="https://systemd.io/"
if [[ ${PV} == *.* ]]; then
MY_P="systemd-stable-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/systemd/systemd-stable/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
else
MY_P="systemd-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/systemd/systemd/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
fi
MUSL_PATCHSET="systemd-musl-patches-250.4"
SRC_URI+=" elibc_musl? ( https://dev.gentoo.org/~floppym/dist/${MUSL_PATCHSET}.tar.gz )"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="+acl boot +kmod selinux sysusers +tmpfiles test +udev"
REQUIRED_USE="|| ( boot tmpfiles sysusers udev )"
RESTRICT="!test? ( test )"
COMMON_DEPEND="
selinux? ( sys-libs/libselinux:0= )
tmpfiles? (
acl? ( sys-apps/acl:0= )
)
udev? (
>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
kmod? ( >=sys-apps/kmod-15:0= )
)
!udev? (
>=sys-apps/util-linux-2.30:0=
sys-libs/libcap:0=
virtual/libcrypt:=
)
"
DEPEND="${COMMON_DEPEND}
boot? (
>=sys-boot/gnu-efi-3.0.2
)
>=sys-kernel/linux-headers-3.11
"
RDEPEND="${COMMON_DEPEND}
boot? ( !<sys-boot/systemd-boot-250 )
tmpfiles? ( !<sys-apps/systemd-tmpfiles-250 )
udev? (
acct-group/audio
acct-group/cdrom
acct-group/dialout
acct-group/disk
acct-group/input
acct-group/kmem
acct-group/kvm
acct-group/lp
acct-group/render
acct-group/sgx
acct-group/tape
acct-group/tty
acct-group/video
!sys-apps/gentoo-systemd-integration
!sys-apps/hwids[udev]
!<sys-fs/udev-250
!sys-fs/eudev
)
!sys-apps/systemd
"
PDEPEND="
udev? ( >=sys-fs/udev-init-scripts-34 )
"
BDEPEND="
$(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt
dev-util/gperf
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
"
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
python_check_deps() {
has_version -b "dev-python/jinja[${PYTHON_USEDEP}]"
}
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
src_prepare() {
local PATCHES=(
"${FILESDIR}/250.4-test-systemd-tmpfiles.standalone.patch"
)
if use elibc_musl; then
PATCHES+=( "${WORKDIR}/${MUSL_PATCHSET}" )
fi
default
# Remove install_rpath; we link statically
local rpath_pattern="install_rpath : rootlibexecdir,"
grep -q -e "${rpath_pattern}" meson.build || die
sed -i -e "/${rpath_pattern}/d" meson.build || die
}
multilib_src_configure() {
# When bumping to 251, please keep this, but add the revert patch
# like in sys-apps/systemd!
#
# Broken with FORTIFY_SOURCE=3 without a patch. And the patch
# wasn't backported to 250.x, but it turns out to break Clang
# anyway: bug #841770.
#
# Our toolchain sets F_S=2 by default w/ >= -O2, so we need
# to unset F_S first, then explicitly set 2, to negate any default
# and anything set by the user if they're choosing 3 (or if they've
# modified GCC to set 3).
#
if is-flagq '-O[23]' || is-flagq '-Ofast' ; then
# We can't unconditionally do this b/c we fortify needs
# some level of optimisation.
filter-flags -D_FORTIFY_SOURCE=3
append-cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
fi
local emesonargs=(
-Drootprefix="${EPREFIX:-/}"
-Dsysvinit-path=
$(meson_native_use_bool boot efi)
$(meson_native_use_bool boot gnu-efi)
$(meson_native_use_bool selinux)
$(meson_native_use_bool sysusers)
$(meson_use test tests)
$(meson_native_use_bool tmpfiles)
$(meson_use udev hwdb)
-Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
# Link staticly with libsystemd-shared
-Dlink-boot-shared=false
-Dlink-udev-shared=false
# systemd-tmpfiles has a separate "systemd-tmpfiles.standalone" target
-Dstandalone-binaries=true
# Disable all optional features
-Dadm-group=false
-Danalyze=false
-Dapparmor=false
-Daudit=false
-Dbacklight=false
-Dbinfmt=false
-Dbzip2=false
-Dcoredump=false
-Ddbus=false
-Delfutils=false
-Denvironment-d=false
-Dfdisk=false
-Dgcrypt=false
-Dglib=false
-Dgshadow=false
-Dgnutls=false
-Dhibernate=false
-Dhostnamed=false
-Didn=false
-Dima=false
-Dinitrd=false
-Dfirstboot=false
-Dkernel-install=false
-Dldconfig=false
-Dlibcryptsetup=false
-Dlibcurl=false
-Dlibfido2=false
-Dlibidn=false
-Dlibidn2=false
-Dlibiptc=false
-Dlocaled=false
-Dlogind=false
-Dlz4=false
-Dmachined=false
-Dmicrohttpd=false
-Dnetworkd=false
-Dnscd=false
-Dnss-myhostname=false
-Dnss-resolve=false
-Dnss-systemd=false
-Doomd=false
-Dopenssl=false
-Dp11kit=false
-Dpam=false
-Dpcre2=false
-Dpolkit=false
-Dportabled=false
-Dpstore=false
-Dpwquality=false
-Drandomseed=false
-Dresolve=false
-Drfkill=false
-Dseccomp=false
-Dsmack=false
-Dsysext=false
-Dtimedated=false
-Dtimesyncd=false
-Dtpm=false
-Dqrencode=false
-Dquotacheck=false
-Duserdb=false
-Dutmp=false
-Dvconsole=false
-Dwheel-group=false
-Dxdg-autostart=false
-Dxkbcommon=false
-Dxz=false
-Dzlib=false
-Dzstd=false
)
if use tmpfiles || use udev; then
emesonargs+=( $(meson_native_use_bool acl) )
else
emesonargs+=( -Dacl=false )
fi
if use udev; then
emesonargs+=( $(meson_native_use_bool kmod) )
else
emesonargs+=( -Dkmod=false )
fi
if use elibc_musl; then
# Avoid redefinition of struct ethhdr.
append-cppflags -D__UAPI_DEF_ETHHDR=0
fi
if multilib_is_native_abi || use udev; then
meson_src_configure
fi
}
efi_arch() {
case "$(tc-arch)" in
amd64) echo x64 ;;
arm) echo arm ;;
arm64) echo aa64 ;;
x86) echo x86 ;;
esac
}
multilib_src_compile() {
local targets=()
if multilib_is_native_abi; then
if use boot; then
targets+=(
bootctl
man/bootctl.1
man/kernel-install.8
src/boot/efi/linux$(efi_arch).{efi,elf}.stub
src/boot/efi/systemd-boot$(efi_arch).efi
)
fi
if use sysusers; then
targets+=(
systemd-sysusers.standalone
man/sysusers.d.5
man/systemd-sysusers.8
)
if use test; then
targets+=(
systemd-runtest.env
)
fi
fi
if use tmpfiles; then
targets+=(
systemd-tmpfiles.standalone
man/tmpfiles.d.5
man/systemd-tmpfiles.8
)
if use test; then
targets+=( test-tmpfiles )
fi
fi
if use udev; then
targets+=(
udevadm
systemd-hwdb
src/udev/ata_id
src/udev/cdrom_id
src/udev/fido_id
src/udev/mtd_probe
src/udev/scsi_id
src/udev/udev.pc
src/udev/v4l_id
man/udev.conf.5
man/systemd.link.5
man/hwdb.7
man/udev.7
man/systemd-hwdb.8
man/systemd-udevd.service.8
man/udevadm.8
hwdb.d/60-autosuspend-chromiumos.hwdb
rules.d/50-udev-default.rules
rules.d/64-btrfs.rules
)
if use test; then
targets+=(
# Used by udev-test.pl
systemd-detect-virt
test/sys
test-udev
test-fido-id-desc
test-udev-builtin
test-udev-event
test-udev-netlink
test-udev-node
test-udev-util
)
fi
fi
fi
if use udev; then
targets+=(
udev:shared_library
src/libudev/libudev.pc
)
if use test; then
targets+=(
test-libudev
test-libudev-sym
test-udev-device-thread
)
fi
fi
if multilib_is_native_abi || use udev; then
meson_src_compile "${targets[@]}"
fi
}
multilib_src_test() {
local tests=()
if multilib_is_native_abi; then
if use sysusers; then
tests+=(
test-sysusers.standalone
)
fi
if use tmpfiles; then
tests+=(
test-systemd-tmpfiles.standalone
test-tmpfiles
)
fi
if use udev; then
tests+=(
rule-syntax-check
test-fido-id-desc
test-udev-builtin
test-udev-event
test-udev-netlink
test-udev-node
test-udev-util
)
if [[ -w /dev ]]; then
tests+=( udev-test )
else
ewarn "Skipping udev-test (needs write access to /dev)"
fi
fi
fi
if use udev; then
tests+=(
test-libudev
test-libudev-sym
test-udev-device-thread
)
fi
if [[ ${#tests[@]} -ne 0 ]]; then
meson_src_test "${tests[@]}"
fi
}
multilib_src_install() {
if multilib_is_native_abi; then
if use boot; then
into /usr
dobin bootctl
doman man/{bootctl.1,kernel-install.8}
insinto usr/lib/systemd/boot/efi
doins src/boot/efi/{linux$(efi_arch).{efi,elf}.stub,systemd-boot$(efi_arch).efi}
fi
if use sysusers; then
into /
newbin systemd-sysusers{.standalone,}
doman man/{systemd-sysusers.8,sysusers.d.5}
fi
if use tmpfiles; then
into /
newbin systemd-tmpfiles{.standalone,}
doman man/{systemd-tmpfiles.8,tmpfiles.d.5}
fi
if use udev; then
into /
dobin udevadm systemd-hwdb
dosym ../../bin/udevadm /lib/systemd/systemd-udevd
exeinto /lib/udev
doexe src/udev/{ata_id,cdrom_id,fido_id,mtd_probe,scsi_id,v4l_id}
insinto /lib/udev/rules.d
doins rules.d/*.rules
insinto /lib/udev/hwdb.d
doins hwdb.d/*.hwdb
insinto /usr/share/pkgconfig
doins src/udev/udev.pc
doman man/{udev.conf.5,systemd.link.5,hwdb.7,systemd-hwdb.8,udev.7,udevadm.8}
newman man/systemd-udevd.service.8 systemd-udevd.8
fi
fi
if use udev; then
into /usr
dolib.so "$(readlink libudev.so.1)" libudev.so{.1,}
gen_usr_ldscript -a udev
insinto "/usr/$(get_libdir)/pkgconfig"
doins src/libudev/libudev.pc
fi
}
multilib_src_install_all() {
einstalldocs
if use boot; then
into /usr
dobin src/kernel-install/kernel-install
exeinto usr/lib/kernel/install.d
doexe src/kernel-install/*.install
dobashcomp shell-completion/bash/bootctl
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/{_bootctl,_kernel-install}
fi
if use tmpfiles; then
doinitd "${FILESDIR}"/systemd-tmpfiles-setup
doinitd "${FILESDIR}"/systemd-tmpfiles-setup-dev
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/_systemd-tmpfiles
fi
if use udev; then
doheader src/libudev/libudev.h
insinto /etc/udev
doins src/udev/udev.conf
keepdir /etc/udev/{hwdb.d,rules.d}
insinto /lib/systemd/network
doins network/99-default.link
insinto /lib/udev/rules.d
doins rules.d/*.rules
doins "${FILESDIR}"/40-gentoo.rules
insinto /lib/udev/hwdb.d
doins hwdb.d/*.hwdb
dobashcomp shell-completion/bash/udevadm
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/_udevadm
fi
}
add_service() {
local initd=$1
local runlevel=$2
ebegin "Adding '${initd}' service to the '${runlevel}' runlevel"
mkdir -p "${EROOT}/etc/runlevels/${runlevel}" &&
ln -snf "${EPREFIX}/etc/init.d/${initd}" "${EROOT}/etc/runlevels/${runlevel}/${initd}"
eend $?
}
pkg_postinst() {
if [[ -z ${REPLACING_VERSIONS} ]]; then
add_service systemd-tmpfiles-setup-dev sysinit
add_service systemd-tmpfiles-setup boot
fi
if use udev; then
ebegin "Updating hwdb"
systemd-hwdb --root="${ROOT}" update
eend $?
udev_reload
fi
}

View File

@@ -1,500 +0,0 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..11} )
QA_PKGCONFIG_VERSION=$(ver_cut 1)
inherit bash-completion-r1 flag-o-matic meson-multilib python-any-r1 toolchain-funcs udev usr-ldscript
DESCRIPTION="Utilities split out from systemd for OpenRC users"
HOMEPAGE="https://systemd.io/"
if [[ ${PV} == *.* ]]; then
MY_P="systemd-stable-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/systemd/systemd-stable/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
else
MY_P="systemd-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/systemd/systemd/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
fi
MUSL_PATCHSET="systemd-musl-patches-250.4"
SRC_URI+=" elibc_musl? ( https://dev.gentoo.org/~floppym/dist/${MUSL_PATCHSET}.tar.gz )"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
IUSE="+acl boot +kmod selinux sysusers +tmpfiles test +udev"
REQUIRED_USE="|| ( boot tmpfiles sysusers udev )"
RESTRICT="!test? ( test )"
COMMON_DEPEND="
selinux? ( sys-libs/libselinux:0= )
tmpfiles? (
acl? ( sys-apps/acl:0= )
)
udev? (
>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
kmod? ( >=sys-apps/kmod-15:0= )
)
!udev? (
>=sys-apps/util-linux-2.30:0=
sys-libs/libcap:0=
virtual/libcrypt:=
)
"
DEPEND="${COMMON_DEPEND}
boot? (
>=sys-boot/gnu-efi-3.0.2
)
>=sys-kernel/linux-headers-3.11
"
RDEPEND="${COMMON_DEPEND}
boot? ( !<sys-boot/systemd-boot-250 )
tmpfiles? ( !<sys-apps/systemd-tmpfiles-250 )
udev? (
acct-group/audio
acct-group/cdrom
acct-group/dialout
acct-group/disk
acct-group/input
acct-group/kmem
acct-group/kvm
acct-group/lp
acct-group/render
acct-group/sgx
acct-group/tape
acct-group/tty
acct-group/video
!sys-apps/gentoo-systemd-integration
!sys-apps/hwids[udev]
!<sys-fs/udev-250
!sys-fs/eudev
)
!sys-apps/systemd
"
PDEPEND="
udev? ( >=sys-fs/udev-init-scripts-34 )
"
BDEPEND="
$(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt
dev-util/gperf
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
"
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
python_check_deps() {
has_version -b "dev-python/jinja[${PYTHON_USEDEP}]"
}
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
src_prepare() {
local PATCHES=(
"${FILESDIR}/250.4-test-systemd-tmpfiles.standalone.patch"
)
if use elibc_musl; then
PATCHES+=( "${WORKDIR}/${MUSL_PATCHSET}" )
fi
default
# Remove install_rpath; we link statically
local rpath_pattern="install_rpath : rootlibexecdir,"
grep -q -e "${rpath_pattern}" meson.build || die
sed -i -e "/${rpath_pattern}/d" meson.build || die
}
multilib_src_configure() {
# When bumping to 251, please keep this, but add the revert patch
# like in sys-apps/systemd!
#
# Broken with FORTIFY_SOURCE=3 without a patch. And the patch
# wasn't backported to 250.x, but it turns out to break Clang
# anyway: bug #841770.
#
# Our toolchain sets F_S=2 by default w/ >= -O2, so we need
# to unset F_S first, then explicitly set 2, to negate any default
# and anything set by the user if they're choosing 3 (or if they've
# modified GCC to set 3).
#
if is-flagq '-O[23]' || is-flagq '-Ofast' ; then
# We can't unconditionally do this b/c we fortify needs
# some level of optimisation.
filter-flags -D_FORTIFY_SOURCE=3
append-cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
fi
local emesonargs=(
-Drootprefix="${EPREFIX:-/}"
-Dsysvinit-path=
$(meson_native_use_bool boot efi)
$(meson_native_use_bool boot gnu-efi)
$(meson_native_use_bool selinux)
$(meson_native_use_bool sysusers)
$(meson_use test tests)
$(meson_native_use_bool tmpfiles)
$(meson_use udev hwdb)
-Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
# Link staticly with libsystemd-shared
-Dlink-boot-shared=false
-Dlink-udev-shared=false
# systemd-tmpfiles has a separate "systemd-tmpfiles.standalone" target
-Dstandalone-binaries=true
# Disable all optional features
-Dadm-group=false
-Danalyze=false
-Dapparmor=false
-Daudit=false
-Dbacklight=false
-Dbinfmt=false
-Dbzip2=false
-Dcoredump=false
-Ddbus=false
-Delfutils=false
-Denvironment-d=false
-Dfdisk=false
-Dgcrypt=false
-Dglib=false
-Dgshadow=false
-Dgnutls=false
-Dhibernate=false
-Dhostnamed=false
-Didn=false
-Dima=false
-Dinitrd=false
-Dfirstboot=false
-Dkernel-install=false
-Dldconfig=false
-Dlibcryptsetup=false
-Dlibcurl=false
-Dlibfido2=false
-Dlibidn=false
-Dlibidn2=false
-Dlibiptc=false
-Dlocaled=false
-Dlogind=false
-Dlz4=false
-Dmachined=false
-Dmicrohttpd=false
-Dnetworkd=false
-Dnscd=false
-Dnss-myhostname=false
-Dnss-resolve=false
-Dnss-systemd=false
-Doomd=false
-Dopenssl=false
-Dp11kit=false
-Dpam=false
-Dpcre2=false
-Dpolkit=false
-Dportabled=false
-Dpstore=false
-Dpwquality=false
-Drandomseed=false
-Dresolve=false
-Drfkill=false
-Dseccomp=false
-Dsmack=false
-Dsysext=false
-Dtimedated=false
-Dtimesyncd=false
-Dtpm=false
-Dqrencode=false
-Dquotacheck=false
-Duserdb=false
-Dutmp=false
-Dvconsole=false
-Dwheel-group=false
-Dxdg-autostart=false
-Dxkbcommon=false
-Dxz=false
-Dzlib=false
-Dzstd=false
)
if use tmpfiles || use udev; then
emesonargs+=( $(meson_native_use_bool acl) )
else
emesonargs+=( -Dacl=false )
fi
if use udev; then
emesonargs+=( $(meson_native_use_bool kmod) )
else
emesonargs+=( -Dkmod=false )
fi
if use elibc_musl; then
# Avoid redefinition of struct ethhdr.
append-cppflags -D__UAPI_DEF_ETHHDR=0
fi
if multilib_is_native_abi || use udev; then
meson_src_configure
fi
}
efi_arch() {
case "$(tc-arch)" in
amd64) echo x64 ;;
arm) echo arm ;;
arm64) echo aa64 ;;
x86) echo x86 ;;
esac
}
multilib_src_compile() {
local targets=()
if multilib_is_native_abi; then
if use boot; then
targets+=(
bootctl
man/bootctl.1
man/kernel-install.8
src/boot/efi/linux$(efi_arch).{efi,elf}.stub
src/boot/efi/systemd-boot$(efi_arch).efi
)
fi
if use sysusers; then
targets+=(
systemd-sysusers.standalone
man/sysusers.d.5
man/systemd-sysusers.8
)
if use test; then
targets+=(
systemd-runtest.env
)
fi
fi
if use tmpfiles; then
targets+=(
systemd-tmpfiles.standalone
man/tmpfiles.d.5
man/systemd-tmpfiles.8
)
if use test; then
targets+=( test-tmpfiles )
fi
fi
if use udev; then
targets+=(
udevadm
systemd-hwdb
src/udev/ata_id
src/udev/cdrom_id
src/udev/fido_id
src/udev/mtd_probe
src/udev/scsi_id
src/udev/udev.pc
src/udev/v4l_id
man/udev.conf.5
man/systemd.link.5
man/hwdb.7
man/udev.7
man/systemd-hwdb.8
man/systemd-udevd.service.8
man/udevadm.8
hwdb.d/60-autosuspend-chromiumos.hwdb
rules.d/50-udev-default.rules
rules.d/64-btrfs.rules
)
if use test; then
targets+=(
# Used by udev-test.pl
systemd-detect-virt
test/sys
test-udev
test-fido-id-desc
test-udev-builtin
test-udev-event
test-udev-netlink
test-udev-node
test-udev-util
)
fi
fi
fi
if use udev; then
targets+=(
udev:shared_library
src/libudev/libudev.pc
)
if use test; then
targets+=(
test-libudev
test-libudev-sym
test-udev-device-thread
)
fi
fi
if multilib_is_native_abi || use udev; then
meson_src_compile "${targets[@]}"
fi
}
multilib_src_test() {
local tests=()
if multilib_is_native_abi; then
if use sysusers; then
tests+=(
test-sysusers.standalone
)
fi
if use tmpfiles; then
tests+=(
test-systemd-tmpfiles.standalone
test-tmpfiles
)
fi
if use udev; then
tests+=(
rule-syntax-check
test-fido-id-desc
test-udev-builtin
test-udev-event
test-udev-netlink
test-udev-node
test-udev-util
)
if [[ -w /dev ]]; then
tests+=( udev-test )
else
ewarn "Skipping udev-test (needs write access to /dev)"
fi
fi
fi
if use udev; then
tests+=(
test-libudev
test-libudev-sym
test-udev-device-thread
)
fi
if [[ ${#tests[@]} -ne 0 ]]; then
meson_src_test "${tests[@]}"
fi
}
multilib_src_install() {
if multilib_is_native_abi; then
if use boot; then
into /usr
dobin bootctl
doman man/{bootctl.1,kernel-install.8}
insinto usr/lib/systemd/boot/efi
doins src/boot/efi/{linux$(efi_arch).{efi,elf}.stub,systemd-boot$(efi_arch).efi}
fi
if use sysusers; then
into /
newbin systemd-sysusers{.standalone,}
doman man/{systemd-sysusers.8,sysusers.d.5}
fi
if use tmpfiles; then
into /
newbin systemd-tmpfiles{.standalone,}
doman man/{systemd-tmpfiles.8,tmpfiles.d.5}
fi
if use udev; then
into /
dobin udevadm systemd-hwdb
dosym ../../bin/udevadm /lib/systemd/systemd-udevd
exeinto /lib/udev
doexe src/udev/{ata_id,cdrom_id,fido_id,mtd_probe,scsi_id,v4l_id}
insinto /lib/udev/rules.d
doins rules.d/*.rules
insinto /lib/udev/hwdb.d
doins hwdb.d/*.hwdb
insinto /usr/share/pkgconfig
doins src/udev/udev.pc
doman man/{udev.conf.5,systemd.link.5,hwdb.7,systemd-hwdb.8,udev.7,udevadm.8}
newman man/systemd-udevd.service.8 systemd-udevd.8
fi
fi
if use udev; then
into /usr
dolib.so "$(readlink libudev.so.1)" libudev.so{.1,}
gen_usr_ldscript -a udev
insinto "/usr/$(get_libdir)/pkgconfig"
doins src/libudev/libudev.pc
fi
}
multilib_src_install_all() {
einstalldocs
if use boot; then
into /usr
dobin src/kernel-install/kernel-install
exeinto usr/lib/kernel/install.d
doexe src/kernel-install/*.install
dobashcomp shell-completion/bash/bootctl
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/{_bootctl,_kernel-install}
fi
if use tmpfiles; then
doinitd "${FILESDIR}"/systemd-tmpfiles-setup
doinitd "${FILESDIR}"/systemd-tmpfiles-setup-dev
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/_systemd-tmpfiles
fi
if use udev; then
doheader src/libudev/libudev.h
insinto /etc/udev
doins src/udev/udev.conf
keepdir /etc/udev/{hwdb.d,rules.d}
insinto /lib/systemd/network
doins network/99-default.link
insinto /lib/udev/rules.d
doins rules.d/*.rules
doins "${FILESDIR}"/40-gentoo.rules
insinto /lib/udev/hwdb.d
doins hwdb.d/*.hwdb
dobashcomp shell-completion/bash/udevadm
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/_udevadm
fi
}
add_service() {
local initd=$1
local runlevel=$2
ebegin "Adding '${initd}' service to the '${runlevel}' runlevel"
mkdir -p "${EROOT}/etc/runlevels/${runlevel}" &&
ln -snf "${EPREFIX}/etc/init.d/${initd}" "${EROOT}/etc/runlevels/${runlevel}/${initd}"
eend $?
}
pkg_postinst() {
if [[ -z ${REPLACING_VERSIONS} ]]; then
add_service systemd-tmpfiles-setup-dev sysinit
add_service systemd-tmpfiles-setup boot
fi
if use udev; then
ebegin "Updating hwdb"
systemd-hwdb --root="${ROOT}" update
eend $?
udev_reload
fi
}

View File

@@ -1,511 +0,0 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..11} )
QA_PKGCONFIG_VERSION=$(ver_cut 1)
inherit bash-completion-r1 flag-o-matic meson-multilib python-any-r1 toolchain-funcs udev usr-ldscript
DESCRIPTION="Utilities split out from systemd for OpenRC users"
HOMEPAGE="https://systemd.io/"
if [[ ${PV} == *.* ]]; then
MY_P="systemd-stable-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/systemd/systemd-stable/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
else
MY_P="systemd-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/systemd/systemd/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
fi
MUSL_PATCHSET="systemd-musl-patches-251.2"
SRC_URI+=" elibc_musl? ( https://dev.gentoo.org/~floppym/dist/${MUSL_PATCHSET}.tar.gz )"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
IUSE="+acl boot +kmod selinux sysusers +tmpfiles test +udev"
REQUIRED_USE="|| ( boot tmpfiles sysusers udev )"
RESTRICT="!test? ( test )"
COMMON_DEPEND="
elibc_musl? ( >=sys-libs/musl-1.2.3 )
selinux? ( sys-libs/libselinux:0= )
tmpfiles? (
acl? ( sys-apps/acl:0= )
)
udev? (
>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
kmod? ( >=sys-apps/kmod-15:0= )
)
!udev? (
>=sys-apps/util-linux-2.30:0=
sys-libs/libcap:0=
virtual/libcrypt:=
)
"
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-3.11
boot? ( >=sys-boot/gnu-efi-3.0.2 )
"
RDEPEND="${COMMON_DEPEND}
boot? ( !<sys-boot/systemd-boot-250 )
tmpfiles? ( !<sys-apps/systemd-tmpfiles-250 )
udev? (
acct-group/audio
acct-group/cdrom
acct-group/dialout
acct-group/disk
acct-group/input
acct-group/kmem
acct-group/kvm
acct-group/lp
acct-group/render
acct-group/sgx
acct-group/tape
acct-group/tty
acct-group/video
!sys-apps/gentoo-systemd-integration
!sys-apps/hwids[udev]
!<sys-fs/udev-250
!sys-fs/eudev
)
!sys-apps/systemd
"
PDEPEND="
udev? ( >=sys-fs/udev-init-scripts-34 )
"
BDEPEND="
$(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt
dev-util/gperf
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
"
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
python_check_deps() {
has_version -b "dev-python/jinja[${PYTHON_USEDEP}]"
}
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
src_prepare() {
local PATCHES=(
)
if use elibc_musl; then
PATCHES+=( "${WORKDIR}/${MUSL_PATCHSET}" )
fi
default
# Remove install_rpath; we link statically
local rpath_pattern="install_rpath : rootlibexecdir,"
grep -q -e "${rpath_pattern}" meson.build || die
sed -i -e "/${rpath_pattern}/d" meson.build || die
}
multilib_src_configure() {
# When bumping to 251, please keep this, but add the revert patch
# like in sys-apps/systemd!
#
# Broken with FORTIFY_SOURCE=3 without a patch. And the patch
# wasn't backported to 250.x, but it turns out to break Clang
# anyway: bug #841770.
#
# Our toolchain sets F_S=2 by default w/ >= -O2, so we need
# to unset F_S first, then explicitly set 2, to negate any default
# and anything set by the user if they're choosing 3 (or if they've
# modified GCC to set 3).
#
if is-flagq '-O[23]' || is-flagq '-Ofast' ; then
# We can't unconditionally do this b/c we fortify needs
# some level of optimisation.
filter-flags -D_FORTIFY_SOURCE=3
append-cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
fi
local emesonargs=(
-Drootprefix="${EPREFIX:-/}"
-Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
-Dsysvinit-path=
$(meson_native_use_bool boot efi)
$(meson_native_use_bool boot gnu-efi)
$(meson_native_use_bool boot kernel-install)
$(meson_native_use_bool selinux)
$(meson_native_use_bool sysusers)
$(meson_use test tests)
$(meson_native_use_bool tmpfiles)
$(meson_use udev hwdb)
-Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
# Link staticly with libsystemd-shared
-Dlink-boot-shared=false
-Dlink-udev-shared=false
# systemd-tmpfiles has a separate "systemd-tmpfiles.standalone" target
-Dstandalone-binaries=true
# Disable all optional features
-Dadm-group=false
-Danalyze=false
-Dapparmor=false
-Daudit=false
-Dbacklight=false
-Dbinfmt=false
-Dbzip2=false
-Dcoredump=false
-Ddbus=false
-Delfutils=false
-Denvironment-d=false
-Dfdisk=false
-Dgcrypt=false
-Dglib=false
-Dgshadow=false
-Dgnutls=false
-Dhibernate=false
-Dhostnamed=false
-Didn=false
-Dima=false
-Dinitrd=false
-Dfirstboot=false
-Dldconfig=false
-Dlibcryptsetup=false
-Dlibcurl=false
-Dlibfido2=false
-Dlibidn=false
-Dlibidn2=false
-Dlibiptc=false
-Dlocaled=false
-Dlogind=false
-Dlz4=false
-Dmachined=false
-Dmicrohttpd=false
-Dnetworkd=false
-Dnscd=false
-Dnss-myhostname=false
-Dnss-resolve=false
-Dnss-systemd=false
-Doomd=false
-Dopenssl=false
-Dp11kit=false
-Dpam=false
-Dpcre2=false
-Dpolkit=false
-Dportabled=false
-Dpstore=false
-Dpwquality=false
-Drandomseed=false
-Dresolve=false
-Drfkill=false
-Dseccomp=false
-Dsmack=false
-Dsysext=false
-Dtimedated=false
-Dtimesyncd=false
-Dtpm=false
-Dqrencode=false
-Dquotacheck=false
-Duserdb=false
-Dutmp=false
-Dvconsole=false
-Dwheel-group=false
-Dxdg-autostart=false
-Dxkbcommon=false
-Dxz=false
-Dzlib=false
-Dzstd=false
)
if use tmpfiles || use udev; then
emesonargs+=( $(meson_native_use_bool acl) )
else
emesonargs+=( -Dacl=false )
fi
if use udev; then
emesonargs+=( $(meson_native_use_bool kmod) )
else
emesonargs+=( -Dkmod=false )
fi
if use elibc_musl; then
# Avoid redefinition of struct ethhdr.
append-cppflags -D__UAPI_DEF_ETHHDR=0
fi
if multilib_is_native_abi || use udev; then
meson_src_configure
fi
}
efi_arch() {
case "$(tc-arch)" in
amd64) echo x64 ;;
arm) echo arm ;;
arm64) echo aa64 ;;
x86) echo x86 ;;
esac
}
multilib_src_compile() {
local targets=()
if multilib_is_native_abi; then
if use boot; then
targets+=(
bootctl
kernel-install
man/bootctl.1
man/kernel-install.8
src/boot/efi/linux$(efi_arch).{efi,elf}.stub
src/boot/efi/systemd-boot$(efi_arch).efi
)
fi
if use sysusers; then
targets+=(
systemd-sysusers.standalone
man/sysusers.d.5
man/systemd-sysusers.8
)
if use test; then
targets+=(
systemd-runtest.env
)
fi
fi
if use tmpfiles; then
targets+=(
systemd-tmpfiles.standalone
man/tmpfiles.d.5
man/systemd-tmpfiles.8
)
if use test; then
targets+=( test-tmpfiles )
fi
fi
if use udev; then
targets+=(
udevadm
systemd-hwdb
src/udev/ata_id
src/udev/cdrom_id
src/udev/fido_id
src/udev/mtd_probe
src/udev/scsi_id
src/udev/udev.pc
src/udev/v4l_id
man/udev.conf.5
man/systemd.link.5
man/hwdb.7
man/udev.7
man/systemd-hwdb.8
man/systemd-udevd.service.8
man/udevadm.8
hwdb.d/60-autosuspend-chromiumos.hwdb
rules.d/50-udev-default.rules
rules.d/64-btrfs.rules
)
if use test; then
targets+=(
# Used by udev-test.pl
systemd-detect-virt
test/sys
test-udev
test-fido-id-desc
test-udev-builtin
test-udev-event
test-udev-netlink
test-udev-node
test-udev-util
)
fi
fi
fi
if use udev; then
targets+=(
udev:shared_library
src/libudev/libudev.pc
)
if use test; then
targets+=(
test-libudev
test-libudev-sym
test-udev-device-thread
)
fi
fi
if multilib_is_native_abi || use udev; then
meson_src_compile "${targets[@]}"
fi
}
multilib_src_test() {
local tests=()
if multilib_is_native_abi; then
if use sysusers; then
tests+=(
test-sysusers.standalone
)
fi
if use tmpfiles; then
tests+=(
test-systemd-tmpfiles.standalone
test-tmpfiles
)
fi
if use udev; then
tests+=(
rule-syntax-check
test-fido-id-desc
test-udev-builtin
test-udev-event
test-udev-netlink
test-udev-node
test-udev-util
)
if [[ -w /dev ]]; then
tests+=( udev-test )
else
ewarn "Skipping udev-test (needs write access to /dev)"
fi
fi
fi
if use udev; then
tests+=(
test-libudev
test-libudev-sym
test-udev-device-thread
)
fi
if [[ ${#tests[@]} -ne 0 ]]; then
meson_src_test "${tests[@]}"
fi
}
multilib_src_install() {
if multilib_is_native_abi; then
if use boot; then
into /usr
dobin bootctl kernel-install
doman man/{bootctl.1,kernel-install.8}
insinto usr/lib/systemd/boot/efi
doins src/boot/efi/{linux$(efi_arch).{efi,elf}.stub,systemd-boot$(efi_arch).efi}
fi
if use sysusers; then
into /
newbin systemd-sysusers{.standalone,}
doman man/{systemd-sysusers.8,sysusers.d.5}
fi
if use tmpfiles; then
into /
newbin systemd-tmpfiles{.standalone,}
doman man/{systemd-tmpfiles.8,tmpfiles.d.5}
fi
if use udev; then
into /
dobin udevadm systemd-hwdb
dosym ../../bin/udevadm /lib/systemd/systemd-udevd
exeinto /lib/udev
doexe src/udev/{ata_id,cdrom_id,fido_id,mtd_probe,scsi_id,v4l_id}
insinto /lib/udev/rules.d
doins rules.d/*.rules
insinto /lib/udev/hwdb.d
doins hwdb.d/*.hwdb
insinto /usr/share/pkgconfig
doins src/udev/udev.pc
doman man/{udev.conf.5,systemd.link.5,hwdb.7,systemd-hwdb.8,udev.7,udevadm.8}
newman man/systemd-udevd.service.8 systemd-udevd.8
fi
fi
if use udev; then
meson_install --no-rebuild --tags libudev
gen_usr_ldscript -a udev
insinto "/usr/$(get_libdir)/pkgconfig"
doins src/libudev/libudev.pc
fi
}
multilib_src_install_all() {
einstalldocs
if use boot; then
into /usr
exeinto usr/lib/kernel/install.d
doexe src/kernel-install/*.install
dobashcomp shell-completion/bash/bootctl
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/{_bootctl,_kernel-install}
fi
if use tmpfiles; then
doinitd "${FILESDIR}"/systemd-tmpfiles-setup
doinitd "${FILESDIR}"/systemd-tmpfiles-setup-dev
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/_systemd-tmpfiles
fi
if use udev; then
doheader src/libudev/libudev.h
insinto /etc/udev
doins src/udev/udev.conf
keepdir /etc/udev/{hwdb.d,rules.d}
insinto /lib/systemd/network
doins network/99-default.link
# Remove to avoid conflict with elogind
# https://bugs.gentoo.org/856433
rm rules.d/70-power-switch.rules || die
insinto /lib/udev/rules.d
doins rules.d/*.rules
doins "${FILESDIR}"/40-gentoo.rules
insinto /lib/udev/hwdb.d
doins hwdb.d/*.hwdb
dobashcomp shell-completion/bash/udevadm
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/_udevadm
fi
}
add_service() {
local initd=$1
local runlevel=$2
ebegin "Adding '${initd}' service to the '${runlevel}' runlevel"
mkdir -p "${EROOT}/etc/runlevels/${runlevel}" &&
ln -snf "${EPREFIX}/etc/init.d/${initd}" "${EROOT}/etc/runlevels/${runlevel}/${initd}"
eend $?
}
pkg_postinst() {
if [[ -z ${REPLACING_VERSIONS} ]]; then
add_service systemd-tmpfiles-setup-dev sysinit
add_service systemd-tmpfiles-setup boot
fi
if use udev; then
ebegin "Updating hwdb"
systemd-hwdb --root="${ROOT}" update
eend $?
udev_reload
fi
}

View File

@@ -1,516 +0,0 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..11} )
QA_PKGCONFIG_VERSION=$(ver_cut 1)
inherit bash-completion-r1 flag-o-matic meson-multilib python-any-r1 toolchain-funcs udev usr-ldscript
DESCRIPTION="Utilities split out from systemd for OpenRC users"
HOMEPAGE="https://systemd.io/"
if [[ ${PV} == *.* ]]; then
MY_P="systemd-stable-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/systemd/systemd-stable/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
else
MY_P="systemd-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/systemd/systemd/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
fi
MUSL_PATCHSET="systemd-musl-patches-251.2"
SRC_URI+=" elibc_musl? ( https://dev.gentoo.org/~floppym/dist/${MUSL_PATCHSET}.tar.gz )"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="+acl boot +kmod selinux sysusers +tmpfiles test +udev"
REQUIRED_USE="|| ( boot tmpfiles sysusers udev )"
RESTRICT="!test? ( test )"
COMMON_DEPEND="
elibc_musl? ( >=sys-libs/musl-1.2.3 )
selinux? ( sys-libs/libselinux:0= )
tmpfiles? (
acl? ( sys-apps/acl:0= )
)
udev? (
>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
kmod? ( >=sys-apps/kmod-15:0= )
)
!udev? (
>=sys-apps/util-linux-2.30:0=
sys-libs/libcap:0=
virtual/libcrypt:=
)
"
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-3.11
boot? ( >=sys-boot/gnu-efi-3.0.2 )
"
RDEPEND="${COMMON_DEPEND}
boot? ( !<sys-boot/systemd-boot-250 )
tmpfiles? ( !<sys-apps/systemd-tmpfiles-250 )
udev? (
acct-group/audio
acct-group/cdrom
acct-group/dialout
acct-group/disk
acct-group/input
acct-group/kmem
acct-group/kvm
acct-group/lp
acct-group/render
acct-group/sgx
acct-group/tape
acct-group/tty
acct-group/video
!sys-apps/gentoo-systemd-integration
!sys-apps/hwids[udev]
!<sys-fs/udev-250
!sys-fs/eudev
)
!sys-apps/systemd
"
PDEPEND="
udev? ( >=sys-fs/udev-init-scripts-34 )
"
BDEPEND="
$(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt
dev-util/gperf
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
"
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
python_check_deps() {
has_version -b "dev-python/jinja[${PYTHON_USEDEP}]"
}
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
src_prepare() {
local PATCHES=(
# bug #863218
"${FILESDIR}/251-glibc-2.36.patch"
)
if use elibc_musl; then
PATCHES+=( "${WORKDIR}/${MUSL_PATCHSET}" )
# Applied upstream in 251.3
rm "${WORKDIR}/${MUSL_PATCHSET}/0001-Add-sys-file.h-for-LOCK_.patch" || die
fi
default
# Remove install_rpath; we link statically
local rpath_pattern="install_rpath : rootlibexecdir,"
grep -q -e "${rpath_pattern}" meson.build || die
sed -i -e "/${rpath_pattern}/d" meson.build || die
}
multilib_src_configure() {
# When bumping to 251, please keep this, but add the revert patch
# like in sys-apps/systemd!
#
# Broken with FORTIFY_SOURCE=3 without a patch. And the patch
# wasn't backported to 250.x, but it turns out to break Clang
# anyway: bug #841770.
#
# Our toolchain sets F_S=2 by default w/ >= -O2, so we need
# to unset F_S first, then explicitly set 2, to negate any default
# and anything set by the user if they're choosing 3 (or if they've
# modified GCC to set 3).
#
if is-flagq '-O[23]' || is-flagq '-Ofast' ; then
# We can't unconditionally do this b/c we fortify needs
# some level of optimisation.
filter-flags -D_FORTIFY_SOURCE=3
append-cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
fi
local emesonargs=(
-Drootprefix="${EPREFIX:-/}"
-Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
-Dsysvinit-path=
$(meson_native_use_bool boot efi)
$(meson_native_use_bool boot gnu-efi)
$(meson_native_use_bool boot kernel-install)
$(meson_native_use_bool selinux)
$(meson_native_use_bool sysusers)
$(meson_use test tests)
$(meson_native_use_bool tmpfiles)
$(meson_use udev hwdb)
-Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
# Link staticly with libsystemd-shared
-Dlink-boot-shared=false
-Dlink-udev-shared=false
# systemd-tmpfiles has a separate "systemd-tmpfiles.standalone" target
-Dstandalone-binaries=true
# Disable all optional features
-Dadm-group=false
-Danalyze=false
-Dapparmor=false
-Daudit=false
-Dbacklight=false
-Dbinfmt=false
-Dbzip2=false
-Dcoredump=false
-Ddbus=false
-Delfutils=false
-Denvironment-d=false
-Dfdisk=false
-Dgcrypt=false
-Dglib=false
-Dgshadow=false
-Dgnutls=false
-Dhibernate=false
-Dhostnamed=false
-Didn=false
-Dima=false
-Dinitrd=false
-Dfirstboot=false
-Dldconfig=false
-Dlibcryptsetup=false
-Dlibcurl=false
-Dlibfido2=false
-Dlibidn=false
-Dlibidn2=false
-Dlibiptc=false
-Dlocaled=false
-Dlogind=false
-Dlz4=false
-Dmachined=false
-Dmicrohttpd=false
-Dnetworkd=false
-Dnscd=false
-Dnss-myhostname=false
-Dnss-resolve=false
-Dnss-systemd=false
-Doomd=false
-Dopenssl=false
-Dp11kit=false
-Dpam=false
-Dpcre2=false
-Dpolkit=false
-Dportabled=false
-Dpstore=false
-Dpwquality=false
-Drandomseed=false
-Dresolve=false
-Drfkill=false
-Dseccomp=false
-Dsmack=false
-Dsysext=false
-Dtimedated=false
-Dtimesyncd=false
-Dtpm=false
-Dqrencode=false
-Dquotacheck=false
-Duserdb=false
-Dutmp=false
-Dvconsole=false
-Dwheel-group=false
-Dxdg-autostart=false
-Dxkbcommon=false
-Dxz=false
-Dzlib=false
-Dzstd=false
)
if use tmpfiles || use udev; then
emesonargs+=( $(meson_native_use_bool acl) )
else
emesonargs+=( -Dacl=false )
fi
if use udev; then
emesonargs+=( $(meson_native_use_bool kmod) )
else
emesonargs+=( -Dkmod=false )
fi
if use elibc_musl; then
# Avoid redefinition of struct ethhdr.
append-cppflags -D__UAPI_DEF_ETHHDR=0
fi
if multilib_is_native_abi || use udev; then
meson_src_configure
fi
}
efi_arch() {
case "$(tc-arch)" in
amd64) echo x64 ;;
arm) echo arm ;;
arm64) echo aa64 ;;
x86) echo x86 ;;
esac
}
multilib_src_compile() {
local targets=()
if multilib_is_native_abi; then
if use boot; then
targets+=(
bootctl
kernel-install
man/bootctl.1
man/kernel-install.8
src/boot/efi/linux$(efi_arch).{efi,elf}.stub
src/boot/efi/systemd-boot$(efi_arch).efi
)
fi
if use sysusers; then
targets+=(
systemd-sysusers.standalone
man/sysusers.d.5
man/systemd-sysusers.8
)
if use test; then
targets+=(
systemd-runtest.env
)
fi
fi
if use tmpfiles; then
targets+=(
systemd-tmpfiles.standalone
man/tmpfiles.d.5
man/systemd-tmpfiles.8
)
if use test; then
targets+=( test-tmpfiles )
fi
fi
if use udev; then
targets+=(
udevadm
systemd-hwdb
src/udev/ata_id
src/udev/cdrom_id
src/udev/fido_id
src/udev/mtd_probe
src/udev/scsi_id
src/udev/udev.pc
src/udev/v4l_id
man/udev.conf.5
man/systemd.link.5
man/hwdb.7
man/udev.7
man/systemd-hwdb.8
man/systemd-udevd.service.8
man/udevadm.8
hwdb.d/60-autosuspend-chromiumos.hwdb
rules.d/50-udev-default.rules
rules.d/64-btrfs.rules
)
if use test; then
targets+=(
# Used by udev-test.pl
systemd-detect-virt
test/sys
test-udev
test-fido-id-desc
test-udev-builtin
test-udev-event
test-udev-netlink
test-udev-node
test-udev-util
)
fi
fi
fi
if use udev; then
targets+=(
udev:shared_library
src/libudev/libudev.pc
)
if use test; then
targets+=(
test-libudev
test-libudev-sym
test-udev-device-thread
)
fi
fi
if multilib_is_native_abi || use udev; then
meson_src_compile "${targets[@]}"
fi
}
multilib_src_test() {
local tests=()
if multilib_is_native_abi; then
if use sysusers; then
tests+=(
test-sysusers.standalone
)
fi
if use tmpfiles; then
tests+=(
test-systemd-tmpfiles.standalone
test-tmpfiles
)
fi
if use udev; then
tests+=(
rule-syntax-check
test-fido-id-desc
test-udev-builtin
test-udev-event
test-udev-netlink
test-udev-node
test-udev-util
)
if [[ -w /dev ]]; then
tests+=( udev-test )
else
ewarn "Skipping udev-test (needs write access to /dev)"
fi
fi
fi
if use udev; then
tests+=(
test-libudev
test-libudev-sym
test-udev-device-thread
)
fi
if [[ ${#tests[@]} -ne 0 ]]; then
meson_src_test "${tests[@]}"
fi
}
multilib_src_install() {
if multilib_is_native_abi; then
if use boot; then
into /usr
dobin bootctl kernel-install
doman man/{bootctl.1,kernel-install.8}
insinto usr/lib/systemd/boot/efi
doins src/boot/efi/{linux$(efi_arch).{efi,elf}.stub,systemd-boot$(efi_arch).efi}
fi
if use sysusers; then
into /
newbin systemd-sysusers{.standalone,}
doman man/{systemd-sysusers.8,sysusers.d.5}
fi
if use tmpfiles; then
into /
newbin systemd-tmpfiles{.standalone,}
doman man/{systemd-tmpfiles.8,tmpfiles.d.5}
fi
if use udev; then
into /
dobin udevadm systemd-hwdb
dosym ../../bin/udevadm /lib/systemd/systemd-udevd
exeinto /lib/udev
doexe src/udev/{ata_id,cdrom_id,fido_id,mtd_probe,scsi_id,v4l_id}
insinto /lib/udev/rules.d
doins rules.d/*.rules
insinto /lib/udev/hwdb.d
doins hwdb.d/*.hwdb
insinto /usr/share/pkgconfig
doins src/udev/udev.pc
doman man/{udev.conf.5,systemd.link.5,hwdb.7,systemd-hwdb.8,udev.7,udevadm.8}
newman man/systemd-udevd.service.8 systemd-udevd.8
fi
fi
if use udev; then
meson_install --no-rebuild --tags libudev
gen_usr_ldscript -a udev
insinto "/usr/$(get_libdir)/pkgconfig"
doins src/libudev/libudev.pc
fi
}
multilib_src_install_all() {
einstalldocs
if use boot; then
into /usr
exeinto usr/lib/kernel/install.d
doexe src/kernel-install/*.install
dobashcomp shell-completion/bash/bootctl
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/{_bootctl,_kernel-install}
fi
if use tmpfiles; then
doinitd "${FILESDIR}"/systemd-tmpfiles-setup
doinitd "${FILESDIR}"/systemd-tmpfiles-setup-dev
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/_systemd-tmpfiles
fi
if use udev; then
doheader src/libudev/libudev.h
insinto /etc/udev
doins src/udev/udev.conf
keepdir /etc/udev/{hwdb.d,rules.d}
insinto /lib/systemd/network
doins network/99-default.link
# Remove to avoid conflict with elogind
# https://bugs.gentoo.org/856433
rm rules.d/70-power-switch.rules || die
insinto /lib/udev/rules.d
doins rules.d/*.rules
doins "${FILESDIR}"/40-gentoo.rules
insinto /lib/udev/hwdb.d
doins hwdb.d/*.hwdb
dobashcomp shell-completion/bash/udevadm
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/_udevadm
fi
}
add_service() {
local initd=$1
local runlevel=$2
ebegin "Adding '${initd}' service to the '${runlevel}' runlevel"
mkdir -p "${EROOT}/etc/runlevels/${runlevel}" &&
ln -snf "${EPREFIX}/etc/init.d/${initd}" "${EROOT}/etc/runlevels/${runlevel}/${initd}"
eend $?
}
pkg_postinst() {
if [[ -z ${REPLACING_VERSIONS} ]]; then
add_service systemd-tmpfiles-setup-dev sysinit
add_service systemd-tmpfiles-setup boot
fi
if use udev; then
ebegin "Updating hwdb"
systemd-hwdb --root="${ROOT}" update
eend $?
udev_reload
fi
}

View File

@@ -1,514 +0,0 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..11} )
QA_PKGCONFIG_VERSION=$(ver_cut 1)
inherit bash-completion-r1 flag-o-matic meson-multilib python-any-r1 toolchain-funcs udev usr-ldscript
DESCRIPTION="Utilities split out from systemd for OpenRC users"
HOMEPAGE="https://systemd.io/"
if [[ ${PV} == *.* ]]; then
MY_P="systemd-stable-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/systemd/systemd-stable/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
else
MY_P="systemd-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/systemd/systemd/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
fi
MUSL_PATCHSET="systemd-musl-patches-251.2"
SRC_URI+=" elibc_musl? ( https://dev.gentoo.org/~floppym/dist/${MUSL_PATCHSET}.tar.gz )"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
IUSE="+acl boot +kmod selinux sysusers +tmpfiles test +udev"
REQUIRED_USE="|| ( boot tmpfiles sysusers udev )"
RESTRICT="!test? ( test )"
COMMON_DEPEND="
elibc_musl? ( >=sys-libs/musl-1.2.3 )
selinux? ( sys-libs/libselinux:0= )
tmpfiles? (
acl? ( sys-apps/acl:0= )
)
udev? (
>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
kmod? ( >=sys-apps/kmod-15:0= )
)
!udev? (
>=sys-apps/util-linux-2.30:0=
sys-libs/libcap:0=
virtual/libcrypt:=
)
"
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-3.11
boot? ( >=sys-boot/gnu-efi-3.0.2 )
"
RDEPEND="${COMMON_DEPEND}
boot? ( !<sys-boot/systemd-boot-250 )
tmpfiles? ( !<sys-apps/systemd-tmpfiles-250 )
udev? (
acct-group/audio
acct-group/cdrom
acct-group/dialout
acct-group/disk
acct-group/input
acct-group/kmem
acct-group/kvm
acct-group/lp
acct-group/render
acct-group/sgx
acct-group/tape
acct-group/tty
acct-group/video
!sys-apps/gentoo-systemd-integration
!sys-apps/hwids[udev]
!<sys-fs/udev-250
!sys-fs/eudev
)
!sys-apps/systemd
"
PDEPEND="
udev? ( >=sys-fs/udev-init-scripts-34 )
"
BDEPEND="
$(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt
dev-util/gperf
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
"
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
python_check_deps() {
python_has_version "dev-python/jinja[${PYTHON_USEDEP}]"
}
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
src_prepare() {
local PATCHES=(
)
if use elibc_musl; then
PATCHES+=( "${WORKDIR}/${MUSL_PATCHSET}" )
# Applied upstream in 251.3
rm "${WORKDIR}/${MUSL_PATCHSET}/0001-Add-sys-file.h-for-LOCK_.patch" || die
fi
default
# Remove install_rpath; we link statically
local rpath_pattern="install_rpath : rootlibexecdir,"
grep -q -e "${rpath_pattern}" meson.build || die
sed -i -e "/${rpath_pattern}/d" meson.build || die
}
multilib_src_configure() {
# When bumping to 251, please keep this, but add the revert patch
# like in sys-apps/systemd!
#
# Broken with FORTIFY_SOURCE=3 without a patch. And the patch
# wasn't backported to 250.x, but it turns out to break Clang
# anyway: bug #841770.
#
# Our toolchain sets F_S=2 by default w/ >= -O2, so we need
# to unset F_S first, then explicitly set 2, to negate any default
# and anything set by the user if they're choosing 3 (or if they've
# modified GCC to set 3).
#
if is-flagq '-O[23]' || is-flagq '-Ofast' ; then
# We can't unconditionally do this b/c we fortify needs
# some level of optimisation.
filter-flags -D_FORTIFY_SOURCE=3
append-cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
fi
local emesonargs=(
-Drootprefix="${EPREFIX:-/}"
-Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
-Dsysvinit-path=
$(meson_native_use_bool boot efi)
$(meson_native_use_bool boot gnu-efi)
$(meson_native_use_bool boot kernel-install)
$(meson_native_use_bool selinux)
$(meson_native_use_bool sysusers)
$(meson_use test tests)
$(meson_native_use_bool tmpfiles)
$(meson_use udev hwdb)
-Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
# Link staticly with libsystemd-shared
-Dlink-boot-shared=false
-Dlink-udev-shared=false
# systemd-tmpfiles has a separate "systemd-tmpfiles.standalone" target
-Dstandalone-binaries=true
# Disable all optional features
-Dadm-group=false
-Danalyze=false
-Dapparmor=false
-Daudit=false
-Dbacklight=false
-Dbinfmt=false
-Dbzip2=false
-Dcoredump=false
-Ddbus=false
-Delfutils=false
-Denvironment-d=false
-Dfdisk=false
-Dgcrypt=false
-Dglib=false
-Dgshadow=false
-Dgnutls=false
-Dhibernate=false
-Dhostnamed=false
-Didn=false
-Dima=false
-Dinitrd=false
-Dfirstboot=false
-Dldconfig=false
-Dlibcryptsetup=false
-Dlibcurl=false
-Dlibfido2=false
-Dlibidn=false
-Dlibidn2=false
-Dlibiptc=false
-Dlocaled=false
-Dlogind=false
-Dlz4=false
-Dmachined=false
-Dmicrohttpd=false
-Dnetworkd=false
-Dnscd=false
-Dnss-myhostname=false
-Dnss-resolve=false
-Dnss-systemd=false
-Doomd=false
-Dopenssl=false
-Dp11kit=false
-Dpam=false
-Dpcre2=false
-Dpolkit=false
-Dportabled=false
-Dpstore=false
-Dpwquality=false
-Drandomseed=false
-Dresolve=false
-Drfkill=false
-Dseccomp=false
-Dsmack=false
-Dsysext=false
-Dtimedated=false
-Dtimesyncd=false
-Dtpm=false
-Dqrencode=false
-Dquotacheck=false
-Duserdb=false
-Dutmp=false
-Dvconsole=false
-Dwheel-group=false
-Dxdg-autostart=false
-Dxkbcommon=false
-Dxz=false
-Dzlib=false
-Dzstd=false
)
if use tmpfiles || use udev; then
emesonargs+=( $(meson_native_use_bool acl) )
else
emesonargs+=( -Dacl=false )
fi
if use udev; then
emesonargs+=( $(meson_native_use_bool kmod) )
else
emesonargs+=( -Dkmod=false )
fi
if use elibc_musl; then
# Avoid redefinition of struct ethhdr.
append-cppflags -D__UAPI_DEF_ETHHDR=0
fi
if multilib_is_native_abi || use udev; then
meson_src_configure
fi
}
efi_arch() {
case "$(tc-arch)" in
amd64) echo x64 ;;
arm) echo arm ;;
arm64) echo aa64 ;;
x86) echo x86 ;;
esac
}
multilib_src_compile() {
local targets=()
if multilib_is_native_abi; then
if use boot; then
targets+=(
bootctl
kernel-install
man/bootctl.1
man/kernel-install.8
src/boot/efi/linux$(efi_arch).{efi,elf}.stub
src/boot/efi/systemd-boot$(efi_arch).efi
)
fi
if use sysusers; then
targets+=(
systemd-sysusers.standalone
man/sysusers.d.5
man/systemd-sysusers.8
)
if use test; then
targets+=(
systemd-runtest.env
)
fi
fi
if use tmpfiles; then
targets+=(
systemd-tmpfiles.standalone
man/tmpfiles.d.5
man/systemd-tmpfiles.8
)
if use test; then
targets+=( test-tmpfiles )
fi
fi
if use udev; then
targets+=(
udevadm
systemd-hwdb
src/udev/ata_id
src/udev/cdrom_id
src/udev/fido_id
src/udev/mtd_probe
src/udev/scsi_id
src/udev/udev.pc
src/udev/v4l_id
man/udev.conf.5
man/systemd.link.5
man/hwdb.7
man/udev.7
man/systemd-hwdb.8
man/systemd-udevd.service.8
man/udevadm.8
hwdb.d/60-autosuspend-chromiumos.hwdb
rules.d/50-udev-default.rules
rules.d/64-btrfs.rules
)
if use test; then
targets+=(
# Used by udev-test.pl
systemd-detect-virt
test/sys
test-udev
test-fido-id-desc
test-udev-builtin
test-udev-event
test-udev-netlink
test-udev-node
test-udev-util
)
fi
fi
fi
if use udev; then
targets+=(
udev:shared_library
src/libudev/libudev.pc
)
if use test; then
targets+=(
test-libudev
test-libudev-sym
test-udev-device-thread
)
fi
fi
if multilib_is_native_abi || use udev; then
meson_src_compile "${targets[@]}"
fi
}
multilib_src_test() {
local tests=()
if multilib_is_native_abi; then
if use sysusers; then
tests+=(
test-sysusers.standalone
)
fi
if use tmpfiles; then
tests+=(
test-systemd-tmpfiles.standalone
test-tmpfiles
)
fi
if use udev; then
tests+=(
rule-syntax-check
test-fido-id-desc
test-udev-builtin
test-udev-event
test-udev-netlink
test-udev-node
test-udev-util
)
if [[ -w /dev ]]; then
tests+=( udev-test )
else
ewarn "Skipping udev-test (needs write access to /dev)"
fi
fi
fi
if use udev; then
tests+=(
test-libudev
test-libudev-sym
test-udev-device-thread
)
fi
if [[ ${#tests[@]} -ne 0 ]]; then
meson_src_test "${tests[@]}"
fi
}
multilib_src_install() {
if multilib_is_native_abi; then
if use boot; then
into /usr
dobin bootctl kernel-install
doman man/{bootctl.1,kernel-install.8}
insinto usr/lib/systemd/boot/efi
doins src/boot/efi/{linux$(efi_arch).{efi,elf}.stub,systemd-boot$(efi_arch).efi}
fi
if use sysusers; then
into /
newbin systemd-sysusers{.standalone,}
doman man/{systemd-sysusers.8,sysusers.d.5}
fi
if use tmpfiles; then
into /
newbin systemd-tmpfiles{.standalone,}
doman man/{systemd-tmpfiles.8,tmpfiles.d.5}
fi
if use udev; then
into /
dobin udevadm systemd-hwdb
dosym ../../bin/udevadm /lib/systemd/systemd-udevd
exeinto /lib/udev
doexe src/udev/{ata_id,cdrom_id,fido_id,mtd_probe,scsi_id,v4l_id}
insinto /lib/udev/rules.d
doins rules.d/*.rules
insinto /lib/udev/hwdb.d
doins hwdb.d/*.hwdb
insinto /usr/share/pkgconfig
doins src/udev/udev.pc
doman man/{udev.conf.5,systemd.link.5,hwdb.7,systemd-hwdb.8,udev.7,udevadm.8}
newman man/systemd-udevd.service.8 systemd-udevd.8
fi
fi
if use udev; then
meson_install --no-rebuild --tags libudev
gen_usr_ldscript -a udev
insinto "/usr/$(get_libdir)/pkgconfig"
doins src/libudev/libudev.pc
fi
}
multilib_src_install_all() {
einstalldocs
if use boot; then
into /usr
exeinto usr/lib/kernel/install.d
doexe src/kernel-install/*.install
dobashcomp shell-completion/bash/bootctl
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/{_bootctl,_kernel-install}
fi
if use tmpfiles; then
doinitd "${FILESDIR}"/systemd-tmpfiles-setup
doinitd "${FILESDIR}"/systemd-tmpfiles-setup-dev
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/_systemd-tmpfiles
fi
if use udev; then
doheader src/libudev/libudev.h
insinto /etc/udev
doins src/udev/udev.conf
keepdir /etc/udev/{hwdb.d,rules.d}
insinto /lib/systemd/network
doins network/99-default.link
# Remove to avoid conflict with elogind
# https://bugs.gentoo.org/856433
rm rules.d/70-power-switch.rules || die
insinto /lib/udev/rules.d
doins rules.d/*.rules
doins "${FILESDIR}"/40-gentoo.rules
insinto /lib/udev/hwdb.d
doins hwdb.d/*.hwdb
dobashcomp shell-completion/bash/udevadm
insinto /usr/share/zsh/site-functions
doins shell-completion/zsh/_udevadm
fi
}
add_service() {
local initd=$1
local runlevel=$2
ebegin "Adding '${initd}' service to the '${runlevel}' runlevel"
mkdir -p "${EROOT}/etc/runlevels/${runlevel}" &&
ln -snf "${EPREFIX}/etc/init.d/${initd}" "${EROOT}/etc/runlevels/${runlevel}/${initd}"
eend $?
}
pkg_postinst() {
if [[ -z ${REPLACING_VERSIONS} ]]; then
add_service systemd-tmpfiles-setup-dev sysinit
add_service systemd-tmpfiles-setup boot
fi
if use udev; then
ebegin "Updating hwdb"
systemd-hwdb --root="${ROOT}" update
eend $?
udev_reload
fi
}