4 foo = stdenv.mkDerivation {
10 mkdir -p $out/bin $out/include $out/lib
11 $CC -o $out/bin/foo ${./cc-main.c}
13 cp ${./foo.c} $out/include/foo.h
15 ${lib.optionalString stdenv.hostPlatform.isDarwin "-Wl,-install_name,$out/lib/libfoo.dylib"} \
16 -o $out/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \
21 bar = stdenv.mkDerivation {
31 mkdir -p $out/bin $dev/include $dev/lib
32 $CC -o $out/bin/bar ${./cc-main.c}
34 cp ${./bar.c} $dev/include/bar.h
36 ${lib.optionalString stdenv.hostPlatform.isDarwin "-Wl,-install_name,$dev/lib/libbar.dylib"} \
37 -o $dev/lib/libbar${stdenv.hostPlatform.extensions.sharedLibrary} \
44 name = "stdenv-inputs-test";
45 phases = [ "buildPhase" ];
55 printf "checking whether binaries are available... " >&2
58 printf "checking whether compiler can find headers... " >&2
59 $CC -o include-check ${./include-main.c}
62 printf "checking whether compiler can find headers... " >&2
63 $CC -o include-check ${./include-main.c}
66 printf "checking whether compiler can find libraries... " >&2
67 $CC -lfoo -lbar -o lib-check ${./lib-main.c}
73 meta.platforms = lib.platforms.all;