sys-apps/hdparm: fix post-build strip

Export STRIP only for emake step, to avoid confusing portage's strip step.

- strip: strip --strip-unneeded -N __gentoo_check_ldflags__ -R .comment -R .GCC.command.line -R .note.gnu.gold-version
+ strip: llvm-strip --strip-unneeded -N __gentoo_check_ldflags__ -R .comment -R .GCC.command.line -R .note.gnu.gold-version
     /sbin/hdparm
-strip: Unable to recognise the format of the input file `/build/cherry/tmp/portage/sys-apps/hdparm-9.65/image/sbin/hdparm'

[sam: I can't reproduce STRIP=: failing but the issue is clear here anyway,
we don't want to interfere with the environment's STRIP (even if maybe Portage
should ignore ebuild tampering with it). Just do the cleaner thing which makes
the ebuild simpler as a bonus.]

Closes: https://bugs.gentoo.org/913959
Signed-off-by: Daniil Lunev <dlunev@google.com>
Closes: https://github.com/gentoo/gentoo/pull/32718
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Daniil Lunev
2023-09-11 00:48:35 +01:00
committed by Sam James
parent 95d9d8be86
commit ea693b93b9
+45
View File
@@ -0,0 +1,45 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit toolchain-funcs flag-o-matic
DESCRIPTION="Utility to change hard drive performance parameters"
HOMEPAGE="https://sourceforge.net/projects/hdparm/"
SRC_URI="mirror://sourceforge/hdparm/${P}.tar.gz"
# GPL-2 only
LICENSE="BSD GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="static"
PATCHES=(
"${FILESDIR}"/${PN}-9.60-build.patch
)
src_prepare() {
default
use static && append-ldflags -static
}
src_compile() {
emake STRIP="true" CC="$(tc-getCC)"
}
src_install() {
into /
dosbin hdparm contrib/idectl
newinitd "${FILESDIR}"/hdparm-init-8 hdparm
newconfd "${FILESDIR}"/hdparm-conf.d.3 hdparm
doman hdparm.8
dodoc hdparm.lsm Changelog README.acoustic hdparm-sysconfig
docinto wiper
dodoc wiper/{README.txt,wiper.sh}
docompress -x /usr/share/doc/${PF}/wiper/wiper.sh
}