vp-build/templates/glibc32.tmpl

84 lines
2.9 KiB
Cheetah
Raw Normal View History

# Template file for 'glibc32'
pkgname=glibc32
version=2.8
wrksrc="libc"
distfiles="ftp://ftp.archlinux.org/other/glibc/glibc-2.8_20080828.tar.bz2"
build_style=gnu_configure
configure_script="../configure"
configure_env="BUILD_CC=$XBPS_CROSS_TARGET-gcc"
configure_args="--with-tls -disable-profile --with-__thread
--enable-kernel=2.6.16 --enable-add-ons --without-gd --enable-bind-now
--without-cvs --without-selinux --prefix=/usr --libdir=/usr/lib32
--with-headers=/usr/include --cache-file=config.cache
--infodir=/usr/share/info"
make_install_target="install_root=$XBPS_DESTDIR/$pkgname-$version install"
short_desc="The GNU C library (32 bits)"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=f5756668f201e093cae0404e59dcf8c43ccc07757fd0a7455298ed89126c366a
long_desc="
The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system. It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.
This version is only for 64 bits systems."
# This package doesn't make sense on 32bit systems.
only_for_archs=x86_64
cross_compiler=yes
base_package=yes
build_depends="perl-5.10.0"
pre_configure()
{
# We must configure it in another directory.
mkdir -p $wrksrc/build_obj && cd $wrksrc/build_obj
wrksrc=$wrksrc/build_obj
echo "slibdir=/lib32" > $wrksrc/configparms
echo "CFLAGS+=-march=${XBPS_CROSS_TARGET%%-*} -mtune=generic" \
>> $wrksrc/configparms
echo "libc_cv_forced_unwind=yes" > config.cache
echo "libc_cv_c_cleanup=yes" >> config.cache
}
pre_install()
{
# Pre-create /lib32 and /usr/lib32 directories.
for f in lib32 usr/lib32; do
[ ! -d $XBPS_MASTERDIR/$f ] && mkdir -p $XBPS_MASTERDIR/$f
done
}
post_install()
{
local destdir=$XBPS_DESTDIR/$pkgname-$version
local tmpdir=$XBPS_BUILDDIR/$pkgname-tmp
mkdir -p $tmpdir/usr/include/gnu
mkdir -p $tmpdir/usr/include/sys
# Remove all headers except the ones required for 32bits stuff.
mv -v $destdir/include/gnu/stubs-32.h $tmpdir/usr/include/gnu
mv -v $destdir/include/sys/elf.h $tmpdir/usr/include/sys
mv -v $destdir/include/sys/vm86.h $tmpdir/usr/include/sys
rm -rf $destdir/include
mkdir -p $destdir/usr/include
mkdir -p $destdir/usr/lib32/gconv
mv -v $tmpdir/usr/include/* $destdir/usr/include
# Remove bins and unneeded stuff for compat32.
[ -d $destdir/xbps_destdir ] && rm -rf $destdir/xbps_destdir
rm -rf $destdir/sbin $destdir/bin $destdir/usr/sbin $destdir/usr/bin
rm -rf $destdir/share $destdir/libexec $destdir/etc
mv -v $destdir/lib/gconv/* $destdir/usr/lib32/gconv
# Remove wrong symlinks in shared libs and move them to /lib32.
find $destdir/lib -type l -print|xargs rm -v
mv -v $destdir/lib/* $destdir/lib32
cd $destdir/lib && ln -s ../lib32/ld-linux.so.2 ld-linux.so.2
rm -rf $tmpdir
}