nixpkgs/pkgs/test/simple/builder.sh
Eelco Dolstra 12ae5363ea * Remove trivial builders.
* Make builders unexecutable by removing the hash-bang line and
  execute permission.
* Convert calls to `derivation' to `mkDerivation'.
* Remove `system' and `stdenv' attributes from calls to
  `mkDerivation'.  These transformations were all done automatically,
  so it is quite possible I broke stuff.
* Put the `mkDerivation' function in stdenv/generic.

svn path=/nixpkgs/trunk/; revision=874
2004-03-29 17:23:01 +00:00

42 lines
661 B
Bash

set -x
export NIX_DEBUG=1
. $stdenv/setup
export NIX_ENFORCE_PURITY=1
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 -I/nix/store/foo -I /nix/store/foo -I/usr/lib -I /usr/lib hello.c -o $out/bin/hello
gcc -I`pwd` -L /nix/store/abcd/lib -isystem /usr/lib 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