biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / test / simple / builder.sh
blob0b09a109beadbbf57f0ab320e126b94f1a40b771
1 if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi
2 set -x
4 export NIX_DEBUG=1
6 source $stdenv/setup
8 export NIX_ENFORCE_PURITY=1
10 mkdir $out
11 mkdir $out/bin
13 cat > hello.c <<EOF
14 #include <stdio.h>
16 int main(int argc, char * * argv)
18 printf("Hello World!\n");
19 return 0;
21 EOF
23 #gcc -I/nix/store/foo -I /nix/store/foo -I/usr/lib -I /usr/lib hello.c -o $out/bin/hello
24 gcc -I`pwd` -L /nix/store/abcd/lib -isystem /usr/lib hello.c -o $out/bin/hello
26 $out/bin/hello
28 cat > hello2.cc <<EOF
29 #include <iostream>
31 int main(int argc, char * * argv)
33 std::cout << "Hello World!\n";
34 std::cout << VALUE << std::endl;
35 return 0;
37 EOF
39 g++ hello2.cc -o $out/bin/hello2 -DVALUE="1 + 2 * 3"
41 $out/bin/hello2
43 ld -v