diff options
author | Fabian Groffen <grobian@gentoo.org> | 2022-12-25 12:45:55 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2022-12-25 12:46:40 +0100 |
commit | 51612c48d72f36fc6646a75f43827daa085dc5df (patch) | |
tree | deb27af153551030210b976cf8ea72c422844ca7 /app-admin/coreboot-utils/coreboot-utils-4.18.ebuild | |
parent | profiles: unmask mysqltcl (diff) | |
download | gentoo-51612c48d72f36fc6646a75f43827daa085dc5df.tar.gz gentoo-51612c48d72f36fc6646a75f43827daa085dc5df.tar.bz2 gentoo-51612c48d72f36fc6646a75f43827daa085dc5df.zip |
app-admin/coreboot-utils: some useful utils from coreboot project
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'app-admin/coreboot-utils/coreboot-utils-4.18.ebuild')
-rw-r--r-- | app-admin/coreboot-utils/coreboot-utils-4.18.ebuild | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/app-admin/coreboot-utils/coreboot-utils-4.18.ebuild b/app-admin/coreboot-utils/coreboot-utils-4.18.ebuild new file mode 100644 index 000000000000..a9115a5fe9d9 --- /dev/null +++ b/app-admin/coreboot-utils/coreboot-utils-4.18.ebuild @@ -0,0 +1,66 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="A selection from coreboot/utils useful in general" +HOMEPAGE="https://www.coreboot.org/" +SRC_URI="https://coreboot.org/releases/coreboot-${PV}.tar.xz" + +LICENSE="GPL-2+ GPL-2" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND="sys-apps/pciutils + sys-libs/zlib" +RDEPEND="${DEPEND}" +BDEPEND="" + +S="${WORKDIR}/coreboot-${PV}" +PATCHES=( + "${FILESDIR}"/${PN}-4.18-musl.patch + "${FILESDIR}"/${PN}-4.18-flags.patch +) + +coreboot_utils=( + #cbfstool has textrels and is not really necessary outside coreboot + cbmem + ifdtool + intelmetool + inteltool + me_cleaner + nvramtool + pmh7tool + superiotool +) + +src_prepare() { + default + # drop some CFLAGS that hurt compilation on modern toolchains or + # force optimisation + # can't do this in one sed, because it all happens back-to-back + for e in '-O[01234567s]' '-g' '-Werror' '-ansi' '-pendantic' ; do + sed -i -e 's/ '"${e}"'\( \|$\)/ /g' util/*/Makefile{.inc,} || die + done +} + +src_compile() { + # selection from README.md that seem useful outside coreboot + + tc-export CC + export HOSTCFLAGS="${CFLAGS}" + for tool in ${coreboot_utils[*]} ; do + [[ -f util/${tool}/Makefile ]] || continue + emake -C util/${tool} V=1 + done +} + +src_install() { + exeinto /usr/sbin + for tool in ${coreboot_utils[*]} ; do + [[ -e util/${tool}/${tool} ]] && doexe util/${tool}/${tool} + [[ -e util/${tool}/${tool}.py ]] && doexe util/${tool}/${tool}.py + done +} |