aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/APKBUILD
blob: 1a68391b102a8188b26303a27d45709e0082f9dc (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
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=musl
pkgver=0.9.11
pkgrel=2
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

	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
aad8311afd9731c4fc0b233b2f8fbea6  0001-fix-Makefile-so-make-install-works-before-include-bi.patch
784768d2852b9e92331b0e4a113885f0  0002-add-stubs-for-additional-legacy-ether.h-functions.patch
68972594ee10388b927c4dab8752ff40  0003-add-legacy-scsi-scsi_ioctl.h-header.patch
be8d8679592120ac58d8e8cd65955858  0004-add-legacy-sys-ttydefaults.h-header.patch
7e34c5d8e8b2561a5c208f45914f5098  0005-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
dc3391e1c71f054457a94e96b5c439da  0006-fix-off-by-one-array-bound-in-strsignal.patch
2a34be5410b4b6f849ac65886fe512c0  0007-fix-invalid-library-phdr-pointers-passed-to-callback.patch
254ac95d521dd908739f2d9e361b9129  0008-add-some-ARM-EABI-specific-exception-handling-infras.patch
1eb1f8e1574a70bc39cc66aad536236b  0009-add-PIE-support-for-ARM.patch
acbb8a052228d9d5b89bc2ed55616fe3  getopt_long.c
ef81489a6258501cf45db58dfc6d5211  getent"
sha256sums="8b81fd9b71becb7b674ea93fd65d82a039fab79ab738957a5e9ee47ba08a13fd  musl-0.9.11.tar.gz
55e07c49e420af16ee2783613b43cb2673b9f4006ede03d202faf53bd103a1c1  0001-fix-Makefile-so-make-install-works-before-include-bi.patch
76b9e2f477ac9c536293f0b7e48d87fdc267e87bda8990c406af8e5314bdc93b  0002-add-stubs-for-additional-legacy-ether.h-functions.patch
f0c51e603f9b45fbcf0a2a372a9867cda5d6a561367b6320dc9f221ac1d9f5d0  0003-add-legacy-scsi-scsi_ioctl.h-header.patch
ac580e372f3f35ecbf56ad4a2a245a2f6717be2ddf545169d89b2c7a8c471996  0004-add-legacy-sys-ttydefaults.h-header.patch
ebbb392854f4ff0bcf5687611c9d0793ebbcbd65824de1a8b861c6f35eeaa1ed  0005-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
05b367fa68f444ab4722bddde88f01973fb850f696320a2a115626a5bff094d3  0006-fix-off-by-one-array-bound-in-strsignal.patch
a3de225c2b0e325333ecdfdf015ece988e8f0533f3056cfcd0b855680d7c2264  0007-fix-invalid-library-phdr-pointers-passed-to-callback.patch
d5af7765f2ec1f92f42d6d9d94fd1a1fefa876760141a4701a57db1d5d71e21a  0008-add-some-ARM-EABI-specific-exception-handling-infras.patch
25034a597d18f04fc371c97bc7ab014ff3ec2d185cfb3abc7d3bbcbc63fde3fc  0009-add-PIE-support-for-ARM.patch
5427781da6c5877c017eeccba58c70bce3451536355ac949699ed807137a476a  getopt_long.c
d6996273f5aaaed429058257e4646b243d9e3a4d8609522f802762453f5be4cb  getent"
sha512sums="7ca852eda3be7b34bfdaf1eb9e7d435987d5177f865737b211e62f4037825cc322436e1ff49c3f875b3a20679f6f21ba5ffff271d03d3d03c7a97854f4f51832  musl-0.9.11.tar.gz
02eee7261d28d2cac59910839dfc7b9389bec8bee3f68dc21a0b1d4fd112ffddaae8aadf4392528773dc0c5a48715cdc525a2ba3a51ac5f34fb49e9ceb49e644  0001-fix-Makefile-so-make-install-works-before-include-bi.patch
4b71a25a539ee35a0183503ba28583a38fb96dffa38de63ff8ba0e62893f84e1832e22aca506e1d79e41e2b37c712acf38f479c6b46d5e3237c8158db2352b36  0002-add-stubs-for-additional-legacy-ether.h-functions.patch
b4b3724b754ad3cf56ffbfe9bdd4cafbebb14e1d16a094793a0bf2e219f29e0a7547e123664bd1d7ffa3149f4a52be387e391b5903f967a2f57fbb3161b4fdaf  0003-add-legacy-scsi-scsi_ioctl.h-header.patch
cab60cb2baf86128fd5d45d83ae0315afefce9e1d91b7c5fa3fffc02b1483f753eedae01f226fe339d693de44236292e7b79e3abcc25e823f955aab83889c629  0004-add-legacy-sys-ttydefaults.h-header.patch
e9cd8c3994a22f48288279b2678e24415ab29a8f462df087de63b7415581059d6bd412d17b7d7008cd97ac09276f514fc4bd6cd4e39ee2fd4d7c8591e8478f4c  0005-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
20e91a56000ac53bf5d5db8e1f731a2f80824ee6e4a057d64e193601f3d45b1e3dbd836de82cf4c8d855eedb88e9a61f48c30b2b772840bdbd5c004c71cb0deb  0006-fix-off-by-one-array-bound-in-strsignal.patch
a70092efce1fbd02fd8c82bef5bb4c51c98f8023a5fdd7ec3c64519ceb98b72745b375d002c85c29d1adef09ac06bc433505f358e8c3516828291b3f8503626d  0007-fix-invalid-library-phdr-pointers-passed-to-callback.patch
20dd237aa8e9eda29fac0b443abe3ebb45692221425c31f4453d2f9a5394687d5befac00a755bf098b0ac3707ee8c5a52ebf78cc11c5d719f567afb626ddc2dd  0008-add-some-ARM-EABI-specific-exception-handling-infras.patch
b739639e90c8d6c985732dee44e2eadf12195876e60f64437a147fbbd5c758d84fb5078ef0c48ccb560d2c8f0b849e3e4670a2f1cd7f15c075b7b8a95563e2c8  0009-add-PIE-support-for-ARM.patch
e5e945f26daae5498e2a2e463d4bb3724294bc5dd4bf9a93a0f18e333f277e18e5977e144642bf45185d25ffa167316fe9914c9885d491a0034b2f4cccb0d07f  getopt_long.c
4d92f934d760cf5157d80f19fd766be6b673c65317229b32ac824d9d192f6abcc414e2382b2416dfd5c2f757b46ced98c18e4762bf91f5a48647e0ee61813b06  getent"