summaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32/APKBUILD
blob: 2e0b0beb22e25a2c65058cd15d075c10de8fe9ea (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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_abiver=0.9.32
pkgname=libc$_abiver
_gitver=
pkgver=0.9.33.2
_ver=${pkgver/_/-}
pkgrel=14
pkgdesc="C library for developing embedded Linux systems"
url=http://uclibc.org
license="LGPL-2"
arch="all"
options=
makedepends="linux-headers"
# libc subpackage must be last
subpackages="uclibc-dev:dev uclibc-utils:utils libthread_db libpthread libc"
depends_dev="linux-headers=>2.6.32"
replaces=uclibc
depends="libpthread libc"
options="!strip"
triggers="uclibc-utils.trigger=/lib:/usr/lib"
ldpath="/lib"

_snapurl="http://git.uclibc.org/uClibc/snapshot/master.tar.bz2"
_snapfile="$pkgname-$pkgver.tar.bz2"

# patches are tracked in http://git.alpinelinux.org/cgit/uClibc-alpine/
# branch 0.9.32-alpine

source="http://uclibc.org/downloads/uClibc-${_ver}.tar.xz
0001-Compatible-stack-protector-for-non-Thread-Local-stor.patch
0002-resolv-res_query-for-CNAMEs.patch
0003-resolv-fix-resolver-to-return-TRY_AGAIN-on-timeout.patch
0004-libm-x86_64-implement-some-fenv-functions.patch
0005-stdlib-fix-arc4random-return-type-to-u_int32_t.patch
0006-malloc-standard-synchronize-on-fork.patch
0007-libc-x86-fix-stack-unwinding-and-backtrace-informati.patch
0008-ldso-limited-support-for-ORIGIN-in-rpath.patch
eventfd.patch
uClibc-0.9.33-avahi.patch
librt-re-add-SIGCANCEL-to-the-list-of-blocked-signal-in-helper-thread.patch
	
	0001-add-posix_madvise.c.patch
	posix_fallocate.patch
	posix_fallocate-fix.patch

	0001-cancel.h-add-generic-file-to-ease-cancellation-suppo.patch
	0002-pread-pwrite-handle-renamed-syscalls-in-common-ppc-x.patch
	0003-pread-pwrite-drop-fallback-funcs.patch
	0004-add-cancellation-to-generic-pread_write.patch
	0005-pread_write.c-make-all-archs-use-common-code.patch
	0006-endian.h-add-some-handy-macros-to-be-used-in-syscall.patch

	0009-sys-quota.h-sync-with-glibc.patch

	0001-libc-sysdeps-get-make-set-swap-context-for-i386.patch
	0002-libc-sysdeps-add-get-make-set-swap-context-for-x86_6.patch
	uclibc-dlclose-fix.patch
	uclibc-rtld_next-fix.patch

	uclibcconfig.x86
	uclibcconfig.x86_64
	uclibcconfig.i486
	uclibcconfig.arm
	uclibcconfig.powerpc
	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 V=2 silentoldconfig
	make -j1 V=2 pregen KERNEL_HEADERS="$SYSROOT"/usr/include \
		CROSS="$CROSS" || return 1
	make all V=2 KERNEL_HEADERS="$SYSROOT/usr/include" CROSS="$CROSS" || return 1
	make utils V=2 CROSS="$CROSS" || return 1
}

package() {
	cd "$_builddir"
	make V=2 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 fts-dev"
	mkdir -p "$subpkgdir"/usr/lib 
	mv "$pkgdir"/usr/lib/*.so "$subpkgdir"/usr/lib/
}

utils() {
	pkgdesc="uClibc utility programs"
	replaces="uclibc $pkgname"
	depends=
	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"
	depends=
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/libthread_db* "$subpkgdir"/lib/
}

libpthread() {
	pkgdesc="uClibc threading and realtime libraries"
	replaces="libc0.9.32"
	depends=
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/libpthread* \
		"$pkgdir"/lib/librt* \
		"$subpkgdir"/lib/
}

libc() {
	pkgdesc="uClibc standard C libraries"
	replaces="libc0.9.32"
	depends=
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/* "$subpkgdir"/lib/
}

md5sums="73e6fe215648d02246f4d195b25fb17e  uClibc-0.9.33.2.tar.xz
d4c8fb190eb4327453ed924159ca432e  0001-Compatible-stack-protector-for-non-Thread-Local-stor.patch
f9c9de09da5eade2fb9dff8f9f8b3fc9  0002-resolv-res_query-for-CNAMEs.patch
96e5deaa662695a56571f47c7ac2fc94  0003-resolv-fix-resolver-to-return-TRY_AGAIN-on-timeout.patch
e726ab363c0f8aed8dc31b8c54495b5d  0004-libm-x86_64-implement-some-fenv-functions.patch
d8e62f8016274fc8605e6f77d4def79e  0005-stdlib-fix-arc4random-return-type-to-u_int32_t.patch
235ca36ca8c10878d63d68ba61f76634  0006-malloc-standard-synchronize-on-fork.patch
d9611de57fb72b74c0b9e243b8e9165b  0007-libc-x86-fix-stack-unwinding-and-backtrace-informati.patch
12cf5330b092ee7e00d14909737abc70  0008-ldso-limited-support-for-ORIGIN-in-rpath.patch
a86eb40e8aca531a1cfee5faff3c53d4  eventfd.patch
d91fcb785ae14632a4ea8fa03ba0236f  uClibc-0.9.33-avahi.patch
b99adbb951c35aec0a09930e12efab86  librt-re-add-SIGCANCEL-to-the-list-of-blocked-signal-in-helper-thread.patch
f88dac5fe54a1bffce7d1ff4b53a755c  0001-add-posix_madvise.c.patch
ddc2778790a0f3537828c2c3dbcdb042  posix_fallocate.patch
a93a0e50e73bb6e8d8abf6e4340378b6  posix_fallocate-fix.patch
085d98078455ad0f0c2d63c6fa9ea67c  0001-cancel.h-add-generic-file-to-ease-cancellation-suppo.patch
583a8b6d4a29abe0b6ac449a1694b079  0002-pread-pwrite-handle-renamed-syscalls-in-common-ppc-x.patch
f059f5e437ed4fe1b6973dd08972e583  0003-pread-pwrite-drop-fallback-funcs.patch
1983ddd723a96432aba74b1132bd6e29  0004-add-cancellation-to-generic-pread_write.patch
32544dc16cc1b4845484535bf758a4b1  0005-pread_write.c-make-all-archs-use-common-code.patch
73037bc978897e20ae2fc531759443eb  0006-endian.h-add-some-handy-macros-to-be-used-in-syscall.patch
f41ab6cf22545d2e629d4c7107ac6f85  0009-sys-quota.h-sync-with-glibc.patch
e5aceb82bf4ffd5328113af5380fcdb6  0001-libc-sysdeps-get-make-set-swap-context-for-i386.patch
da043a65003ac29ca8b96f416e7752ee  0002-libc-sysdeps-add-get-make-set-swap-context-for-x86_6.patch
8374c98e769e603af4adad12e01cf358  uclibc-dlclose-fix.patch
ffe7564afe846026a278dd8c0251ace9  uclibc-rtld_next-fix.patch
ce8a33a31f5a53031fbad8b1d1b66d44  uclibcconfig.x86
e861a17baa541accf4d4d39a98d74c32  uclibcconfig.x86_64
ce8a33a31f5a53031fbad8b1d1b66d44  uclibcconfig.i486
3f1e788cfa922c5a39d22a509bf49b60  uclibcconfig.arm
820d5176004ccfa2baa3607ba576360f  uclibcconfig.powerpc
f3be4f2bc54d7561d252937e10abf0d2  uclibc-utils.trigger"