dev-libs/libatasmart: support cross-compiling

The strpool directory must be compiled natively.  The build system
makes an attempt to handle this by setting CC, AM_CFLAGS, etc., but
configure substitutes CFLAGS directly, so it winds up with CBUILD
CC and CHOST CFLAGS which breaks everything.  This just runs emake
in that directory while overriding flags with command arguments.

Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
This commit is contained in:
David Michael
2020-12-25 21:50:51 -05:00
committed by Mike Gilbert
parent 71dd38ae51
commit c726509edb

View File

@@ -3,6 +3,8 @@
EAPI=7
inherit toolchain-funcs
DESCRIPTION="A small and lightweight parser library for ATA S.M.A.R.T. hard disks"
HOMEPAGE="https://salsa.debian.org/utopia-team/libatasmart"
SRC_URI="mirror://debian/pool/main/liba/${PN}/${PN}_${PV/_p*}.orig.tar.xz
@@ -15,9 +17,7 @@ IUSE="static-libs"
RDEPEND="virtual/libudev:="
DEPEND="${RDEPEND}"
BDEPEND="
virtual/pkgconfig
"
BDEPEND="virtual/pkgconfig"
S="${WORKDIR}/${P/_p*}"
@@ -34,6 +34,17 @@ src_configure() {
econf $(use_enable static-libs static)
}
src_compile() {
if tc-is-cross-compiler; then
tc-export_build_env
emake -C strpool strpool \
CFLAGS="${BUILD_CFLAGS}" \
CPPFLAGS="${BUILD_CPPFLAGS}" \
LDFLAGS="${BUILD_LDFLAGS}"
fi
emake
}
src_install() {
default
find "${ED}" -type f -name "*.la" -delete || die