2009-12-21 15:04:45 +01:00
|
|
|
{stdenv, fetchurl, perl, bison, mktemp, linuxHeaders}:
|
2005-08-27 22:48:05 +02:00
|
|
|
|
2006-11-25 01:28:15 +01:00
|
|
|
assert stdenv.isLinux;
|
2005-08-27 22:48:05 +02:00
|
|
|
|
2009-06-22 16:14:58 +02:00
|
|
|
let version = "1.5.15"; in
|
2009-01-29 16:44:37 +01:00
|
|
|
|
2005-08-27 22:48:05 +02:00
|
|
|
stdenv.mkDerivation {
|
2008-08-09 10:40:37 +02:00
|
|
|
name = "klibc-${version}";
|
2009-01-29 16:44:37 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2010-06-01 14:13:59 +02:00
|
|
|
url = "mirror://kernel/linux/libs/klibc/klibc-${version}.tar.bz2";
|
2009-06-22 16:14:58 +02:00
|
|
|
sha256 = "1x401wmjca6zkyikf9xz45b3wb1hnj0m2s9in1sg6xdhi3pk8lwb";
|
2009-01-29 16:44:37 +01:00
|
|
|
};
|
|
|
|
|
2008-11-02 16:53:55 +01:00
|
|
|
makeFlags = ["V=1" "prefix=$out" "SHLIBDIR=$out/lib"];
|
2009-01-29 16:44:37 +01:00
|
|
|
|
2008-11-02 16:53:55 +01:00
|
|
|
preBuild = ''
|
2009-11-08 01:32:12 +01:00
|
|
|
sed -i /CONFIG_AEABI/d defconfig
|
|
|
|
echo "CONFIG_AEABI=y" >> defconfig
|
2008-11-02 16:53:55 +01:00
|
|
|
makeFlags=$(eval "echo $makeFlags")
|
|
|
|
|
2009-01-29 16:44:37 +01:00
|
|
|
mkdir linux
|
2009-12-21 15:04:45 +01:00
|
|
|
cp -prsd ${linuxHeaders}/include linux/
|
2008-11-02 16:53:55 +01:00
|
|
|
chmod -R u+w linux/include/
|
2009-01-29 16:44:37 +01:00
|
|
|
''; # */
|
|
|
|
|
|
|
|
# Install static binaries as well.
|
|
|
|
postInstall = ''
|
|
|
|
dir=$out/lib/klibc/bin.static
|
|
|
|
mkdir $dir
|
|
|
|
cp $(find $(find . -name static) -type f ! -name "*.g" -a ! -name ".*") $dir/
|
|
|
|
cp usr/dash/sh $dir/
|
|
|
|
'';
|
|
|
|
|
2006-11-25 22:49:42 +01:00
|
|
|
buildInputs = [perl bison mktemp];
|
2005-08-27 22:48:05 +02:00
|
|
|
}
|