aboutsummaryrefslogtreecommitdiffstats
path: root/main/u-boot/APKBUILD
blob: 9ec65fbab3a8be8d91a4cfcb1b656c787318a0cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=u-boot
pkgver=2014.04
pkgrel=1
pkgdesc="Bootloader for ARM"
url="http://www.denx.de/wiki/U-Boot/"
arch="armhf"
license="GPL2"
depends=""
depends_dev=""
makedepends="$depends_dev"
install=""
subpackages=""
source="ftp://ftp.denx.de/pub/u-boot/u-boot-$pkgver.tar.bz2
	include-sys-types.patch
	"

_builddir="$srcdir"/u-boot-$pkgver

boards_config="am335x_boneblack wandboard_quad"

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	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
	for board in $boards_config; do
		export BUILD_DIR="$_builddir"/build/$board
		mkdir -p "$BUILD_DIR"
		make distclean
		make O="$BUILD_DIR" ${board}_config
		make O="$BUILD_DIR" all
	done
}

package() {
	cd "$_builddir"
	for board in $boards_config; do
		mkdir -p "$pkgdir"/usr/share/$pkgname/$board
		export BUILD_DIR="$_builddir"/build/$board
		if [ -e "$BUILD_DIR"/MLO ]; then
			cp "$BUILD_DIR"/MLO \
			 "$pkgdir"/usr/share/$pkgname/$board || return 1
		fi
		cp "$BUILD_DIR"/u-boot.* \
		 "$pkgdir"/usr/share/$pkgname/$board || return 1
	done
}

md5sums="6d2116d1385a66e9a59742caa9d62a54  u-boot-2014.04.tar.bz2
946644b87937315253151db8b1ba98ec  include-sys-types.patch"
sha256sums="7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31  u-boot-2014.04.tar.bz2
675676d857758d2eafab39592ad0f937be4021deb5cc47e44bea174a744871b3  include-sys-types.patch"
sha512sums="9bfd00f057238bf7caa81013375f0825ea480f0c8656917609ce728cf1758d1f82a3ff7e8acd957dc8cc5ed5c473a8c239f2121c0edceae78fdc504d2b4db92e  u-boot-2014.04.tar.bz2
3e3a3a1d0f0fb9a41fe0e1427f91d05ec3c70103d5a185ed1d287ea23032ddcd01c0786ddca1d45d05e34df1b4a54a961bd123115798148205a22f6083142a57  include-sys-types.patch"