Skip to content

Commit

Permalink
ice9-bluetooth-sniffer: init at unstable-2023-10-04
Browse files Browse the repository at this point in the history
  • Loading branch information
mrene committed Aug 10, 2024
1 parent d2cd84a commit 70c463c
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions pkgs/default/ice9-bluetooth-sniffer/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchurl
, cmake
, pkg-config
, liquid-dsp
, hackrf
, libbladeRF
, uhd
, fftwFloat
, unixtools
, darwin ? null
, lld ? null
}:

let
pr-40-usrp-data-format = fetchurl {
url = "https://patch-diff.githubusercontent.com/raw/mikeryan/ice9-bluetooth-sniffer/pull/40.patch";
hash = "sha256-QeAsI1YFz4krB0yPNZqxPyspCqhawHNrUCBOo93bF78=";
};
in
stdenv.mkDerivation {
pname = "ice9-bluetooth-sniffer";
version = "unstable-2023-10-04";

src = fetchFromGitHub {
owner = "mikeryan";
repo = "ice9-bluetooth-sniffer";
rev = "2d504c7b50db2d7d0dcb41cff61f798b59b9b5c5";
hash = "sha256-o2Ri5WAqGoi1Ck5cjP8VRwtYSHPQo0aONufrF/V3f6c=";
};

patches = [
pr-40-usrp-data-format
];

cmakeFlags = lib.optional stdenv.isDarwin (lib.cmakeFeature "CMAKE_EXE_LINKER_FLAGS" "-fuse-ld=lld");

# On Darwin platforms:
# error: call to undeclared function '_NSGetExecutablePath'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-implicit-function-declaration";

nativeBuildInputs = [ cmake pkg-config unixtools.xxd ] ++
lib.optionals stdenv.isDarwin [ lld ];

buildInputs = [
liquid-dsp
libbladeRF
hackrf
uhd
fftwFloat
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.IOSurface
darwin.apple_sdk.frameworks.QuartzCore
];

postInstall = lib.optionalString stdenv.isDarwin ''
install_name_tool -change libliquid.dylib ${liquid-dsp}/lib/libliquid.dylib $out/bin/ice9-bluetooth
'';

meta = with lib; {
description = "Wireshark-compatible all-channel BLE sniffer for bladeRF, with wideband Bluetooth sniffing for HackRF and USRP";
homepage = "https://github.com/mikeryan/ice9-bluetooth-sniffer";
license = licenses.gpl2Only;
maintainers = with maintainers; [ mrene ];
mainProgram = "ice9-bluetooth";
platforms = platforms.unix;
};
}

0 comments on commit 70c463c

Please sign in to comment.