nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 nix-update-script,
7 cmake,
8 pkg-config,
9 # required dependencies
10 fftwFloat,
11 libpng,
12 libtiff,
13 jemalloc,
14 volk,
15 nng,
16 curl,
17 # Optional dependencies
18 withZIQRecordingCompression ? true,
19 zstd,
20 withGUI ? true,
21 glfw,
22 zenity,
23 withAudio ? true,
24 portaudio,
25 withOfficialProductSupport ? true,
26 hdf5,
27 withOpenCL ? true,
28 opencl-headers,
29 ocl-icd,
30 withSourceRtlsdr ? true,
31 rtl-sdr-librtlsdr,
32 withSourceHackRF ? true,
33 hackrf,
34 withSourceAirspy ? true,
35 airspy,
36 withSourceAirspyHF ? true,
37 airspyhf,
38 withSourceAD9361 ? true,
39 libad9361,
40 libiio,
41 withSourceBladeRF ? true,
42 libbladeRF,
43}:
44
45stdenv.mkDerivation (finalAttrs: {
46 pname = "satdump";
47 version = "1.2.2";
48
49 src = fetchFromGitHub {
50 owner = "SatDump";
51 repo = "SatDump";
52 tag = finalAttrs.version;
53 hash = "sha256-+Sne+NMwnIAs3ff64fBHAIE4/iDExIC64sXtO0LJwI0=";
54 };
55
56 patches = [
57 # fixes build with GCC 15 until newer satdump release is available
58 (fetchpatch {
59 url = "https://github.com/SatDump/SatDump/commit/2b0a874f38d9310e3e4cbc56cfcc69cb0a59e035.patch";
60 name = "fix-build-with-gcc15.patch";
61 hash = "sha256-RYNLax/VA7cT7wP88hG5cb2BDkEMMZu2v2CKo/hqwCE=";
62 })
63 ];
64
65 postPatch = ''
66 substituteInPlace src-core/CMakeLists.txt \
67 --replace-fail '$'{CMAKE_INSTALL_PREFIX}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR}
68 '';
69
70 nativeBuildInputs = [
71 cmake
72 pkg-config
73 ];
74
75 buildInputs = [
76 fftwFloat
77 libpng
78 libtiff
79 jemalloc
80 volk
81 nng
82 curl
83 ]
84 ++ lib.optionals withZIQRecordingCompression [ zstd ]
85 ++ lib.optionals withGUI [
86 glfw
87 zenity
88 ]
89 ++ lib.optionals withAudio [ portaudio ]
90 ++ lib.optionals withOfficialProductSupport [ hdf5 ]
91 ++ lib.optionals withOpenCL [
92 opencl-headers
93 ocl-icd
94 ]
95 ++ lib.optionals withSourceRtlsdr [ rtl-sdr-librtlsdr ]
96 ++ lib.optionals withSourceHackRF [ hackrf ]
97 ++ lib.optionals withSourceAirspy [ airspy ]
98 ++ lib.optionals withSourceAirspyHF [ airspyhf ]
99 ++ lib.optionals withSourceAD9361 [
100 libad9361
101 libiio
102 ]
103 ++ lib.optionals withSourceBladeRF [ libbladeRF ];
104
105 cmakeFlags = [ (lib.cmakeBool "BUILD_GUI" withGUI) ];
106
107 passthru.updateScript = nix-update-script { };
108
109 meta = {
110 description = "Generic satellite data processing software";
111 homepage = "https://www.satdump.org/";
112 changelog = "https://github.com/SatDump/SatDump/releases/tag/${finalAttrs.version}";
113 license = lib.licenses.gpl3Plus;
114 platforms = lib.platforms.linux;
115 maintainers = with lib.maintainers; [
116 theverygaming
117 ];
118 mainProgram = "satdump";
119 };
120})