From 7f6d5c62d33c3f04ced90dc8fb3a37ac618b5d74 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Tue, 20 Dec 2022 15:11:06 +0000 Subject: [PATCH] nix/pkgs/readsb: init --- nix/pkgs/default.nix | 1 + nix/pkgs/readsb/default.nix | 56 +++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 nix/pkgs/readsb/default.nix diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 270357953b..20a41d0c77 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -73,4 +73,5 @@ authentik = import ./authentik args; flipperzero-firmware = import ./flipperzero-firmware args; jj = import ./jj.nix args; + readsb = pkgs.callPackage ./readsb { }; } // (import ./heptapod-runner args) diff --git a/nix/pkgs/readsb/default.nix b/nix/pkgs/readsb/default.nix new file mode 100644 index 0000000000..8997ace830 --- /dev/null +++ b/nix/pkgs/readsb/default.nix @@ -0,0 +1,56 @@ +{ lib +, fetchFromGitHub +, stdenv +, libusb1 +, ncurses +, zlib +, zstd + +, librtlsdr +, libbladeRF +, libiio +, libad9361 + +, pkg-config +}: + +stdenv.mkDerivation rec { + pname = "readsb"; + version = "3.14.1595"; + + src = fetchFromGitHub { + owner = "wiedehopf"; + repo = "readsb"; + rev = "v${version}"; + sha256 = "sha256:1ws8fphlgghcp8v1p88gjpwmy3sf0sypdwzcaai19a882jll486n"; + }; + + buildInputs = [ + libusb1 + ncurses + zlib + zstd + + librtlsdr + libbladeRF + libiio + libad9361 + ]; + + nativeBuildInputs = [ + pkg-config + ]; + + makeFlags = "RTLSDR=yes AIRCRAFT_HASH_BITS=15 HISTORY=yes BLADERF=yes PLUTOSDR=yes AGGRESSIVE=yes HAVE_BIASTEE=yes"; + enableParallelBuilding = true; + + installPhase = '' + runHook preInstall + + install -d $out/bin + install -m 0755 readsb $out/bin/readsb + ln -s $out/bin/readsb $out/bin/viewadsb + + runHook postInstall + ''; +}