aboutsummaryrefslogblamecommitdiffstats
path: root/main/libc0.9.32/APKBUILD
blob: c55cbe1851333dd167236d8dbd318aea231d7b98 (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                                                   


                     
        


                                                         
          
        
                           
                                                            
                                   

               



                        

                                                               
                                                          
                                
                                                   

               
                                                   
                        
                           


                         
                                       
                                  


                                       
                      
                                            
                                            

                                   
                                 
                                               
                
                                                     








                                                   






                                                             













                                                                
                                
                                                               


                                                                
                            

                                                               







                                                                                  
                                                                    
                                   
                                               




                       
                                      










                                                       





                                                        
                                                                    
                                                          
                                                                             

                                         
                                                                             
                                                  
                                                     
                                                    
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_abiver=0.9.32
pkgname=libc$_abiver
_gitver=
pkgver=${_abiver}_rc1
_ver=${pkgver/_/-}
pkgrel=0
pkgdesc="C library for developing embedded Linux systems"
url=http://uclibc.org
license="LGPL-2"
arch="all"
options=
makedepends="linux-headers"
subpackages="uclibc-dev:dev uclibc-utils:utils libthread_db"
depends_dev="linux-headers=>2.6.32"
replaces=uclibc

if [ -n "$DEBUG" ]; then
	options="!strip"
fi

_snapurl="http://git.uclibc.org/uClibc/snapshot/master.tar.bz2"
_snapfile="$pkgname-$pkgver.tar.bz2"
source="http://uclibc.org/downloads/uClibc-${_ver}.tar.bz2
	compat-stack-guard.patch
	ldso-x86_64-support-protected-symbols.patch
	1.patch
	2.patch
	0001-libm-x86_64-implement-fesetround.patch
	uclibcconfig.x86
	uclibcconfig.x86_64
	uclibcconfig.i486
	"

_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 silentoldconfig
	make -j1 pregen KERNEL_HEADERS="$SYSROOT"/usr/include \
		CROSS="$CROSS" || return 1
	make all KERNEL_HEADERS="$SYSROOT/usr/include"  CROSS="$CROSS" || return 1
	make utils CROSS="$CROSS" || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" KERNEL_HEADERS="$SYSROOT/usr/include" \
		CROSS="$CROSS" install install_utils
	install -Dm755 extra/scripts/getent "$pkgdir"/usr/bin/getent
	# provided by linux-headers
	rm -f "$pkgdir"/usr/include/scsi/scsi.h
}

dev() {
	default_dev
	replaces=uclibc
	mkdir -p "$subpkgdir"/usr/lib 
	mv "$pkgdir"/usr/lib/*.so "$subpkgdir"/usr/lib/
}

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

md5sums="ec2ec3e187bd68327ee94c31846d275a  uClibc-0.9.32-rc1.tar.bz2
4d408f72142ce55a0754948cc9cfe447  compat-stack-guard.patch
84a2786fb4c89bee56607dd09b538d7b  ldso-x86_64-support-protected-symbols.patch
8f55efc31c41bf70d99006a7d2f7fe1e  1.patch
350a608e3d3b148af882f6e074225465  2.patch
e0c901502602f7e9e002d910d0f32ab9  0001-libm-x86_64-implement-fesetround.patch
145aaeb1833159397cfac9902e3877ab  uclibcconfig.x86
cb1bcf2ff83029b6943d4799d926932b  uclibcconfig.x86_64
145aaeb1833159397cfac9902e3877ab  uclibcconfig.i486"