# Maintainer: Jacek Pruciak <pmos@juniorjpdj.pl>
pkgname=u-boot-goclever-gcta741l
pkgver=2021.01
pkgrel=1
pkgdesc="u-boot for GoClever Orion 70L"
url="https://www.denx.de/wiki/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"
options="!check" # no tests in upstream
makedepends="$depends_dev bc dtc python3-dev swig bison flex openssl-dev
	py3-setuptools linux-headers"
# https://github.com/megous/linux/tree/orange-pi-5.12#kernel-lockup-issues
source="
	https://ftp.denx.de/pub/u-boot/u-boot-${pkgver//_/-}.tar.bz2
	0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch
	0002-dts-add-sun6i-a31s-goclever-gcta741l.patch
	0003-configs-add-goclever-gcta741l.patch
	"
builddir="$srcdir"/u-boot-${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

	make goclever-gcta741l_config
	make all
}

package() {
	install -D -m644 "$builddir"/u-boot-sunxi-with-spl.bin \
		"$pkgdir"/usr/share/u-boot/goclever-gcta741l/u-boot-sunxi-with-spl.bin
}

sha512sums="40dd4d9ef87a1829158658c433d46a047a39c0d8c314ad8d133f7240343ee3a75b060f009dd2efe598cfb8a766773f6cd773ea7f7745ee88e52a771c77eb1c6e  u-boot-2021.01.tar.bz2
9478a5b46414139212a11d29e05dd973c4c866e8970b25021517d47b7177a03c910dbe761ae9c5acee0e4f1a5a8db76f24e168b83a5ebd9034d9cb640350604e  0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch
26a3da78f3a0c3d6552334a83121aa318fa187b716e5a2b92a330a12c37c2a74aa319faa7e4c06be4918c4de6c28a5c8b909c39a5e3aa64b2960c7e2648799a2  0002-dts-add-sun6i-a31s-goclever-gcta741l.patch
60bebb229e26e574b49f79470b0b6717a510eec69dd27835da0c6c9c10ccf1b8908fb4095f177a48b68bae1674187549bc5a9cbf26525b8242e4a82c94f1733d  0003-configs-add-goclever-gcta741l.patch"
