summaryrefslogtreecommitdiffstats
path: root/pkgs/stdenv/linux/make-bootstrap-tools.nix
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-04-01 10:06:01 +0200
committerVladimír Čunát <vcunat@gmail.com>2016-04-01 10:06:01 +0200
commitab15a62c68bf7bf3b02e3bab00d121cc1426733c (patch)
tree398a82403b04bfa0bae8cadf1c5a64cf83145965 /pkgs/stdenv/linux/make-bootstrap-tools.nix
parentc643ccaa8c91f78b8c89eb87589886b8906d5b38 (diff)
parenta26357eefe017964448b5bb464163646b927a267 (diff)
Merge branch 'master' into closure-size
Beware that stdenv doesn't build. It seems something more will be needed than just resolution of merge conflicts.
Diffstat (limited to 'pkgs/stdenv/linux/make-bootstrap-tools.nix')
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools.nix59
1 files changed, 52 insertions, 7 deletions
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix
index 763fea6f84bd..118eef57ffe3 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix
@@ -1,6 +1,6 @@
{ system ? builtins.currentSystem }:
-with import ../../top-level/all-packages.nix {inherit system;};
+with import ../../.. {inherit system;};
rec {
@@ -164,12 +164,57 @@ rec {
'';
};
- test = ((import ./default.nix) {
+ bootstrapFiles = {
+ busybox = "${build}/on-server/busybox";
+ bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz";
+ };
+
+ bootstrapTools = (import ./default.nix {
+ inherit system bootstrapFiles;
+ }).bootstrapTools;
+
+ test = derivation {
+ name = "test-bootstrap-tools";
inherit system;
+ builder = bootstrapFiles.busybox;
+ args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ];
- customBootstrapFiles = {
- busybox = "${build}/on-server/busybox";
- bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz";
- };
- }).testBootstrapTools;
+ buildCommand = ''
+ export PATH=${bootstrapTools}/bin
+
+ ls -l
+ mkdir $out
+ mkdir $out/bin
+ sed --version
+ find --version
+ diff --version
+ patch --version
+ make --version
+ awk --version
+ grep --version
+ gcc --version
+
+ ldlinux=$(echo ${bootstrapTools}/lib/ld-linux*.so.?)
+ export CPP="cpp -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools}"
+ export CC="gcc -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
+ export CXX="g++ -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
+
+ echo '#include <stdio.h>' >> foo.c
+ echo '#include <limits.h>' >> foo.c
+ echo 'int main() { printf("Hello World\\n"); return 0; }' >> foo.c
+ $CC -o $out/bin/foo foo.c
+ $out/bin/foo
+
+ echo '#include <iostream>' >> bar.cc
+ echo 'int main() { std::cout << "Hello World\\n"; }' >> bar.cc
+ $CXX -v -o $out/bin/bar bar.cc
+ $out/bin/bar
+
+ tar xvf ${hello.src}
+ cd hello-*
+ ./configure --prefix=$out
+ make
+ make install
+ '';
+ };
}