summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6481ec1b23dfbbc2b1e59cfbde4d661322662fd4 (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
# Maintainer: C├ędric Schieli <cschieli at gmail dot com>
pkgname=klibc
pkgver=2.0.6
pkgrel=1
pkgdesc="A minimalistic libc subset for use with initramfs"
arch=(x86_64)
url="https://mirrors.kernel.org/pub/linux/libs/klibc/"
license=('GPL')
groups=()
depends=(perl)
makedepends=(linux-api-headers)
provides=()
conflicts=()
replaces=()
backup=()
options=('staticlibs')
install=
source=(
	"https://mirrors.kernel.org/pub/linux/libs/klibc/2.0/${pkgname}-${pkgver}.tar.xz"
	"fix_missing_include_in_sys_mman_h.patch::https://git.kernel.org/pub/scm/libs/klibc/klibc.git/patch/?id=d4853d030639cf3542ae39129c18b654d8d4f020"
)
noextract=()
md5sums=('d01e2f8fa8a616c8523787ea4c634e8b'
         '8d7744591b5ba254fe6d4ef324a5383e')

prepare() {
	cd "$pkgname-$pkgver"
	patch -p1 -i "$srcdir/fix_missing_include_in_sys_mman_h.patch"
	mkdir -p uapi/include
	ln -sf /usr/include/{asm,asm-generic,linux} uapi/include/
}

build() {
	cd "$pkgname-$pkgver"
	make KLIBCKERNELSRC=uapi
}

check() {
	cd "$pkgname-$pkgver"
	make -k KLIBCKERNELSRC=uapi test
}

package() {
	cd "$pkgname-$pkgver"
	mkdir -p "$pkgdir/usr/lib"
	ln -s "$pkgdir/usr/lib" "$pkgdir/lib"
	make KLIBCKERNELSRC=uapi INSTALLROOT="$pkgdir" mandir=/usr/share/man install
	rm -f "$pkgdir/lib"
}