diff options
author | Domen Kožar <domen@dev.si> | 2016-03-27 13:19:04 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2016-03-27 13:19:04 +0100 |
commit | b07e7bfc7bc8f0b5428acaab026738866af32a28 (patch) | |
tree | 88dfca9473373d72d3d0e60a84ced34f33d69bf4 /pkgs/stdenv/linux/make-bootstrap-tools.nix | |
parent | d88ae1045d37f8cd1b3428617670f7358eb45a29 (diff) | |
parent | dae3a7b721aeaaffabf336563182852c800a5ae0 (diff) |
Merge remote-tracking branch 'origin/staging'
Diffstat (limited to 'pkgs/stdenv/linux/make-bootstrap-tools.nix')
-rw-r--r-- | pkgs/stdenv/linux/make-bootstrap-tools.nix | 57 |
1 files changed, 51 insertions, 6 deletions
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 75dc009f5e67..68456942d40f 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -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 + ''; + }; } |