mirror of
https://github.com/void-linux/void-packages.git
synced 2025-04-16 06:07:00 +02:00
New package: klibc-2.0.10
This commit is contained in:
parent
ad8a416da9
commit
d6e0069be4
4 changed files with 149 additions and 0 deletions
1
srcpkgs/klibc-devel
Symbolic link
1
srcpkgs/klibc-devel
Symbolic link
|
@ -0,0 +1 @@
|
|||
klibc
|
|
@ -0,0 +1,19 @@
|
|||
From: Ben Hutchings <benh@debian.org>
|
||||
Date: Fri, 31 Dec 2021 14:59:23 +0100
|
||||
Subject: [klibc] Kbuild: Include provided KCFLAGS in KLIBCCFLAGS
|
||||
|
||||
If KCFLAGS is provided through the environment or make variables, use
|
||||
it in addition to all the options we need.
|
||||
|
||||
---
|
||||
--- a/scripts/Kbuild.klibc
|
||||
+++ b/scripts/Kbuild.klibc
|
||||
@@ -78,7 +78,7 @@ KLIBCOPTFLAGS :=
|
||||
KLIBCSHAREDFLAGS :=
|
||||
KLIBCBITSIZE :=
|
||||
KLIBCLDFLAGS :=
|
||||
-KLIBCCFLAGS :=
|
||||
+KLIBCCFLAGS := $(KCFLAGS)
|
||||
|
||||
# Defaults for arch to override
|
||||
KLIBCARCHINCFLAGS =
|
10
srcpkgs/klibc/patches/sysinfo.patch
Normal file
10
srcpkgs/klibc/patches/sysinfo.patch
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- a/usr/include/sys/sysinfo.h
|
||||
+++ b/usr/include/sys/sysinfo.h
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <linux/kernel.h>
|
||||
+#include <linux/sysinfo.h>
|
||||
|
||||
extern int sysinfo(struct sysinfo *info);
|
||||
|
119
srcpkgs/klibc/template
Normal file
119
srcpkgs/klibc/template
Normal file
|
@ -0,0 +1,119 @@
|
|||
# Template file for 'klibc'
|
||||
pkgname=klibc
|
||||
version=2.0.11
|
||||
revision=1
|
||||
hostmakedepends="perl"
|
||||
makedepends="kernel-libc-headers"
|
||||
short_desc="Minimal libc subset for use with initramfs"
|
||||
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
|
||||
license="GPL-2.0-only"
|
||||
homepage="https://git.kernel.org/pub/scm/libs/klibc/klibc.git/"
|
||||
distfiles="https://git.kernel.org/pub/scm/libs/klibc/klibc.git/snapshot/klibc-${version}.tar.gz"
|
||||
checksum=bb9c40fb9b20335fbdc44904d7c579d43e39cb0b59252e1a56ce67194fb38541
|
||||
|
||||
_make() {
|
||||
local _arch _mkflags=
|
||||
|
||||
KCFLAGS="-g -ffile-prefix-map=$wrksrc=."
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
i686*) _arch=i386 ;;
|
||||
x86_64*) _arch=x86_64 ;;
|
||||
arm*)
|
||||
_arch=arm
|
||||
_mkflags+=" CONFIG_AEABI=y"
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
armv5*) _mkflags+=" CPU_ARCH=armv5te" ;;
|
||||
armv6*) _mkflags+=" CPU_ARCH=armv6" ;;
|
||||
armv7*) _mkflags+=" CPU_ARCH=armv7-a" ;;
|
||||
esac
|
||||
;;
|
||||
aarch64*) _arch=arm64 ;;
|
||||
ppc64*) _arch=ppc64 ;;
|
||||
ppc*) _arch=ppc ;;
|
||||
mips*64*) _arch=mips64 ;;
|
||||
mips*) _arch=mips ;;
|
||||
*) msg_error "not supported" ;;
|
||||
esac
|
||||
PATH=/usr/bin
|
||||
make ARCH=$_arch INSTALLROOT="$DESTDIR" V=1 \
|
||||
${CROSS_BUILD:+CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-} \
|
||||
$_mkflags \
|
||||
KCFLAGS="${KCFLAGS}" \
|
||||
HOSTCC="${CC_FOR_BUILD}" \
|
||||
CONFIG_DEBUG_INFO=y \
|
||||
KLIBC_SRC="$wrksrc/usr/klibc" \
|
||||
mandir='$(prefix)/share/man' \
|
||||
SHLIBDIR=/usr/lib \
|
||||
"$@"
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
local _f
|
||||
rm -rf linux
|
||||
mkdir -p linux/include
|
||||
for _f in asm asm-generic linux; do
|
||||
ln -s "${XBPS_CROSS_BASE}/usr/include/$_f" linux/include/
|
||||
done
|
||||
}
|
||||
|
||||
_gen_native_klcc() {
|
||||
mv klcc/klcc klcc/${XBPS_CROSS_TRIPLET}-klcc
|
||||
sed "s/${XBPS_CROSS_TRIPLET}-//" \
|
||||
klcc/klibc.config >klcc/native-klibc.config
|
||||
PATH=/usr/bin
|
||||
perl klcc/makeklcc.pl klcc/klcc.in klcc/native-klibc.config \
|
||||
/usr/bin/perl >klcc/klcc
|
||||
chmod +x klcc/klcc
|
||||
}
|
||||
|
||||
_gen_cross_klcc() {
|
||||
local _triplet _f
|
||||
_triplet=${XBPS_TRIPLET/unknown-/}
|
||||
sed -E "/^(CROSS|CC|LD|STRIP)=/s/=/=${_triplet}-/" \
|
||||
klcc/klibc.config >klcc/cross-klibc.config
|
||||
mkdir -p /tmp/bin
|
||||
for _f in gcc ld strip; do
|
||||
ln -sf /usr/bin/$_f /tmp/bin/${_triplet}-$_f
|
||||
done
|
||||
PATH=/usr/bin:/tmp/bin
|
||||
perl klcc/makeklcc.pl klcc/klcc.in klcc/cross-klibc.config \
|
||||
/usr/bin/perl >"klcc/${_triplet}-klcc"
|
||||
|
||||
sed -iE "/^(CC|LD|STRIP)=/s/tmp/usr/" "klcc/${_triplet}-klcc"
|
||||
chmod +x "klcc/${_triplet}-klcc"
|
||||
}
|
||||
|
||||
do_build() {
|
||||
_make all
|
||||
! grep ccache klcc/klcc
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
_gen_native_klcc
|
||||
else
|
||||
_gen_cross_klcc
|
||||
fi
|
||||
}
|
||||
|
||||
do_install() {
|
||||
local _f
|
||||
_make install DESTDIR="${DESTDIR}"
|
||||
for _f in asm asm-generic linux; do
|
||||
rm -rf "$DESTDIR/usr/lib/klibc/include/$_f"
|
||||
ln -s "/usr/include/$_f" "$DESTDIR/usr/lib/klibc/include/"
|
||||
done
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
vbin klcc/${XBPS_CROSS_TRIPLET}-klcc
|
||||
else
|
||||
vbin klcc/${XBPS_TRIPLET/unknown-/}-klcc
|
||||
fi
|
||||
}
|
||||
|
||||
klibc-devel_package() {
|
||||
short_desc+=" - development files"
|
||||
depends="perl kernel-libc-headers ${sourcepkg}>=${version}_${revision}
|
||||
${sourcepkg}<${version}_999"
|
||||
pkg_install() {
|
||||
vmove usr/bin
|
||||
vmove usr/share/man/man1
|
||||
vmove usr/lib/klibc/include
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue