# Archived: unmaintained
maintainer=""
pkgname=u-boot-q8-a33-tablet
pkgver=2023.01
pkgrel=2
pkgdesc="U-Boot bootloader for the Q8 A33 Tablet"
url="https://source.denx.de/u-boot"
arch="armv7"
license="GPL-2.0-or-later OFL-1.1 BSD-2-Clause BSD-3-Clause eCos-2.0 IBM-pibs
	ISC LGPL-2.0-only LGPL-2.1-only X11"
depends="linux-postmarketos-allwinner>=5.12"
makedepends="$depends_dev
	bc
	bison
	dtc
	flex
	openssl-dev
	py3-setuptools
	python3-dev
	swig
	"
options="!check"
source="https://source.denx.de/u-boot/u-boot/-/archive/v$pkgver/u-boot-v$pkgver.tar.gz
	python-3.13-binman-migrate-from-pkg_resources-to-imp.patch
	libfdt.i_shipped-use-SWIG_AppendOutput.patch
"
builddir="$srcdir/u-boot-v$pkgver"

build() {
	touch include/config.h
	LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > include/timestamp_autogenerated.h
	LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> include/timestamp_autogenerated.h
	export BUILD_DIR="$builddir"/build

		make O="$BUILD_DIR" HOSTCC=gcc ARCH=arm q8_a33_tablet_1024x600_defconfig
		make O="$BUILD_DIR" HOSTCC=gcc ARCH=arm all
		sha512sum -b "$BUILD_DIR/u-boot-sunxi-with-spl.bin" > "$BUILD_DIR/u-boot-sunxi-with-spl.bin.sha512"
}

package() {
		install -D -m644 "build/u-boot-sunxi-with-spl.bin" \
			"$pkgdir/usr/share/u-boot/q8-a33/u-boot-sunxi-with-spl.bin"
		install -D -m644 "build/u-boot-sunxi-with-spl.bin.sha512" \
			"$pkgdir/usr/share/u-boot/q8-a33/u-boot-sunxi-with-spl.bin.sha512"
}
sha512sums="
c25aae1b0d2f677d295587c6d318f23d52bc3a79e968bed9093645943a9840c56b1f6f44e5649d236e76e3dc85f0473c1da4a5205c02dcf437bca820acaf6fb8  u-boot-v2023.01.tar.gz
c0545c6a1d17507f7e4bc337200fa3a4a1a89d62122cc6599ea00f27187b85f3e322d945683a84cdff98d981cf604187ded05d7b93bb5fae5a3fe7f9751077a2  python-3.13-binman-migrate-from-pkg_resources-to-imp.patch
016ef30dbbb1021dad4f58eeda3f5a5e89ff3a76dbc69e8e4cf6a3fc3983aef998cfe1087abb4b21bb2f859bd5cffe26c1da42d13f1c3d2e3c053c399f38720b  libfdt.i_shipped-use-SWIG_AppendOutput.patch
"
