Making a bunch of basic programs cross-buildable.
After this, the 'bootstrap-tools' can be cross-built. svn path=/nixpkgs/branches/stdenv-updates/; revision=20945
This commit is contained in:
parent
2d261d1c1e
commit
19b9811012
@ -10,6 +10,10 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
|
crossAttrs = {
|
||||||
|
compileFlags = [ "CC=${stdenv.cross.config}-gcc" ];
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "GNU ed, an implementation of the standard Unix editor";
|
description = "GNU ed, an implementation of the standard Unix editor";
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
{stdenv, fetchurl, perl, bison, mktemp, linuxHeaders}:
|
{stdenv, fetchurl, perl, bison, mktemp, linuxHeaders, linuxHeadersCross}:
|
||||||
|
|
||||||
assert stdenv.isLinux;
|
assert stdenv.isLinux;
|
||||||
|
|
||||||
let version = "1.5.15"; in
|
let
|
||||||
|
version = "1.5.15";
|
||||||
|
baseMakeFlags = ["V=1" "prefix=$out" "SHLIBDIR=$out/lib"];
|
||||||
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "klibc-${version}";
|
name = "klibc-${version}";
|
||||||
@ -12,15 +15,36 @@ stdenv.mkDerivation {
|
|||||||
sha256 = "1x401wmjca6zkyikf9xz45b3wb1hnj0m2s9in1sg6xdhi3pk8lwb";
|
sha256 = "1x401wmjca6zkyikf9xz45b3wb1hnj0m2s9in1sg6xdhi3pk8lwb";
|
||||||
};
|
};
|
||||||
|
|
||||||
makeFlags = ["V=1" "prefix=$out" "SHLIBDIR=$out/lib"];
|
makeFlags = baseMakeFlags;
|
||||||
|
|
||||||
|
inherit linuxHeaders;
|
||||||
|
|
||||||
|
crossAttrs = {
|
||||||
|
name = "klibc-1.5.17";
|
||||||
|
src = fetchurl {
|
||||||
|
url = "mirror://kernel/linux/libs/klibc/Testing/klibc-1.5.17.tar.bz2";
|
||||||
|
sha256 = "1jmiszf9pdlzj9f72nkv50d7aqrzz12hrmw792xnd2lmn5nrfyx6";
|
||||||
|
};
|
||||||
|
|
||||||
|
makeFlags = baseMakeFlags ++ [ "CROSS_COMPILE=${stdenv.cross.config}-"
|
||||||
|
"KLIBCARCH=${stdenv.cross.arch}" ];
|
||||||
|
|
||||||
|
patchPhase = ''
|
||||||
|
sed -i /KLIBCKERNELSRC/d scripts/Kbuild.install
|
||||||
|
'';
|
||||||
|
|
||||||
|
linuxHeaders = linuxHeadersCross;
|
||||||
|
};
|
||||||
|
|
||||||
|
# The AEABI option concerns only arm systems, and does not affect the build for
|
||||||
|
# other systems.
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
sed -i /CONFIG_AEABI/d defconfig
|
sed -i /CONFIG_AEABI/d defconfig
|
||||||
echo "CONFIG_AEABI=y" >> defconfig
|
echo "CONFIG_AEABI=y" >> defconfig
|
||||||
makeFlags=$(eval "echo $makeFlags")
|
makeFlags=$(eval "echo $makeFlags")
|
||||||
|
|
||||||
mkdir linux
|
mkdir linux
|
||||||
cp -prsd ${linuxHeaders}/include linux/
|
cp -prsd $linuxHeaders/include linux/
|
||||||
chmod -R u+w linux/include/
|
chmod -R u+w linux/include/
|
||||||
''; # */
|
''; # */
|
||||||
|
|
||||||
@ -32,5 +56,5 @@ stdenv.mkDerivation {
|
|||||||
cp usr/dash/sh $dir/
|
cp usr/dash/sh $dir/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [perl bison mktemp];
|
buildNativeInputs = [ perl bison mktemp ];
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,16 @@ stdenv.mkDerivation {
|
|||||||
sha256 = "08py2s9vw6dgw457lbklh1vsr3b8x8dlv7d8ygdfaxlx61l57gzp";
|
sha256 = "08py2s9vw6dgw457lbklh1vsr3b8x8dlv7d8ygdfaxlx61l57gzp";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
crossAttrs = {
|
||||||
|
patchPhase = ''
|
||||||
|
sed -i -e 's/CC=gcc/CC=${stdenv.cross.config}-gcc/' \
|
||||||
|
-e 's/AR=ar/AR=${stdenv.cross.config}-ar/' \
|
||||||
|
-e 's/RANLIB=ranlib/RANLIB=${stdenv.cross.config}-ranlib/' \
|
||||||
|
-e 's/bzip2recover test/bzip2recover/' \
|
||||||
|
Makefile*
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
sharedLibrary =
|
sharedLibrary =
|
||||||
!stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic;
|
!stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic;
|
||||||
|
|
||||||
|
@ -16,6 +16,10 @@ stdenv.mkDerivation rec {
|
|||||||
++ stdenv.lib.optional aclSupport acl.hostDrv
|
++ stdenv.lib.optional aclSupport acl.hostDrv
|
||||||
++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
|
++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
|
||||||
stdenv.gccCross.libc.libiconv.hostDrv;
|
stdenv.gccCross.libc.libiconv.hostDrv;
|
||||||
|
|
||||||
|
# Needed for fstatfs()
|
||||||
|
# I don't know why it is not properly detected cross building with glibc.
|
||||||
|
configureFlags = [ "fu_cv_sys_stat_statfs2_bsize=yes" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# The tests are known broken on Cygwin
|
# The tests are known broken on Cygwin
|
||||||
|
@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0f61phan4q8w5i1lz768q973c1spfqgvc470jc89rpg0gxfvi9bp";
|
sha256 = "0f61phan4q8w5i1lz768q973c1spfqgvc470jc89rpg0gxfvi9bp";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [coreutils];
|
buildNativeInputs = [coreutils];
|
||||||
|
|
||||||
patches = [ ./findutils-path.patch ./change_echo_path.patch ]
|
patches = [ ./findutils-path.patch ./change_echo_path.patch ]
|
||||||
# Note: the dietlibc patch is just to get findutils to compile.
|
# Note: the dietlibc patch is just to get findutils to compile.
|
||||||
@ -17,6 +17,11 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
|
crossAttrs = {
|
||||||
|
# http://osdir.com/ml/bug-findutils-gnu/2009-08/msg00026.html
|
||||||
|
configureFlags = [ "gl_cv_func_wcwidth_works=yes" ];
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://www.gnu.org/software/findutils/;
|
homepage = http://www.gnu.org/software/findutils/;
|
||||||
description = "GNU Find Utilities, the basic directory searching utilities of the GNU operating system";
|
description = "GNU Find Utilities, the basic directory searching utilities of the GNU operating system";
|
||||||
|
@ -9,7 +9,7 @@ stdenv.mkDerivation {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* If no explicit coreutils is given, use the one from stdenv. */
|
/* If no explicit coreutils is given, use the one from stdenv. */
|
||||||
buildInputs = [coreutils];
|
buildNativeInputs = [coreutils];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://www.gnu.org/software/diffutils/diffutils.html;
|
homepage = http://www.gnu.org/software/diffutils/diffutils.html;
|
||||||
|
@ -17,6 +17,10 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
buildInputs = (stdenv.lib.optional doCheck ed);
|
buildInputs = (stdenv.lib.optional doCheck ed);
|
||||||
|
|
||||||
|
crossAttrs = {
|
||||||
|
configureFlags = [ "ac_cv_func_strnlen_working=yes" ];
|
||||||
|
};
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -10,6 +10,10 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
makeFlags = ["TREE=\$(out)"];
|
makeFlags = ["TREE=\$(out)"];
|
||||||
|
|
||||||
|
crossAttrs = {
|
||||||
|
makeFlags = [ "TREE=\$(out)" "CC=${stdenv.cross.config}-gcc" ];
|
||||||
|
};
|
||||||
|
|
||||||
postInstall = "mv \$out/bin/replace \$out/bin/replace-literal";
|
postInstall = "mv \$out/bin/replace \$out/bin/replace-literal";
|
||||||
|
|
||||||
patches = [./malloc.patch];
|
patches = [./malloc.patch];
|
||||||
|
@ -6143,7 +6143,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
klibc = makeOverridable (import ../os-specific/linux/klibc) {
|
klibc = makeOverridable (import ../os-specific/linux/klibc) {
|
||||||
inherit fetchurl stdenv perl bison mktemp;
|
inherit fetchurl stdenv perl bison mktemp linuxHeadersCross;
|
||||||
linuxHeaders = glibc.kernelHeaders;
|
linuxHeaders = glibc.kernelHeaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user