1{
2 stdenv,
3 lib,
4 cmake,
5 cpptrace,
6 src,
7 checkOutput,
8 static,
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 name = "cpptrace-findpackage-integration-test";
13
14 inherit src;
15
16 nativeBuildInputs = [ cmake ];
17 buildInputs = [
18 (cpptrace.override { inherit static; })
19 ];
20
21 installPhase = ''
22 runHook preInstall
23 mkdir -p $out/bin
24 install main $out/bin
25 runHook postInstall
26 '';
27
28 doInstallCheck = true;
29
30 installCheckPhase = lib.strings.concatLines (
31 [ "$out/bin/main" ]
32 # Check that the backtrace contains the path to the executable.
33 ++ lib.optionals checkOutput [
34 ''
35 if [[ !(`$out/bin/main 2>&1` =~ "${finalAttrs.name}") ]]; then
36 echo "ERROR: $out/bin/main does not output '${finalAttrs.name}'"
37 exit 1
38 fi
39 ''
40 ]
41 );
42})