diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2004-03-08 16:02:46 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2004-03-08 16:02:46 +0000 |
commit | ce50734cf067496ae50d1a6fd139fc03de283cbc (patch) | |
tree | 8603be7a557177d8646093c4edf7bdb097577b11 /pkgs/test | |
parent | 1b8e9faf08d2bb5fe83464d8380dabc52982f935 (diff) |
* Started reorganising stdenv:
- gcc/ld-wrappers have been factored out into a separate
derivation. This allows a working gcc to be installed in the user
environment. (Previously the Nix gcc didn't work because it
needed a whole bunch of flags to point to glibc.)
- Better modularity: packages can specify hooks into the setup
scripts. For instance, setup no longer knows about the
PKG_CONFIG_PATH variable; pkgconfig can set it up instead.
- gcc not longer depends on binutils. This simplifies the bootstrap
process.
svn path=/nixpkgs/trunk/; revision=816
Diffstat (limited to 'pkgs/test')
-rwxr-xr-x | pkgs/test/simple/builder.sh | 41 | ||||
-rw-r--r-- | pkgs/test/simple/default.nix | 18 |
2 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/test/simple/builder.sh b/pkgs/test/simple/builder.sh new file mode 100755 index 000000000000..c155bdc36155 --- /dev/null +++ b/pkgs/test/simple/builder.sh @@ -0,0 +1,41 @@ +#! /bin/sh + +export NIX_DEBUG=1 + +. $stdenv/setup + +export NIX_CFLAGS_COMPILE="-v $NIX_CFLAGS_COMPILE" + +mkdir $out +mkdir $out/bin + +cat > hello.c <<EOF +#include <stdio.h> + +int main(int argc, char * * argv) +{ + printf("Hello World!\n"); + return 0; +} +EOF + +gcc hello.c -o $out/bin/hello + +$out/bin/hello + +cat > hello2.cc <<EOF +#include <iostream> + +int main(int argc, char * * argv) +{ + std::cout << "Hello World!\n"; + std::cout << VALUE << std::endl; + return 0; +} +EOF + +g++ hello2.cc -o $out/bin/hello2 -DVALUE="1 + 2 * 3" + +$out/bin/hello2 + +ld -v
\ No newline at end of file diff --git a/pkgs/test/simple/default.nix b/pkgs/test/simple/default.nix new file mode 100644 index 000000000000..2d582f03a511 --- /dev/null +++ b/pkgs/test/simple/default.nix @@ -0,0 +1,18 @@ +let { + system = "i686-linux"; + + stdenvInitial = (import ../../stdenv/initial) { + name = "stdenv-initial"; + inherit system; + }; + + stdenv = (import ../../stdenv/native) {stdenv = stdenvInitial;}; + + test = derivation { + name = "simple-test"; + inherit system stdenv; + builder = ./builder.sh; + }; + + body = test; +} |