# Maintainer: Anatol Pomozov
# Contributor: Michael Lass <bevan@bi-co.net>
# Contributor: Philipp Schrader <philipp.schrader+arch@gmail.com>
pkgname=uboot-tools
pkgver=2024.07
pkgrel=1
pkgdesc='U-Boot bootloader utility tools'
arch=(x86_64 'armv7h')
url='https://www.denx.de/wiki/U-Boot/WebHome'
license=(GPL)
depends=(gnutls)
makedepends=(python python-setuptools swig)
source=(https://ftp.denx.de/pub/u-boot/u-boot-$pkgver.tar.bz2{,.sig})
validpgpkeys=('1A3C7F70E08FAB1707809BBF147C39FF9634B72C')
options=(!lto)
sha1sums=('f72be61e3284b76f09ca890e91e807b2f78eddee'
'SKIP')
sha256sums=('f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f'
'SKIP')
build() {
cd u-boot-$pkgver
make defconfig
make tools-all KBUILD_HOSTLDFLAGS=${LDFLAGS}
}
package() {
install -m 755 -d "$pkgdir"/usr/bin
install -m 755 -t "$pkgdir"/usr/bin/ u-boot-$pkgver/tools/{mk{,env}image,env/fw_printenv,img2srec,dumpimage,netconsole,jtagconsole,ncb,kwboot}
ln -s fw_printenv "$pkgdir"/usr/bin/fw_setenv
install -m 644 -Dt "$pkgdir"/usr/share/man/man1/ u-boot-$pkgver/doc/{mkimage,dumpimage,kwboot}.1
}