diff --git a/pkgs/by-name/p0/p0f/build-stdio.patch b/pkgs/by-name/p0/p0f/build-stdio.patch new file mode 100644 index 000000000000..3274960c7fba --- /dev/null +++ b/pkgs/by-name/p0/p0f/build-stdio.patch @@ -0,0 +1,13 @@ +diff --git a/build.sh b/build.sh +index f674433..f181344 100755 +--- a/build.sh ++++ b/build.sh +@@ -197,7 +197,7 @@ echo -n "[*] Checking if memory alignment is required... " + + rm -f "$TMP" "$TMP.c" "$TMP.log" || exit 1 + +-echo -e "#include \"types.h\"\nvolatile u8 tmp[6]; int main() { printf(\"%d\x5cn\", *(u32*)(tmp+1)); return 0; }" >"$TMP.c" || exit 1 ++echo -e "#include \"types.h\"\n#include \"stdio.h\"\nvolatile u8 tmp[6]; int main() { printf(\"%d\x5cn\", *(u32*)(tmp+1)); return 0; }" >"$TMP.c" || exit 1 + $CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" &>"$TMP.log" + + if [ ! -x "$TMP" ]; then diff --git a/pkgs/by-name/p0/p0f/package.nix b/pkgs/by-name/p0/p0f/package.nix index 93c025b1c43e..5db7d66cf16d 100644 --- a/pkgs/by-name/p0/p0f/package.nix +++ b/pkgs/by-name/p0/p0f/package.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation rec { buildInputs = [ libpcap ]; + patches = [ ./build-stdio.patch ]; + buildPhase = '' substituteInPlace config.h --replace "p0f.fp" "$out/etc/p0f.fp" substituteInPlace build.sh --replace "/bin/bash" "${bash}/bin/bash"