aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/APKBUILD
blob: df3998210f9f8290ac298337e844de0093e080d0 (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
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=musl
pkgver=0.9.11
pkgrel=3
pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/"
arch="x86 x86_64 arm armel"
license="MIT"
depends=""
depends_dev=""
makedepends="$depends_dev"
install=""
subpackages="$pkgname-dev $pkgname-utils"
[ "${CTARGET#*musl}" = "$CTARGET" ] && subpackages="$subpackages musl-gcc:crosstool"
source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
	0001-fix-Makefile-so-make-install-works-before-include-bi.patch
	0002-add-stubs-for-additional-legacy-ether.h-functions.patch
	0003-add-legacy-scsi-scsi_ioctl.h-header.patch
	0004-add-legacy-sys-ttydefaults.h-header.patch
	0005-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
	0006-fix-off-by-one-array-bound-in-strsignal.patch
	0007-fix-invalid-library-phdr-pointers-passed-to-callback.patch
	0008-add-some-ARM-EABI-specific-exception-handling-infras.patch
	0009-add-PIE-support-for-ARM.patch
	0010-make-posix_spawn-and-functions-that-use-it-use-CLONE.patch

	getopt_long.c
	getent
	"

_builddir="$srcdir"/musl-$pkgver
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

	# use GNU compatible getopt() from BSD
	rm -f src/misc/getopt*.c
	cp "$srcdir"/getopt_long.c src/misc/
}

build() {
	local _ldflags
	cd "$_builddir"
	LDFLAGS="$LDFLAGS -Wl,-soname,libc.musl-${CARCH}.so.1" \
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	rm -f "$pkgdir"/usr/lib/*.la

	# make LDSO the be the real file, and libc the symlink (will be upstream change)
	local LDSO=$(make -f Makefile --eval "$(echo -e 'print-ldso:\n\t@echo $$(basename $(LDSO_PATHNAME))')" print-ldso)
	mv -f "$pkgdir"/usr/lib/libc.so "$pkgdir"/lib/"$LDSO" || return 1
	ln -sf "$LDSO" "$pkgdir"/lib/libc.musl-${CARCH}.so.1 || return 1
	ln -sf ../../lib/"$LDSO" "$pkgdir"/usr/lib/libc.so || return 1
	mkdir -p "$pkgdir"/usr/bin
	ln -sf ../../lib/"$LDSO" "$pkgdir"/usr/bin/ldd || return 1
}

utils() {
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/ldd "$subpkgdir"/usr/bin
	find "$pkgdir" -type d -delete 2>/dev/null
	install -D "$srcdir"/getent "$subpkgdir"/usr/bin/getent
}

crosstool() {
	mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/bin/musl-gcc "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/lib/musl-gcc.specs "$subpkgdir"/usr/lib
	find "$pkgdir" -type d -delete 2>/dev/null
}

md5sums="70b17ca5c847e74e1c77fe8284bb1fa4  musl-0.9.11.tar.gz
cce3406fc07756f25181b71152e55865  0001-fix-Makefile-so-make-install-works-before-include-bi.patch
5ce3afcc1cfc332bebe53355fdd00d3c  0002-add-stubs-for-additional-legacy-ether.h-functions.patch
f0254759e89b0b000f33c8116eb1aac0  0003-add-legacy-scsi-scsi_ioctl.h-header.patch
7c01567c09bcf3f0d530a1e5fc57b932  0004-add-legacy-sys-ttydefaults.h-header.patch
3e5dd5906b99a7c79cd7eea0277b4310  0005-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
45f147f5e49692320aec8b13b3ac66a6  0006-fix-off-by-one-array-bound-in-strsignal.patch
902ed8d04e08b912a0ab1166756c3455  0007-fix-invalid-library-phdr-pointers-passed-to-callback.patch
1763905f21ab6b94dfb2d6611c47a84d  0008-add-some-ARM-EABI-specific-exception-handling-infras.patch
980ad576c337b0bd75da128816a2e0a5  0009-add-PIE-support-for-ARM.patch
627a5b94e86e5d0ef4ed575d5e8da229  0010-make-posix_spawn-and-functions-that-use-it-use-CLONE.patch
acbb8a052228d9d5b89bc2ed55616fe3  getopt_long.c
ef81489a6258501cf45db58dfc6d5211  getent"
sha256sums="8b81fd9b71becb7b674ea93fd65d82a039fab79ab738957a5e9ee47ba08a13fd  musl-0.9.11.tar.gz
61ed4546341484f682d70f57a9d3549d9c646f33c779adb171e31e13b7b62070  0001-fix-Makefile-so-make-install-works-before-include-bi.patch
a49a959e48225e5aa51576ac36c8e07eb064aeb00203d5c47cb201aee1238f40  0002-add-stubs-for-additional-legacy-ether.h-functions.patch
e74a7569444467ca705241e36f68b389826e6159fbd492c2fef843bb8128babf  0003-add-legacy-scsi-scsi_ioctl.h-header.patch
ce53c311a2bbaedce42e5f5749f9ea63f801bf5fa65bb4d406202d9e75f4c3c0  0004-add-legacy-sys-ttydefaults.h-header.patch
1ed281c07ac15f505d017e2034208b4b626af6604f24e53667c25690865fcd54  0005-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
354d24787a00b1cd216c0505076cbbd612ed3f36804c596d969f0d628b425b9b  0006-fix-off-by-one-array-bound-in-strsignal.patch
2d640dbedb1674cf378b4caf53e32c1fb7b8b8bc302037f7328b87049479d763  0007-fix-invalid-library-phdr-pointers-passed-to-callback.patch
42cf78d84f6f03bfb5431a38f38b08ad752d466a63ec4197907d3ff2b6849ca7  0008-add-some-ARM-EABI-specific-exception-handling-infras.patch
d0c70b9806329d384752bf4d344176e5dea8a3facb0cfba9d5284d6281f52378  0009-add-PIE-support-for-ARM.patch
7efc54e1943db188bee5398e0d709778fca6578d44a73f215cd96f18a29a6d7b  0010-make-posix_spawn-and-functions-that-use-it-use-CLONE.patch
5427781da6c5877c017eeccba58c70bce3451536355ac949699ed807137a476a  getopt_long.c
d6996273f5aaaed429058257e4646b243d9e3a4d8609522f802762453f5be4cb  getent"
sha512sums="7ca852eda3be7b34bfdaf1eb9e7d435987d5177f865737b211e62f4037825cc322436e1ff49c3f875b3a20679f6f21ba5ffff271d03d3d03c7a97854f4f51832  musl-0.9.11.tar.gz
69d387f9617757cc0ac66f5c9716c8167408bb848b39011e716a388b451bf3d85fd7ea810970d2deaf42e9b77844f15decb358a78cc6ec6b403fdf0a31a4ca29  0001-fix-Makefile-so-make-install-works-before-include-bi.patch
00a457844f49c43276efecf27f47d3e028cde7648d347b80c63c9f0ebe21baabe875ae6741490885f0d95b37103b31df59f23863d3cc0219c289db05e0ccdcb2  0002-add-stubs-for-additional-legacy-ether.h-functions.patch
eeb67bec8c2f3c1ef83c8bd8f72825745515db1f86d3ccedd74fee2515b003bc34262504a0564f56014fdf9dff7b7b863d6fecd589e7df46f213c37ad24e7709  0003-add-legacy-scsi-scsi_ioctl.h-header.patch
9644c0b932efbdf66b44df6565e1d3594ddcbbff77bd29459d7ee19d55e0857bcd8f3e51fc8be3d20190e22476ad2e09f53e9298466d3853d12b7297f4065463  0004-add-legacy-sys-ttydefaults.h-header.patch
f2b148e91f7df417c4577d00760ae511200a0402075613941cbbfae778c21578f0a887fa20899334a7c69e5c6c3a54d8410af25c81275e7d42879c2cfd7c30c5  0005-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
e61e3483ac905b528afd421d1970e2e2f53f32cfadd4d6af6a6b00e73d861880c749234b8d1624e6048c59eb4f568ea47965bb3fb6f161ca55ab2d819403b9d6  0006-fix-off-by-one-array-bound-in-strsignal.patch
3198cd0b8ca0e587f108f7250f45f2f10d0b6202cc7fc4b58cf89e3780a38bfe856b6be312957e27de81b02adf7a20dcf7baa36c2f5f831729f88875224ccc7c  0007-fix-invalid-library-phdr-pointers-passed-to-callback.patch
915d0e7cdd56f369759ea314e54c29d57c012df1ff0d9459f1b0ac941320e5bf5de3e7215224075aead4b6d3a60b7e0dba7f28de75a6c477ae6bf6caf1b65d28  0008-add-some-ARM-EABI-specific-exception-handling-infras.patch
8eb9a822a6529e5dabafc17b6013fdbb7e3b744574df230e3565637c354fe06eeb3a4576f56ef2e2d798aeaac6d2a0968823351f0ee76e6f06114f740f5ae432  0009-add-PIE-support-for-ARM.patch
6897ed7bf575d085fda0c1270090bb44d26712c4f513ed98b4c988a3f31fc808e7fe4b760a46c329b5b3b20a20049410c0c3f0f51d780568427b3f1fc4b7df5b  0010-make-posix_spawn-and-functions-that-use-it-use-CLONE.patch
e5e945f26daae5498e2a2e463d4bb3724294bc5dd4bf9a93a0f18e333f277e18e5977e144642bf45185d25ffa167316fe9914c9885d491a0034b2f4cccb0d07f  getopt_long.c
4d92f934d760cf5157d80f19fd766be6b673c65317229b32ac824d9d192f6abcc414e2382b2416dfd5c2f757b46ced98c18e4762bf91f5a48647e0ee61813b06  getent"