Skip to content

Instantly share code, notes, and snippets.

Created August 23, 2013 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6317057 to your computer and use it in GitHub Desktop.
Save anonymous/6317057 to your computer and use it in GitHub Desktop.
Pkgfile
# Description: The C library used in the GNU system
# URL: http://www.gnu.org/software/libc/
# Maintainer: CRUX System Team, core-ports at crux dot nu
name=glibc-32
version=2.18
release=1
source=(http://ftp.gnu.org/gnu/glibc/glibc-$version.tar.xz \
http://crux.nu/files/distfiles/kernel-headers-3.4.11.tar.xz \
$name-2.18.0-multilib-dirs.patch \
hosts resolv.conf nsswitch.conf host.conf ld.so.conf \
lib32.conf \
glibc-resolv_assert.patch \
glibc-segfault_in_strncasecmp.patch \
glibc-strtod_integer_overflow.patch \
glibc-regexp_buffer_overrun.patch)
build() {
# install kernel headers
mkdir $PKG/usr/
cp -r kernel-headers-3.4.11/include $PKG/usr
chown root:root $PKG/usr
#patch -p1 -d glibc-$version -i $SRC/glibc-resolv_assert.patch
#patch -p1 -d glibc-$version -i $SRC/glibc-segfault_in_strncasecmp.patch
#patch -p1 -d glibc-$version -i $SRC/glibc-strtod_integer_overflow.patch
#patch -p1 -d glibc-$version -i $SRC/glibc-regexp_buffer_overrun.patch
patch -p1 -d glibc-$version -i $SRC/$name-2.18.0-multilib-dirs.patch
mkdir build
cd build
echo "slibdir=/usr/lib32" >> configparms
CC="${CC:-gcc} -m32" ../glibc-$version/configure --prefix=/usr \
--libdir=/usr/lib32 \
--libexecdir=/usr/lib32 \
--with-headers=$PKG/usr/include \
--enable-kernel=2.6.27 \
--enable-add-ons \
--disable-profile \
--without-gd \
--enable-obsolete-rpc \
--enable-multi-arch i686-pc-linux-gnu
make
#make check
make install_root=$PKG install
# keep one 32 bit specific header file
find $PKG/usr/include -type f -not -name stubs-32.h -delete
find $PKG/usr/include -type d -empty -delete
rm -r $PKG/usr/{bin,sbin,share} $PKG/{etc,sbin} $PKG/var
install -m 0644 -D $SRC/lib32.conf $PKG/etc/ld.so.conf.d/lib32.conf
ln -s ../lib/locale $PKG/usr/lib32/locale
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment