commit:     999ce663d8a28b414d6b41515b7f1c04f17ad225
Author:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 14 05:28:57 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Thu Jul 14 05:28:57 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=999ce663

sys-process/uksmd: patch out automagic dep for systemd

 - and always install the service file. Automagic would be harmful
   when switching between init systems on an existing installation,
   from openrc to systemd.

Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../uksmd/files/uksmd-0-remove-systemd-dep.patch   | 32 +++++++++++++++++++++
 sys-process/uksmd/uksmd-0_pre20220705-r1.ebuild    | 33 ++++++++++++++++++++++
 2 files changed, 65 insertions(+)

diff --git a/sys-process/uksmd/files/uksmd-0-remove-systemd-dep.patch 
b/sys-process/uksmd/files/uksmd-0-remove-systemd-dep.patch
new file mode 100644
index 000000000000..6940f78e4662
--- /dev/null
+++ b/sys-process/uksmd/files/uksmd-0-remove-systemd-dep.patch
@@ -0,0 +1,32 @@
+diff -Naur a/meson.build b/meson.build
+--- a/meson.build      2022-07-08 23:53:08.000000000 +0300
++++ b/meson.build      2022-07-14 08:12:38.358174169 +0300
+@@ -13,28 +13,6 @@
+   dependency('libcap-ng'),
+ ]
+ 
+-systemd = dependency('systemd', required: false)
+-
+-if systemd.found()
+-  systemd_system_unit_dir = 
systemd.get_pkgconfig_variable('systemdsystemunitdir')
+-  unit_files = [
+-    'uksmd.service'
+-  ]
+-
+-
+-  foreach u: unit_files
+-    configure_file(
+-      copy: true,
+-      input: u,
+-      install: true,
+-      install_dir: systemd_system_unit_dir,
+-      output: u,
+-    )
+-  endforeach
+-
+-  project_dependencies += systemd
+-endif
+-
+ build_args = [
+   '-DPROJECT_NAME=' + meson.project_name(),
+   '-DPROJECT_VERSION=' + meson.project_version(),

diff --git a/sys-process/uksmd/uksmd-0_pre20220705-r1.ebuild 
b/sys-process/uksmd/uksmd-0_pre20220705-r1.ebuild
new file mode 100644
index 000000000000..cd90995efde0
--- /dev/null
+++ b/sys-process/uksmd/uksmd-0_pre20220705-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info meson systemd
+
+MY_COMMIT="f10f38e3adcaf6175e6c4c1846cad72ae9ab2cf2"
+
+DESCRIPTION="Userspace KSM helper daemon"
+HOMEPAGE="https://codeberg.org/pf-kernel/uksmd";
+SRC_URI="https://codeberg.org/pf-kernel/uksmd/archive/${MY_COMMIT}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="sys-libs/libcap-ng
+       sys-process/procps:="
+RDEPEND="${DEPEND}"
+
+CONFIG_CHECK="~KSM"
+
+S="${WORKDIR}/uksmd"
+
+PATCHES=( "${FILESDIR}"/uksmd-0-remove-systemd-dep.patch )
+
+src_install() {
+       meson_src_install
+
+       newinitd "${FILESDIR}/uksmd.init" uksmd
+       systemd_dounit uksmd.service
+}

Reply via email to