blob: e10d223f49698808432deaf96d00e5c81dad5388 (
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=u-boot
pkgver=2016.07
pkgrel=0
pkgdesc="Bootloader for ARM"
url="http://www.denx.de/wiki/U-Boot/"
arch="armhf"
license="GPL2"
depends=""
depends_dev=""
makedepends="$depends_dev bc"
install=""
subpackages=""
source="ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver//_/-}.tar.bz2
README.txt
"
_srcdir="$srcdir"/u-boot-${pkgver//_/-}
builddir="$srcdir"/build
board_configs="
beagleboard:am335x_boneblack
cubieboard:Cubieboard,Cubieboard2
raspberrypi:rpi,rpi_2,rpi_3_32b
wandboard:wandboard
"
for board_config in $board_configs; do
subpackages="$subpackages $pkgname-${board_config%%:*}"
done
depends="$subpackages"
build() {
cd "$_srcdir"
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
local board_config board
for board_config in $board_configs; do
local configs="${board_config#*:}"
for board in ${configs//,/ }; do
msg "Building u-boot for $board"
export BUILD_DIR="$builddir"/$board
mkdir -p "$BUILD_DIR"
make O="$BUILD_DIR" ${board}_config || return 1
make O="$BUILD_DIR" all || return 1
done
done
}
package() {
cd "$builddir"
mkdir -p "$pkgdir"/usr/share/$pkgname
install "$srcdir"/README.txt "$pkgdir"/usr/share/$pkgname/README.txt
}
_split_boards() {
cd "$builddir"
pkgdesc="u-boot for $1"
depends=""
shift
local board
for board; do
msg "Including board $board"
mkdir -p "$subpkgdir"/usr/share/$pkgname/$board
export BUILD_DIR="$builddir"/$board
local ok=no
for image in MLO SPL u-boot.img; do
if [ -e "$BUILD_DIR"/$image ]; then
cp "$BUILD_DIR"/$image "$subpkgdir"/usr/share/$pkgname/$board \
|| return 1
ok=yes
fi
done
if [ "$ok" = "no" ]; then
cp "$BUILD_DIR"/u-boot.bin "$subpkgdir"/usr/share/$pkgname/$board \
|| return 1
fi
done
}
for board_config in $board_configs; do
local board="${board_config%%:*}"
local configs="${board_config#*:}"
eval "${board}() { _split_boards $board ${configs//,/ }; }"
done
md5sums="425a3fa610a7d972e5092a0e92276c70 u-boot-2016.07.tar.bz2
a15f53ccac7769614b1ee47971b27218 README.txt"
sha256sums="974fb7225c0af6a721307631f66b81e20dbda82a4d7cc32aba2a625727231253 u-boot-2016.07.tar.bz2
286e3df4e9c682d7b41bbed610ec4ac8894129697816dfce1c88b848ab969d89 README.txt"
sha512sums="fa76dbd7e654ff9e4b3166162be6c0a77ecf2eb2a952b4865df3c818ebcdca7e2bb75e5ba19bf0346000c3d185888552193bb74510b115426cfe444b78efd3ef u-boot-2016.07.tar.bz2
25ced657357acb80a6c2f064e7ad6c9497a8a52f72c366e6f362824e9453588dbbef392966cfa04d4d7c13c21a65b53cd43d306da0c54449622922c8542f2a43 README.txt"
|