Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/
Date: Fri, 08 Jan 2021 14:15:30
Message-Id: 1610115319.25839e92b262f606bf7f71b37ad1c0cfdc192caf.polynomial-c@gentoo
1 commit: 25839e92b262f606bf7f71b37ad1c0cfdc192caf
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 8 14:06:18 2021 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 8 14:15:19 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25839e92
7
8 sys-apps/kmod: Bump to version 28
9
10 Package-Manager: Portage-3.0.12, Repoman-3.0.2
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 sys-apps/kmod/Manifest | 1 +
14 sys-apps/kmod/kmod-28.ebuild | 206 +++++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 207 insertions(+)
16
17 diff --git a/sys-apps/kmod/Manifest b/sys-apps/kmod/Manifest
18 index d62d2b683b0..010ee9f2330 100644
19 --- a/sys-apps/kmod/Manifest
20 +++ b/sys-apps/kmod/Manifest
21 @@ -1,2 +1,3 @@
22 DIST kmod-26.tar.xz 552032 BLAKE2B 3e596d06b48599bf4919346475a036b058fb18a7b19d39953e24fa943b95fdbe34a29a5062f6b4fe3510e667ae873d3b9ae03b72350fa85ddbb40ca6a7730b34 SHA512 3ca276c6fc13c2dd2220ec528b8dc4ab4edee5d2b22e16b6f945c552e51f74342c01c33a53740e6af8c893d42bd4d6f629cd8fa6e15ef8bd8da30cb003ef0865
23 DIST kmod-27.tar.xz 548924 BLAKE2B 9f12bf5792d4c867e28e0776c279369c063e84269212e3f699ae6e5e69b8b2b466b5033e43e17ac64d6101592edcf3c34881916afb6ae676b49dc8838dfe1396 SHA512 e0513094935333fca1fb4c3e3493b232507a579ab00a6457cc9ed3e928363d05aad80634fb65a8287a336bf9895194c7be8ddc41bb088a6c2cca44fc1bfbdb6c
24 +DIST kmod-28.tar.xz 552448 BLAKE2B af41a0c5681fb94eb5264f46ed2ae666d171d4e2d0dc21419a3c2f4b12a783350a06b408fb02a7afb00fcea1cd994ee35864c1ec8b7a8cc58a8c9dcdeffaf1b3 SHA512 50646dc72675a5e17b01e327e3d41b972f18aaeac20c8b00983c4d099c6218f35c32c184a833a2d7f716755d6a86851c90913d2835874cef933bdc4a9722df9a
25
26 diff --git a/sys-apps/kmod/kmod-28.ebuild b/sys-apps/kmod/kmod-28.ebuild
27 new file mode 100644
28 index 00000000000..94820b237d3
29 --- /dev/null
30 +++ b/sys-apps/kmod/kmod-28.ebuild
31 @@ -0,0 +1,206 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +PYTHON_COMPAT=( python3_{6..9} )
38 +
39 +inherit autotools bash-completion-r1 multilib python-r1
40 +
41 +if [[ ${PV} == 9999* ]]; then
42 + EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/kernel/${PN}/${PN}.git"
43 + inherit git-r3
44 +else
45 + SRC_URI="https://www.kernel.org/pub/linux/utils/kernel/kmod/${P}.tar.xz"
46 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
47 + #inherit libtool
48 +fi
49 +
50 +DESCRIPTION="library and tools for managing linux kernel modules"
51 +HOMEPAGE="https://git.kernel.org/?p=utils/kernel/kmod/kmod.git"
52 +
53 +LICENSE="LGPL-2"
54 +SLOT="0"
55 +IUSE="debug doc libressl +lzma pkcs7 python static-libs +tools +zlib zstd"
56 +
57 +# Upstream does not support running the test suite with custom configure flags.
58 +# I was also told that the test suite is intended for kmod developers.
59 +# So we have to restrict it.
60 +# See bug #408915.
61 +RESTRICT="test"
62 +
63 +# >=zlib-1.2.6 required because of bug #427130
64 +# Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
65 +RDEPEND="!sys-apps/module-init-tools
66 + !sys-apps/modutils
67 + !<sys-apps/openrc-0.13.8
68 + !<sys-apps/systemd-216-r3
69 + lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
70 + python? ( ${PYTHON_DEPS} )
71 + pkcs7? (
72 + !libressl? ( >=dev-libs/openssl-1.1.0:0= )
73 + libressl? ( dev-libs/libressl:0= )
74 + )
75 + zlib? ( >=sys-libs/zlib-1.2.6 )
76 + zstd? ( >=app-arch/zstd-1.4.4 )"
77 +DEPEND="${RDEPEND}"
78 +BDEPEND="
79 + doc? (
80 + dev-util/gtk-doc
81 + dev-util/gtk-doc-am
82 + )
83 + lzma? ( virtual/pkgconfig )
84 + python? (
85 + dev-python/cython[${PYTHON_USEDEP}]
86 + virtual/pkgconfig
87 + )
88 + zlib? ( virtual/pkgconfig )
89 +"
90 +if [[ ${PV} == 9999* ]]; then
91 + DEPEND="${DEPEND}
92 + dev-libs/libxslt"
93 +fi
94 +
95 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
96 +
97 +DOCS="NEWS README TODO"
98 +
99 +src_prepare() {
100 + default
101 +
102 + if [[ ! -e configure ]] || use doc ; then
103 + if use doc; then
104 + cp "${EROOT}"/usr/share/aclocal/gtk-doc.m4 m4 || die
105 + gtkdocize --copy --docdir libkmod/docs || die
106 + else
107 + touch libkmod/docs/gtk-doc.make
108 + fi
109 + eautoreconf
110 + else
111 + elibtoolize
112 + fi
113 +
114 + # Restore possibility of running --enable-static wrt #472608
115 + sed -i \
116 + -e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \
117 + configure || die
118 +}
119 +
120 +src_configure() {
121 + local myeconfargs=(
122 + --bindir="${EPREFIX}/bin"
123 + --enable-shared
124 + --with-bashcompletiondir="$(get_bashcompdir)"
125 + --with-rootlibdir="${EPREFIX}/$(get_libdir)"
126 + $(use_enable debug)
127 + $(usex doc '--enable-gtk-doc' '')
128 + $(use_enable static-libs static)
129 + $(use_enable tools)
130 + $(use_with lzma xz)
131 + $(use_with pkcs7 openssl)
132 + $(use_with zlib)
133 + $(use_with zstd)
134 + )
135 +
136 + local ECONF_SOURCE="${S}"
137 +
138 + kmod_configure() {
139 + mkdir -p "${BUILD_DIR}" || die
140 + run_in_build_dir econf "${myeconfargs[@]}" "$@"
141 + }
142 +
143 + BUILD_DIR="${WORKDIR}/build"
144 + kmod_configure --disable-python
145 +
146 + if use python; then
147 + python_foreach_impl kmod_configure --enable-python
148 + fi
149 +}
150 +
151 +src_compile() {
152 + emake -C "${BUILD_DIR}"
153 +
154 + if use python; then
155 + local native_builddir=${BUILD_DIR}
156 +
157 + python_compile() {
158 + emake -C "${BUILD_DIR}" -f Makefile -f - python \
159 + VPATH="${native_builddir}:${S}" \
160 + native_builddir="${native_builddir}" \
161 + libkmod_python_kmod_{kmod,list,module,_util}_la_LIBADD='$(PYTHON_LIBS) $(native_builddir)/libkmod/libkmod.la' \
162 + <<< 'python: $(pkgpyexec_LTLIBRARIES)'
163 + }
164 +
165 + python_foreach_impl python_compile
166 + fi
167 +}
168 +
169 +src_install() {
170 + emake -C "${BUILD_DIR}" DESTDIR="${D}" install
171 + einstalldocs
172 +
173 + if use python; then
174 + local native_builddir=${BUILD_DIR}
175 +
176 + python_install() {
177 + emake -C "${BUILD_DIR}" DESTDIR="${D}" \
178 + VPATH="${native_builddir}:${S}" \
179 + install-pkgpyexecLTLIBRARIES \
180 + install-dist_pkgpyexecPYTHON
181 + python_optimize
182 + }
183 +
184 + python_foreach_impl python_install
185 + fi
186 +
187 + find "${ED}" -type f -name "*.la" -delete || die
188 +
189 + if use tools; then
190 + local cmd
191 + for cmd in depmod insmod modprobe rmmod; do
192 + dosym ../bin/kmod /sbin/${cmd}
193 + done
194 +
195 + # These are also usable as normal user
196 + for cmd in lsmod modinfo; do
197 + dosym kmod /bin/${cmd}
198 + done
199 + fi
200 +
201 + cat <<-EOF > "${T}"/usb-load-ehci-first.conf
202 + softdep uhci_hcd pre: ehci_hcd
203 + softdep ohci_hcd pre: ehci_hcd
204 + EOF
205 +
206 + insinto /lib/modprobe.d
207 + doins "${T}"/usb-load-ehci-first.conf #260139
208 +
209 + newinitd "${FILESDIR}"/kmod-static-nodes-r1 kmod-static-nodes
210 +}
211 +
212 +pkg_postinst() {
213 + if [[ -L ${EROOT}/etc/runlevels/boot/static-nodes ]]; then
214 + ewarn "Removing old conflicting static-nodes init script from the boot runlevel"
215 + rm -f "${EROOT}"/etc/runlevels/boot/static-nodes
216 + fi
217 +
218 + # Add kmod to the runlevel automatically if this is the first install of this package.
219 + if [[ -z ${REPLACING_VERSIONS} ]]; then
220 + if [[ ! -d ${EROOT}/etc/runlevels/sysinit ]]; then
221 + mkdir -p "${EROOT}"/etc/runlevels/sysinit
222 + fi
223 + if [[ -x ${EROOT}/etc/init.d/kmod-static-nodes ]]; then
224 + ln -s /etc/init.d/kmod-static-nodes "${EROOT}"/etc/runlevels/sysinit/kmod-static-nodes
225 + fi
226 + fi
227 +
228 + if [[ -e ${EROOT}/etc/runlevels/sysinit ]]; then
229 + if ! has_version sys-apps/systemd && [[ ! -e ${EROOT}/etc/runlevels/sysinit/kmod-static-nodes ]]; then
230 + ewarn
231 + ewarn "You need to add kmod-static-nodes to the sysinit runlevel for"
232 + ewarn "kernel modules to have required static nodes!"
233 + ewarn "Run this command:"
234 + ewarn "\trc-update add kmod-static-nodes sysinit"
235 + fi
236 + fi
237 +}