Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/i2c-tools/
Date: Wed, 13 Feb 2019 22:00:51
Message-Id: 1550095184.e88a25e039c7faed7d97a5e19fed9e15dcb0b36d.vapier@gentoo
1 commit: e88a25e039c7faed7d97a5e19fed9e15dcb0b36d
2 Author: Mike Frysinger <vapier <AT> chromium <DOT> org>
3 AuthorDate: Wed Feb 13 21:24:33 2019 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 13 21:59:44 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e88a25e0
7
8 sys-apps/i2c-tools: add missing perl dep and make it optional
9
10 This package installs a number of perl scripts, so make sure we RDEPEND
11 on perl to avoid broken deps. But also put that behind USE=perl so we
12 can install the other (more interesting) programs w/out forcing perl on
13 everyone.
14
15 Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
16
17 sys-apps/i2c-tools/i2c-tools-4.1-r1.ebuild | 74 ++++++++++++++++++++++++++++++
18 1 file changed, 74 insertions(+)
19
20 diff --git a/sys-apps/i2c-tools/i2c-tools-4.1-r1.ebuild b/sys-apps/i2c-tools/i2c-tools-4.1-r1.ebuild
21 new file mode 100644
22 index 00000000000..595a0ebccdd
23 --- /dev/null
24 +++ b/sys-apps/i2c-tools/i2c-tools-4.1-r1.ebuild
25 @@ -0,0 +1,74 @@
26 +# Copyright 1999-2018 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=7
30 +
31 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6,3_7} )
32 +DISTUTILS_OPTIONAL="1"
33 +
34 +inherit distutils-r1 flag-o-matic toolchain-funcs
35 +
36 +DESCRIPTION="I2C tools for bus probing, chip dumping, EEPROM decoding, and more"
37 +HOMEPAGE="https://www.kernel.org/pub/software/utils/i2c-tools"
38 +SRC_URI="${HOMEPAGE}/${P}.tar.xz"
39 +
40 +LICENSE="GPL-2"
41 +SLOT="0"
42 +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~sparc ~x86"
43 +IUSE="perl python static-libs"
44 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
45 +
46 +RDEPEND="!<sys-apps/lm_sensors-3
47 + python? ( ${PYTHON_DEPS} )"
48 +DEPEND="${RDEPEND}"
49 +RDEPEND+="
50 + perl? ( dev-lang/perl )"
51 +
52 +src_prepare() {
53 + default
54 + use python && distutils-r1_src_prepare
55 +
56 + # Cut out the eeprom/ & stub/ dirs as only perl scripts live there.
57 + if ! use perl ; then
58 + sed -i '/^SRCDIRS/s: eeprom stub : :g' Makefile || die
59 + fi
60 +}
61 +
62 +src_configure() {
63 + use python && distutils-r1_src_configure
64 +}
65 +
66 +src_compile() {
67 + emake AR="$(tc-getAR)" CC="$(tc-getCC)" all-lib # parallel make
68 + emake CC="$(tc-getCC)"
69 + emake -C eepromer CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
70 +
71 + if use python ; then
72 + cd py-smbus || die
73 + append-cppflags -I../include
74 + distutils-r1_src_compile
75 + fi
76 +}
77 +
78 +src_install() {
79 + emake DESTDIR="${D}" libdir="/usr/$(get_libdir)" PREFIX="/usr" install-lib install
80 + dosbin eepromer/eeprom{,er}
81 + rm -rf "${D}"/usr/include || die # part of linux-headers
82 + dodoc CHANGES README
83 + local d
84 + for d in $(usex perl eeprom '') eepromer ; do
85 + docinto "${d}"
86 + dodoc "${d}"/README*
87 + done
88 +
89 + if use python ; then
90 + cd py-smbus || die
91 + docinto py-smbus
92 + dodoc README*
93 + distutils-r1_src_install
94 + fi
95 +
96 + if ! use static-libs; then
97 + rm -rf "${D}"/usr/$(get_libdir)/libi2c.a || die
98 + fi
99 +}