dev-embedded/u-boot-tools: tweak for gcc-10
[gentoo.git] / dev-embedded / u-boot-tools / u-boot-tools-2020.01.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit toolchain-funcs
7
8 MY_P="u-boot-${PV/_/-}"
9 DESCRIPTION="utilities for working with Das U-Boot"
10 HOMEPAGE="https://www.denx.de/wiki/U-Boot/WebHome"
11 SRC_URI="ftp://ftp.denx.de/pub/u-boot/${MY_P}.tar.bz2"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
16 IUSE=""
17
18 DEPEND="
19         sys-devel/flex
20         sys-devel/bison
21 "
22
23 PATCHES=(
24         "${FILESDIR}"/${P}-gcc-10.patch
25 )
26
27 S=${WORKDIR}/${MY_P}
28
29 src_compile() {
30         # Unset a few KBUILD variables. Bug #540476
31         unset KBUILD_OUTPUT KBUILD_SRC
32
33         emake \
34                 V=1 \
35                 HOSTCC="$(tc-getCC)" \
36                 HOSTCFLAGS="${CFLAGS} ${CPPFLAGS}"' $(HOSTCPPFLAGS)' \
37                 HOSTLDFLAGS="${LDFLAGS}" \
38                 tools-only_defconfig
39
40         emake \
41                 V=1 \
42                 NO_SDL=1 \
43                 HOSTSTRIP=: \
44                 STRIP=: \
45                 HOSTCC="$(tc-getCC)" \
46                 HOSTCFLAGS="${CFLAGS} ${CPPFLAGS}"' $(HOSTCPPFLAGS)' \
47                 HOSTLDFLAGS="${LDFLAGS}" \
48                 CONFIG_ENV_OVERWRITE=y \
49                 tools-all
50 }
51
52 src_test() { :; }
53
54 src_install() {
55         cd tools || die
56         dobin bmp_logo dumpimage fdtgrep gen_eth_addr img2srec mkenvimage mkimage
57         dobin env/fw_printenv
58         dosym fw_printenv /usr/bin/fw_setenv
59         insinto /etc
60         doins env/fw_env.config
61         doman "${S}"/doc/mkimage.1
62 }