nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 pkg-config,
7 hackrf,
8 libbladeRF,
9 libusb1,
10 limesuite,
11 ncurses,
12 rtl-sdr,
13 soapysdr-with-plugins,
14}:
15
16stdenv.mkDerivation (finalAttrs: {
17 pname = "dump1090";
18 version = "10.2";
19
20 src = fetchFromGitHub {
21 owner = "flightaware";
22 repo = "dump1090";
23 tag = "v${finalAttrs.version}";
24 hash = "sha256-kTJ8FMugBRJaxWas/jEj4E5TmVnNpNdhq4r2YFFwgTU=";
25 };
26
27 nativeBuildInputs = [ pkg-config ];
28
29 buildInputs = [
30 hackrf
31 libbladeRF
32 libusb1
33 ncurses
34 rtl-sdr
35 soapysdr-with-plugins
36 ]
37 ++ lib.optional stdenv.hostPlatform.isLinux limesuite;
38
39 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-implicit-function-declaration -Wno-int-conversion -Wno-unknown-warning-option";
40
41 buildFlags = [
42 "DUMP1090_VERSION=${finalAttrs.version}"
43 "showconfig"
44 "dump1090"
45 "view1090"
46 "faup1090"
47 ];
48
49 doCheck = true;
50
51 installPhase = ''
52 runHook preInstall
53
54 mkdir -p $out/bin $out/share
55 cp -v dump1090 view1090 faup1090 $out/bin
56 cp -vr public_html $out/share/dump1090
57
58 runHook postInstall
59 '';
60
61 meta = {
62 description = "Simple Mode S decoder for RTLSDR devices";
63 homepage = "https://github.com/flightaware/dump1090";
64 license = lib.licenses.gpl2Plus;
65 platforms = lib.platforms.unix;
66 maintainers = with lib.maintainers; [
67 earldouglas
68 aciceri
69 ];
70 mainProgram = "dump1090";
71 };
72})