void-packages/templates/glibc32/template
Juan RP 84222395b8 Provide some vars for use in template's targets.
These new vars are DESTDIR (by default XBPS_DESTDIR/pkgname-version),
SRCPKGDESTDIR (XBPS_DESTDIR/sourcepkg-version) and FILESDIR
(XBPS_TEMPLATESDIR/pkgname/files).

This simplifies packages that used them.

--HG--
extra : convert_revision : 287ea7128cb5df19870ca7aff0a3b8f99a11d63a
2009-03-11 06:31:56 +01:00

85 lines
2.9 KiB
Text

# 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 --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 package installs the 32 bit libraries for x86_64 systems."
# This package doesn't make sense on 32bit systems.
only_for_archs=x86_64
cross_compiler=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 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/usr/include/gnu/stubs-32.h $tmpdir/usr/include/gnu
mv -v $DESTDIR/usr/include/sys/elf.h $tmpdir/usr/include/sys
mv -v $DESTDIR/usr/include/sys/vm86.h $tmpdir/usr/include/sys
rm -rf $DESTDIR/usr/include
mkdir -p $DESTDIR/lib
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/usr/share $DESTDIR/usr/libexec $DESTDIR/etc
mv -v $DESTDIR/usr/lib/* $DESTDIR/usr/lib32/
rmdir $DESTDIR/usr/lib
cd $DESTDIR/lib && ln -s ../lib32/ld-linux.so.2 .
# Add /lib32 and /usr/lib32 into ld.so.conf.
echo "/lib32" >> $XBPS_MASTERDIR/etc/ld.so.conf
echo "/usr/lib32" >> $XBPS_MASTERDIR/etc/ld.so.conf
rm -rf $tmpdir
wrksrc=$XBPS_BUILDDIR/libc
}