Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libatasmart/
Date: Mon, 28 Dec 2020 17:35:54
Message-Id: 1609176946.c726509edbce1bb066d87a43aaac8fdfb741c272.floppym@gentoo
1 commit: c726509edbce1bb066d87a43aaac8fdfb741c272
2 Author: David Michael <fedora.dm0 <AT> gmail <DOT> com>
3 AuthorDate: Sat Dec 26 02:50:51 2020 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 28 17:35:46 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c726509e
7
8 dev-libs/libatasmart: support cross-compiling
9
10 The strpool directory must be compiled natively. The build system
11 makes an attempt to handle this by setting CC, AM_CFLAGS, etc., but
12 configure substitutes CFLAGS directly, so it winds up with CBUILD
13 CC and CHOST CFLAGS which breaks everything. This just runs emake
14 in that directory while overriding flags with command arguments.
15
16 Package-Manager: Portage-3.0.9, Repoman-3.0.2
17 Signed-off-by: David Michael <fedora.dm0 <AT> gmail.com>
18 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
19
20 dev-libs/libatasmart/libatasmart-0.19_p5.ebuild | 17 ++++++++++++++---
21 1 file changed, 14 insertions(+), 3 deletions(-)
22
23 diff --git a/dev-libs/libatasmart/libatasmart-0.19_p5.ebuild b/dev-libs/libatasmart/libatasmart-0.19_p5.ebuild
24 index 7da99e26ec2..8afa393021d 100644
25 --- a/dev-libs/libatasmart/libatasmart-0.19_p5.ebuild
26 +++ b/dev-libs/libatasmart/libatasmart-0.19_p5.ebuild
27 @@ -3,6 +3,8 @@
28
29 EAPI=7
30
31 +inherit toolchain-funcs
32 +
33 DESCRIPTION="A small and lightweight parser library for ATA S.M.A.R.T. hard disks"
34 HOMEPAGE="https://salsa.debian.org/utopia-team/libatasmart"
35 SRC_URI="mirror://debian/pool/main/liba/${PN}/${PN}_${PV/_p*}.orig.tar.xz
36 @@ -15,9 +17,7 @@ IUSE="static-libs"
37
38 RDEPEND="virtual/libudev:="
39 DEPEND="${RDEPEND}"
40 -BDEPEND="
41 - virtual/pkgconfig
42 -"
43 +BDEPEND="virtual/pkgconfig"
44
45 S="${WORKDIR}/${P/_p*}"
46
47 @@ -34,6 +34,17 @@ src_configure() {
48 econf $(use_enable static-libs static)
49 }
50
51 +src_compile() {
52 + if tc-is-cross-compiler; then
53 + tc-export_build_env
54 + emake -C strpool strpool \
55 + CFLAGS="${BUILD_CFLAGS}" \
56 + CPPFLAGS="${BUILD_CPPFLAGS}" \
57 + LDFLAGS="${BUILD_LDFLAGS}"
58 + fi
59 + emake
60 +}
61 +
62 src_install() {
63 default
64 find "${ED}" -type f -name "*.la" -delete || die