Diff kmod-27-r3 with a kmod-30-r1

/usr/portage/sys-apps/kmod/kmod-30-r1.ebuild 2023-10-09 14:52:35.384368499 +0300
1
# Copyright 1999-2020 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=7
4
EAPI=8
5 5

  
6
PYTHON_COMPAT=( python3_{6,7,8} )
6
PYTHON_COMPAT=( python3_{9..11} )
7 7

  
8
inherit autotools bash-completion-r1 multilib python-r1
8
inherit autotools libtool bash-completion-r1 python-r1
9 9

  
10 10
if [[ ${PV} == 9999* ]]; then
11 11
	EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/kernel/${PN}/${PN}.git"
12 12
	inherit git-r3
13 13
else
14 14
	SRC_URI="https://www.kernel.org/pub/linux/utils/kernel/kmod/${P}.tar.xz"
15
	KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86"
16
	#inherit libtool
15
	KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
17 16
fi
18 17

  
19 18
DESCRIPTION="library and tools for managing linux kernel modules"
......
21 20

  
22 21
LICENSE="LGPL-2"
23 22
SLOT="0"
24
IUSE="debug doc libressl +lzma pkcs7 python static-libs +tools +zlib +zstd"
23
IUSE="debug doc +lzma pkcs7 python static-libs +tools +zlib +zstd"
25 24

  
26 25
# Upstream does not support running the test suite with custom configure flags.
27 26
# I was also told that the test suite is intended for kmod developers.
28 27
# So we have to restrict it.
29 28
# See bug #408915.
30
RESTRICT="test"
29
#RESTRICT="test"
31 30

  
32
# Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
31
# - >=zlib-1.2.6 required because of bug #427130
32
# - Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
33
# - >=zstd-1.5.2-r1 required for bug #771078
33 34
RDEPEND="!sys-apps/module-init-tools
34 35
	!sys-apps/modutils
35 36
	!<sys-apps/openrc-0.13.8
36 37
	!<sys-apps/systemd-216-r3
37 38
	lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
38
	zstd? ( >=app-arch/zstd-1.4.0 )
39 39
	python? ( ${PYTHON_DEPS} )
40
	pkcs7? (
41
		!libressl? ( >=dev-libs/openssl-1.1.0:0= )
42
		libressl? ( dev-libs/libressl:0= )
43
	)
44
	zlib? ( >=sys-libs/zlib-1.2.6 )" #427130
40
	pkcs7? ( >=dev-libs/openssl-1.1.0:= )
41
	zlib? ( >=sys-libs/zlib-1.2.6 )
42
	zstd? ( >=app-arch/zstd-1.5.2-r1:= )"
45 43
DEPEND="${RDEPEND}"
46 44
BDEPEND="
47 45
	doc? (
......
52 50
	python? (
53 51
		dev-python/cython[${PYTHON_USEDEP}]
54 52
		virtual/pkgconfig
55
		)
53
	)
56 54
	zlib? ( virtual/pkgconfig )
57 55
"
58 56
if [[ ${PV} == 9999* ]]; then
59
	DEPEND="${DEPEND}
57
	BDEPEND="${BDEPEND}
60 58
		dev-libs/libxslt"
61 59
fi
62 60

  
63 61
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
64 62

  
65
DOCS="NEWS README TODO"
63
DOCS=( NEWS README.md TODO )
66 64

  
67
PATCHES=( "${FILESDIR}"/${P}-depmod-do-not-output-.bin-to-stdout.patch
68
	"${FILESDIR}"/zstd-support-27.patch
65
PATCHES=(
66
	"${FILESDIR}"/${P}-configure-clang16.patch
69 67
)
70 68

  
71 69
src_prepare() {
......
73 71

  
74 72
	if [[ ! -e configure ]] || use doc ; then
75 73
		if use doc; then
76
			cp "${EROOT}"/usr/share/aclocal/gtk-doc.m4 m4 || die
74
			cp "${BROOT}"/usr/share/aclocal/gtk-doc.m4 m4 || die
77 75
			gtkdocize --copy --docdir libkmod/docs || die
78 76
		else
79 77
			touch libkmod/docs/gtk-doc.make
80 78
		fi
81 79
		eautoreconf
82 80
	else
83
		elibtoolize
81
		#elibtoolize
82
		# TODO: restore to elibtoolize in next release after 30
83
		# autoreconf only here for clang patch.
84
		eautoreconf
84 85
	fi
85 86

  
86
	# Restore possibility of running --enable-static wrt #472608
87
	# Restore possibility of running --enable-static, bug #472608
87 88
	sed -i \
88 89
		-e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \
89 90
		configure || die
......
124 125
	emake -C "${BUILD_DIR}"
125 126

  
126 127
	if use python; then
127
		local native_builddir=${BUILD_DIR}
128
		local native_builddir="${BUILD_DIR}"
128 129

  
129 130
		python_compile() {
130 131
			emake -C "${BUILD_DIR}" -f Makefile -f - python \
......
138 139
	fi
139 140
}
140 141

  
142
src_test() {
143
	python_test() {
144
		mkdir "${T}/test-${EPYTHON}" || die
145
		emake -C "${BUILD_DIR}" DESTDIR="${T}/test-${EPYTHON}" \
146
                                VPATH="${native_builddir}:${S}" \
147
                                install-pkgpyexecLTLIBRARIES \
148
                                install-dist_pkgpyexecPYTHON
149

  
150
		# Smoke test based on https://bugs.gentoo.org/891975#c5
151
		local -x PYTHONPATH="${T}/test-${EPYTHON}/usr/lib/${EPYTHON}/site-packages:${PYTHONPATH}"
152
		${EPYTHON} -c 'import kmod; km = kmod.Kmod(); print([(m.name, m.size) for m in km.loaded()])' || die
153
		rm -r "${T}/test-${EPYTHON}" || die
154
	}
155

  
156
	if use python; then
157
		python_foreach_impl python_test
158
	fi
159
}
160

  
141 161
src_install() {
142 162
	emake -C "${BUILD_DIR}" DESTDIR="${D}" install
163

  
143 164
	einstalldocs
144 165

  
145 166
	if use python; then
146
		local native_builddir=${BUILD_DIR}
167
		local native_builddir="${BUILD_DIR}"
147 168

  
148 169
		python_install() {
149 170
			emake -C "${BUILD_DIR}" DESTDIR="${D}" \
......
176 197
	EOF
177 198

  
178 199
	insinto /lib/modprobe.d
179
	doins "${T}"/usb-load-ehci-first.conf #260139
200
	# bug #260139
201
	doins "${T}"/usb-load-ehci-first.conf
180 202

  
181 203
	newinitd "${FILESDIR}"/kmod-static-nodes-r1 kmod-static-nodes
182 204
}
Thank you!