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.isDarwin "-Wl,-install_name,$out/lib/libfoo.dylib"} \
16 -o $out/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \
21 bar = stdenv.mkDerivation {
23 outputs = [ "out" "dev" ];
28 mkdir -p $out/bin $dev/include $dev/lib
29 $CC -o $out/bin/bar ${./cc-main.c}
31 cp ${./bar.c} $dev/include/bar.h
33 ${lib.optionalString stdenv.isDarwin "-Wl,-install_name,$dev/lib/libbar.dylib"} \
34 -o $dev/lib/libbar${stdenv.hostPlatform.extensions.sharedLibrary} \
41 name = "stdenv-inputs-test";
42 phases = [ "buildPhase" ];
44 buildInputs = [ foo bar ];
49 printf "checking whether binaries are available... " >&2
52 printf "checking whether compiler can find headers... " >&2
53 $CC -o include-check ${./include-main.c}
56 printf "checking whether compiler can find headers... " >&2
57 $CC -o include-check ${./include-main.c}
60 printf "checking whether compiler can find libraries... " >&2
61 $CC -lfoo -lbar -o lib-check ${./lib-main.c}
67 meta.platforms = lib.platforms.all;