mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 00:54:11 +00:00
b48cc44ebf
* klibc: build against the regular kernel headers instead of depending on a kernel build. This way we don't have to rebuild klibc every time the kernel changes. * splashutils 1.3: compile properly with a klibc that uses unpatched kernel headers. svn path=/nixpkgs/trunk/; revision=13900
35 lines
809 B
Nix
35 lines
809 B
Nix
{stdenv, fetchurl, perl, bison, mktemp, kernelHeaders}:
|
|
|
|
assert stdenv.isLinux;
|
|
|
|
let version = "1.5"; in
|
|
|
|
stdenv.mkDerivation {
|
|
name = "klibc-${version}";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://kernel/linux/libs/klibc/klibc-${version}.tar.bz2";
|
|
sha256 = "1izhf8kscjymsvsvhcqw9awnmp94vwv70zdj09srg9bkpjj0n017";
|
|
};
|
|
|
|
makeFlags = ["V=1" "prefix=$out" "SHLIBDIR=$out/lib"];
|
|
|
|
preBuild = ''
|
|
makeFlags=$(eval "echo $makeFlags")
|
|
|
|
mkdir linux
|
|
cp -prsd ${kernelHeaders}/include linux/
|
|
chmod -R u+w linux/include/
|
|
''; # */
|
|
|
|
# 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/
|
|
'';
|
|
|
|
buildInputs = [perl bison mktemp];
|
|
}
|