summaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32/APKBUILD
blob: 8fc93dadaa377924576511779052a4f8771fece1 (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_abiver=0.9.32
pkgname=libc$_abiver
_gitver=
pkgver=0.9.32
_ver=${pkgver/_/-}
pkgrel=8
pkgdesc="C library for developing embedded Linux systems"
url=http://uclibc.org
license="LGPL-2"
arch="all"
options=
makedepends="linux-headers"
subpackages="uclibc-dev:dev uclibc-utils:utils libthread_db"
depends_dev="linux-headers=>2.6.32"
replaces=uclibc
options="!strip"
triggers="uclibc-utils.trigger=/lib:/usr/lib"

_snapurl="http://git.uclibc.org/uClibc/snapshot/master.tar.bz2"
_snapfile="$pkgname-$pkgver.tar.bz2"
source="http://uclibc.org/downloads/uClibc-${_ver}.tar.bz2
	compat-stack-guard.patch
	uclibc-resolv-cname-fix.diff
	uclibc-resolv-fix-memory-leak.patch
	0001-resolv-fix-resolver-to-return-TRY_AGAIN-on-timeout.patch
	0001-libm-x86_64-implement-some-fenv-functions.patch
	0001-ldso-limited-support-for-ORIGIN-in-rpath.patch
	0002-stdlib-fix-arc4random-return-type-to-u_int32_t.patch
	0003-ldso-support-RTLD_NOLOAD.patch
	0001-libdl-rudimentary-locking-for-dlopen-dlsym-dlclose.patch
	0001-malloc-standard-synchronize-on-fork.patch
	0001-time-fix-parsing-of-tzdata-files-where-off_t-is-64-b.patch
	0001-getaddrinfo-allow-numeric-service-without-any-hints.patch
	0001-libc-x86-fix-stack-unwinding-and-backtrace-informati.patch
	libm-cabsf.patch
	libm-cexp.patch
	uclibc-ubacktrace-asneeded-fix.patch
	uclibc-librt-asneeded-fix.patch
	uclibc-epoll_pwait-hack.patch
	uclibcconfig.x86
	uclibcconfig.x86_64
	uclibcconfig.i486
	uclibcconfig.arm
	uclibcconfig.powerpc
	sha512-crypt.patch
	uclibc-eventfd.patch
	uclibc-utils.trigger
	"

_config="$srcdir"/uclibcconfig.${CARCH}
_builddir="$srcdir"/uClibc-${_ver}

snapshot() {
	local _date=$(date +%y%m%d%H%M)
	_gitver=$_date
	pkgver=${_abiver}_alpha0_git$_gitver
	_snapfile="$pkgname-$pkgver.tar.bz2"

	rm -f "$SRCDEST"/$_snapfile
	msg "snapfile=$_snapfile"
	wget -O "$SRCDEST"/$_snapfile $_snapurl
	pkgrel=0
	sed -i -e "s/^_gitver=.*/_gitver=$_gitver/" \
		-e "s/^pkgrel=.*/pkgrel=$pkgrel/" \
		APKBUILD
	checksum
}

prepare() {
	local i
	cd "$_builddir"
	# patches goes here
	for i in $source; do
		case $i in
		*.patch|*.diff)
			msg "Applying $i..."
			patch -p1 -i "$srcdir"/$i || return 1
			;;
		esac
	done
	# set abi version and remove unsupported warnings c flag
	sed -i -e "s/^ABI_VERSION.*/ABI_VERSION := $_abiver/" \
		-e "s/-Wold-style-declaration//g" \
		Rules.mak
}

build() {
	local _kh=
	cd "$_builddir"
	if [ -n "$SYSROOT" ]; then
		_kh=KERNEL_HEADERS="$SYSROOT/include"
	fi
	cp "$_config" .config
	if [ -n "$DEBUG" ]; then
		sed -i -e 's/# DODEBUG is not set/DODEBUG=y/' \
			-e 's/DOSTRIP=y/# DOSTRIP is not set/' \
			.config
	fi
	make silentoldconfig
	make -j1 pregen KERNEL_HEADERS="$SYSROOT"/usr/include \
		CROSS="$CROSS" || return 1
	make all KERNEL_HEADERS="$SYSROOT/usr/include"  CROSS="$CROSS" || return 1
	make utils CROSS="$CROSS" || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" KERNEL_HEADERS="$SYSROOT/usr/include" \
		CROSS="$CROSS" install install_utils
	install -Dm755 extra/scripts/getent "$pkgdir"/usr/bin/getent
}

dev() {
	default_dev
	replaces="uclibc linux-headers"
	mkdir -p "$subpkgdir"/usr/lib 
	mv "$pkgdir"/usr/lib/*.so "$subpkgdir"/usr/lib/
}

utils() {
	pkgdesc="uClibc utility programs"
	replaces="uclibc $pkgname"
	mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/sbin
	mv "$pkgdir"/sbin/* "$subpkgdir"/sbin/
	mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin/
}

libthread_db() {
	pkgdesc="uClibc thread debugging library"
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/libthread_db* "$subpkgdir"/lib/
}

md5sums="cfcb6c25d8ebe12817499d8749ee8ae1  uClibc-0.9.32.tar.bz2
a9bfb77ea7dc5fb9abf4d4b19201c614  compat-stack-guard.patch
5d6e3e382b66f59cfd7242a4fe453f98  uclibc-resolv-cname-fix.diff
6bdb884bd00b053247e02b4024d33b39  uclibc-resolv-fix-memory-leak.patch
08f31006426a0fca561f262f36bcfb01  0001-resolv-fix-resolver-to-return-TRY_AGAIN-on-timeout.patch
68913d6f096fd647e8bdb7ef182c05a4  0001-libm-x86_64-implement-some-fenv-functions.patch
bc164e262c5feab55c800780704fa71c  0001-ldso-limited-support-for-ORIGIN-in-rpath.patch
b4fb68ad3d0e8331b1b40c30eb21dfdc  0002-stdlib-fix-arc4random-return-type-to-u_int32_t.patch
6147efd2eee5af5e734896823c2d1a3d  0003-ldso-support-RTLD_NOLOAD.patch
3e151ae3d3613dff9296d166aca3a800  0001-libdl-rudimentary-locking-for-dlopen-dlsym-dlclose.patch
30f27fe51fdc4d121166ad2af18dfb8d  0001-malloc-standard-synchronize-on-fork.patch
2548d9f470c9a5b2c117ec3d6f35c105  0001-time-fix-parsing-of-tzdata-files-where-off_t-is-64-b.patch
9e1ffc8dae55f4489c770f284734804f  0001-getaddrinfo-allow-numeric-service-without-any-hints.patch
e814d39ab0adab58d69396ac0b9acdea  0001-libc-x86-fix-stack-unwinding-and-backtrace-informati.patch
40e9c7f017cc81ee5b19ead000b9b6b7  libm-cabsf.patch
42416385763f7cd50775ed9bfaf2d59e  libm-cexp.patch
7c47e9cb284b0da8df6ed2096b2c9c66  uclibc-ubacktrace-asneeded-fix.patch
e5caf13c43ee8d48f22eded21b857d81  uclibc-librt-asneeded-fix.patch
0ed588014227935fbb83b207282f3c15  uclibc-epoll_pwait-hack.patch
beeafc978b9ad3ea963a4760a4334f03  uclibcconfig.x86
83320781fa8ad9d9d7be6db3169b2584  uclibcconfig.x86_64
beeafc978b9ad3ea963a4760a4334f03  uclibcconfig.i486
8f6e60a43d02b84e3acfea53be9a8d01  uclibcconfig.arm
f02d8174ff7ea74942428bbbaf46abae  uclibcconfig.powerpc
7bf1af84106de9e05160ed6d4853c54f  sha512-crypt.patch
26dd7611fda4d29f3dc4a7cf24916931  uclibc-eventfd.patch
f3be4f2bc54d7561d252937e10abf0d2  uclibc-utils.trigger"