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: Wed, 19 Feb 2020 09:49:09
Message-Id: 1582105648.6cee0a3ce3cef2c28ce58c5e66a407f826f381ea.polynomial-c@gentoo
1 commit: 6cee0a3ce3cef2c28ce58c5e66a407f826f381ea
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 19 09:47:28 2020 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 19 09:47:28 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6cee0a3c
7
8 sys-apps/kmod: Bump to version 27
9
10 Package-Manager: Portage-2.3.89, Repoman-2.3.20
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 sys-apps/kmod/Manifest | 1 +
14 sys-apps/kmod/kmod-27.ebuild | 202 +++++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 203 insertions(+)
16
17 diff --git a/sys-apps/kmod/Manifest b/sys-apps/kmod/Manifest
18 index b0cb0a1e990..c32d51e4790 100644
19 --- a/sys-apps/kmod/Manifest
20 +++ b/sys-apps/kmod/Manifest
21 @@ -1,2 +1,3 @@
22 DIST kmod-25.tar.xz 545416 BLAKE2B 2ad428f70630a1ef509be888a9ebc45f164695365f0f722f5e7793e96b60c035040b4d9a27f926361cea6d665310fc6cc5599ff4aefeda0fae8571c6510a25a7 SHA512 d579cd0cea24a06362a74927b7a3c777e9e01c990306e1032e4781cd441ffe435c70f2c2c4f6ae39eb1d857e622746411d5824d0c0d8bb79f91dc9fa51956252
23 DIST kmod-26.tar.xz 552032 BLAKE2B 3e596d06b48599bf4919346475a036b058fb18a7b19d39953e24fa943b95fdbe34a29a5062f6b4fe3510e667ae873d3b9ae03b72350fa85ddbb40ca6a7730b34 SHA512 3ca276c6fc13c2dd2220ec528b8dc4ab4edee5d2b22e16b6f945c552e51f74342c01c33a53740e6af8c893d42bd4d6f629cd8fa6e15ef8bd8da30cb003ef0865
24 +DIST kmod-27.tar.xz 548924 BLAKE2B 9f12bf5792d4c867e28e0776c279369c063e84269212e3f699ae6e5e69b8b2b466b5033e43e17ac64d6101592edcf3c34881916afb6ae676b49dc8838dfe1396 SHA512 e0513094935333fca1fb4c3e3493b232507a579ab00a6457cc9ed3e928363d05aad80634fb65a8287a336bf9895194c7be8ddc41bb088a6c2cca44fc1bfbdb6c
25
26 diff --git a/sys-apps/kmod/kmod-27.ebuild b/sys-apps/kmod/kmod-27.ebuild
27 new file mode 100644
28 index 00000000000..e0a5eee807d
29 --- /dev/null
30 +++ b/sys-apps/kmod/kmod-27.ebuild
31 @@ -0,0 +1,202 @@
32 +# Copyright 1999-2020 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +PYTHON_COMPAT=( python3_{6,7,8} )
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 ~sh ~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"
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 +# Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
64 +RDEPEND="!sys-apps/module-init-tools
65 + !sys-apps/modutils
66 + !<sys-apps/openrc-0.13.8
67 + !<sys-apps/systemd-216-r3
68 + lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
69 + python? ( ${PYTHON_DEPS} )
70 + pkcs7? (
71 + !libressl? ( >=dev-libs/openssl-1.1.0:0= )
72 + libressl? ( dev-libs/libressl:0= )
73 + )
74 + zlib? ( >=sys-libs/zlib-1.2.6 )" #427130
75 +DEPEND="${RDEPEND}"
76 +BDEPEND="
77 + doc? (
78 + dev-util/gtk-doc
79 + dev-util/gtk-doc-am
80 + )
81 + lzma? ( virtual/pkgconfig )
82 + python? (
83 + dev-python/cython[${PYTHON_USEDEP}]
84 + virtual/pkgconfig
85 + )
86 + zlib? ( virtual/pkgconfig )
87 +"
88 +if [[ ${PV} == 9999* ]]; then
89 + DEPEND="${DEPEND}
90 + dev-libs/libxslt"
91 +fi
92 +
93 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
94 +
95 +DOCS="NEWS README TODO"
96 +
97 +src_prepare() {
98 + default
99 +
100 + if [[ ! -e configure ]] || use doc ; then
101 + if use doc; then
102 + cp "${EROOT}"/usr/share/aclocal/gtk-doc.m4 m4 || die
103 + gtkdocize --copy --docdir libkmod/docs || die
104 + else
105 + touch libkmod/docs/gtk-doc.make
106 + fi
107 + eautoreconf
108 + else
109 + elibtoolize
110 + fi
111 +
112 + # Restore possibility of running --enable-static wrt #472608
113 + sed -i \
114 + -e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \
115 + configure || die
116 +}
117 +
118 +src_configure() {
119 + local myeconfargs=(
120 + --bindir="${EPREFIX}/bin"
121 + --enable-shared
122 + --with-bashcompletiondir="$(get_bashcompdir)"
123 + --with-rootlibdir="${EPREFIX}/$(get_libdir)"
124 + $(use_enable debug)
125 + $(usex doc '--enable-gtk-doc' '')
126 + $(use_enable static-libs static)
127 + $(use_enable tools)
128 + $(use_with lzma xz)
129 + $(use_with pkcs7 openssl)
130 + $(use_with zlib)
131 + )
132 +
133 + local ECONF_SOURCE="${S}"
134 +
135 + kmod_configure() {
136 + mkdir -p "${BUILD_DIR}" || die
137 + run_in_build_dir econf "${myeconfargs[@]}" "$@"
138 + }
139 +
140 + BUILD_DIR="${WORKDIR}/build"
141 + kmod_configure --disable-python
142 +
143 + if use python; then
144 + python_foreach_impl kmod_configure --enable-python
145 + fi
146 +}
147 +
148 +src_compile() {
149 + emake -C "${BUILD_DIR}"
150 +
151 + if use python; then
152 + local native_builddir=${BUILD_DIR}
153 +
154 + python_compile() {
155 + emake -C "${BUILD_DIR}" -f Makefile -f - python \
156 + VPATH="${native_builddir}:${S}" \
157 + native_builddir="${native_builddir}" \
158 + libkmod_python_kmod_{kmod,list,module,_util}_la_LIBADD='$(PYTHON_LIBS) $(native_builddir)/libkmod/libkmod.la' \
159 + <<< 'python: $(pkgpyexec_LTLIBRARIES)'
160 + }
161 +
162 + python_foreach_impl python_compile
163 + fi
164 +}
165 +
166 +src_install() {
167 + emake -C "${BUILD_DIR}" DESTDIR="${D}" install
168 + einstalldocs
169 +
170 + if use python; then
171 + local native_builddir=${BUILD_DIR}
172 +
173 + python_install() {
174 + emake -C "${BUILD_DIR}" DESTDIR="${D}" \
175 + VPATH="${native_builddir}:${S}" \
176 + install-pkgpyexecLTLIBRARIES \
177 + install-dist_pkgpyexecPYTHON
178 + }
179 +
180 + python_foreach_impl python_install
181 + fi
182 +
183 + find "${ED}" -type f -name "*.la" -delete || die
184 +
185 + if use tools; then
186 + local cmd
187 + for cmd in depmod insmod modprobe rmmod; do
188 + dosym ../bin/kmod /sbin/${cmd}
189 + done
190 +
191 + # These are also usable as normal user
192 + for cmd in lsmod modinfo; do
193 + dosym kmod /bin/${cmd}
194 + done
195 + fi
196 +
197 + cat <<-EOF > "${T}"/usb-load-ehci-first.conf
198 + softdep uhci_hcd pre: ehci_hcd
199 + softdep ohci_hcd pre: ehci_hcd
200 + EOF
201 +
202 + insinto /lib/modprobe.d
203 + doins "${T}"/usb-load-ehci-first.conf #260139
204 +
205 + newinitd "${FILESDIR}"/kmod-static-nodes-r1 kmod-static-nodes
206 +}
207 +
208 +pkg_postinst() {
209 + if [[ -L ${EROOT}/etc/runlevels/boot/static-nodes ]]; then
210 + ewarn "Removing old conflicting static-nodes init script from the boot runlevel"
211 + rm -f "${EROOT}"/etc/runlevels/boot/static-nodes
212 + fi
213 +
214 + # Add kmod to the runlevel automatically if this is the first install of this package.
215 + if [[ -z ${REPLACING_VERSIONS} ]]; then
216 + if [[ ! -d ${EROOT}/etc/runlevels/sysinit ]]; then
217 + mkdir -p "${EROOT}"/etc/runlevels/sysinit
218 + fi
219 + if [[ -x ${EROOT}/etc/init.d/kmod-static-nodes ]]; then
220 + ln -s /etc/init.d/kmod-static-nodes "${EROOT}"/etc/runlevels/sysinit/kmod-static-nodes
221 + fi
222 + fi
223 +
224 + if [[ -e ${EROOT}/etc/runlevels/sysinit ]]; then
225 + if [[ ! -e ${EROOT}/etc/runlevels/sysinit/kmod-static-nodes ]]; then
226 + ewarn
227 + ewarn "You need to add kmod-static-nodes to the sysinit runlevel for"
228 + ewarn "kernel modules to have required static nodes!"
229 + ewarn "Run this command:"
230 + ewarn "\trc-update add kmod-static-nodes sysinit"
231 + fi
232 + fi
233 +}