2009-01-29 18:44:37 +03:00
|
|
|
{stdenv, fetchurl, perl, bison, mktemp, kernelHeaders}:
|
2005-08-28 00:48:05 +04:00
|
|
|
|
2006-11-25 03:28:15 +03:00
|
|
|
assert stdenv.isLinux;
|
2005-08-28 00:48:05 +04:00
|
|
|
|
2009-06-22 18:14:58 +04:00
|
|
|
let version = "1.5.15"; in
|
2009-01-29 18:44:37 +03:00
|
|
|
|
2005-08-28 00:48:05 +04:00
|
|
|
stdenv.mkDerivation {
|
2008-08-09 12:40:37 +04:00
|
|
|
name = "klibc-${version}";
|
2009-01-29 18:44:37 +03:00
|
|
|
|
|
|
|
src = fetchurl {
|
2009-06-22 18:14:58 +04:00
|
|
|
url = "mirror://kernel/linux/libs/klibc/Testing/klibc-${version}.tar.bz2";
|
|
|
|
sha256 = "1x401wmjca6zkyikf9xz45b3wb1hnj0m2s9in1sg6xdhi3pk8lwb";
|
2009-01-29 18:44:37 +03:00
|
|
|
};
|
|
|
|
|
2008-11-02 18:53:55 +03:00
|
|
|
makeFlags = ["V=1" "prefix=$out" "SHLIBDIR=$out/lib"];
|
2009-01-29 18:44:37 +03:00
|
|
|
|
2008-11-02 18:53:55 +03:00
|
|
|
preBuild = ''
|
|
|
|
makeFlags=$(eval "echo $makeFlags")
|
|
|
|
|
2009-01-29 18:44:37 +03:00
|
|
|
mkdir linux
|
|
|
|
cp -prsd ${kernelHeaders}/include linux/
|
2008-11-02 18:53:55 +03:00
|
|
|
chmod -R u+w linux/include/
|
2009-01-29 18:44:37 +03: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-26 00:49:42 +03:00
|
|
|
buildInputs = [perl bison mktemp];
|
2005-08-28 00:48:05 +04:00
|
|
|
}
|