aboutsummaryrefslogtreecommitdiffstats
path: root/main/u-boot/APKBUILD
blob: d0e9df4d7f2da49ba80ee447bb88deb017b5a1e0 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# 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=2
pkgdesc="Bootloader for ARM"
url="http://www.denx.de/wiki/U-Boot/"
arch="armhf"
license="GPL2"
depends=""
depends_dev=""
makedepends="$depends_dev"
install=""
subpackages="am335x_boneblack wandboard_quad"
source="ftp://ftp.denx.de/pub/u-boot/u-boot-$pkgver.tar.bz2
	include-sys-types.patch
	"

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

boards_config="$subpackages"

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"
	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	echo "Dummy package" > "$pkgdir"/usr/share/doc/$pkgname/README
}

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

am335x_boneblack() {
	pkgdesc="u-boot for BeagleBone Black"
	_do_subpkg $subpkgname
}

wandboard_quad() {
	pkgdesc="u-boot for Wandboard Quad"
	_do_subpkg $subpkgname
}

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"