Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsmbios/
Date: Fri, 09 Sep 2022 14:02:37
Message-Id: 1662732150.26185bf7720aa5404298416b8014bc9929731f07.marecki@gentoo
1 commit: 26185bf7720aa5404298416b8014bc9929731f07
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 9 13:54:39 2022 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 9 14:02:30 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26185bf7
7
8 sys-libs/libsmbios: add separate Python handling for USE=test
9
10 libsmbios actually uses Python in two ways: in installed scripts
11 and in the test suite. Previous incarnations of these ebuilds
12 made the handling of all Python stuff under USE=python but it is
13 entirely possible for someone want to run the test suite without
14 installing all the Python scripts - after all as the name suggests
15 this package IS first and foremost a library.
16
17 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
18
19 sys-libs/libsmbios/libsmbios-2.4.3.ebuild | 18 ++++++++++++------
20 1 file changed, 12 insertions(+), 6 deletions(-)
21
22 diff --git a/sys-libs/libsmbios/libsmbios-2.4.3.ebuild b/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
23 index 0ffef7c562fa..15ae620a9e16 100644
24 --- a/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
25 +++ b/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
26 @@ -14,7 +14,8 @@ LICENSE="|| ( GPL-2+ OSL-2.1 ) BSD Boost-1.0"
27 SLOT="0"
28 KEYWORDS="amd64 ~arm64 ~ia64 ~riscv x86"
29 IUSE="doc graphviz nls +python static-libs test"
30 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
31 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
32 + test? ( ${PYTHON_REQUIRED_USE} )"
33
34 RESTRICT="!test? ( test )"
35
36 @@ -26,8 +27,11 @@ DEPEND="${RDEPEND}
37 virtual/pkgconfig
38 doc? ( app-doc/doxygen )
39 graphviz? ( media-gfx/graphviz )
40 - nls? ( sys-devel/gettext )
41 - test? ( >=dev-util/cppunit-1.9.6 )"
42 + nls? ( sys-devel/gettext )"
43 +BDEPEND="test? (
44 + ${PYTHON_DEPS}
45 + >=dev-util/cppunit-1.9.6
46 +)"
47
48 PATCHES=(
49 "${FILESDIR}/${PN}-2.2.28-cppunit-tests.patch"
50 @@ -36,7 +40,9 @@ PATCHES=(
51 )
52
53 pkg_setup() {
54 - use python && python-single-r1_pkg_setup
55 + if use python || use test; then
56 + python-single-r1_pkg_setup
57 + fi
58 }
59
60 src_prepare() {
61 @@ -45,7 +51,7 @@ src_prepare() {
62 # Don't build yum-plugin - we don't need it
63 sed '/yum-plugin/d' -i Makefile.am || die
64
65 - if use test && use python; then
66 + if use test; then
67 python_fix_shebang src/pyunit/test*.py
68 fi
69
70 @@ -69,7 +75,7 @@ src_configure() {
71 src_install() {
72 emake install DESTDIR="${D}"
73
74 - if use python ; then
75 + if use python; then
76 python_scriptinto /usr/sbin
77 python_doscript "${ED}"/usr/sbin/smbios-{{battery,keyboard,thermal,token,wakeup,wireless}-ctl,lcd-brightness,passwd,sys-info}
78 fi