···1414 patches = oa.patches or [] ++ [
1515 # change the prefix from /usr/bin to /run to find nix processes
1616 ../../pkgs/tools/security/tracee/test-EventFilters-prefix-nix-friendly.patch
1717- # skip magic_write test that currently fails
1818- ../../pkgs/tools/security/tracee/test-EventFilters-magic_write-skip.patch
1917 ];
2018 buildPhase = ''
2119 runHook preBuild
2220 # just build the static lib we need for the go test binary
2323- make $makeFlags ''${enableParallelBuilding:+-j$NIX_BUILD_CORES -l$NIX_BUILD_CORES} bpf-core ./dist/btfhub ./dist/libbpf/libbpf.a
2121+ make $makeFlags ''${enableParallelBuilding:+-j$NIX_BUILD_CORES -l$NIX_BUILD_CORES} bpf-core ./dist/btfhub
2222+2323+ # remove the /usr/bin prefix to work with the patch above
2424+ substituteInPlace tests/integration/integration_test.go \
2525+ --replace "/usr/bin/ls" "ls"
2626+2427 # then compile the tests to be ran later
2525- CGO_CFLAGS="-I$PWD/dist/libbpf" CGO_LDFLAGS="-lelf -lz $PWD/dist/libbpf/libbpf.a" go test -tags core,ebpf,integration -p 1 -c -o $GOPATH/tracee-integration ./tests/integration/...
2828+ CGO_LDFLAGS="$(pkg-config --libs libbpf)" go test -tags core,ebpf,integration -p 1 -c -o $GOPATH/tracee-integration ./tests/integration/...
2629 runHook postBuild
2730 '';
2831 doCheck = false;