about summary refs log tree commit diff
path: root/pkgs/applications/radio
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2023-04-16 18:48:57 +0300
committerDoron Behar <doron.behar@gmail.com>2024-06-04 11:07:52 +0300
commit8e0c43ecfd2592e0143d23e0e1aa6d3e20a6675b (patch)
treea4210d0b121f3ca0f93b94875ad9825a837f0ffd /pkgs/applications/radio
parent340d46ceac0640399b3618b52874ce6f5dbf30cf (diff)
sdr-j-fm: init at 3.16-unstable-2023-12-07
Diffstat (limited to 'pkgs/applications/radio')
-rw-r--r--pkgs/applications/radio/sdr-j-fm/default.nix77
1 files changed, 77 insertions, 0 deletions
diff --git a/pkgs/applications/radio/sdr-j-fm/default.nix b/pkgs/applications/radio/sdr-j-fm/default.nix
new file mode 100644
index 0000000000000..6c1dd5f4a0a1d
--- /dev/null
+++ b/pkgs/applications/radio/sdr-j-fm/default.nix
@@ -0,0 +1,77 @@
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  cmake,
+  wrapQtAppsHook,
+  pkg-config,
+  qtbase,
+  qwt,
+  fftwFloat,
+  libsamplerate,
+  portaudio,
+  libusb1,
+  libsndfile,
+  featuresOverride ? { },
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "sdr-j-fm";
+  # The stable release doen't include the commit the came after 3.16 which
+  # added support for cmake options instead of using cmake set() commands. See
+  # also: https://github.com/JvanKatwijk/sdr-j-fm/pull/25
+  version = "3.16-unstable-2023-12-07";
+
+  src = fetchFromGitHub {
+    owner = "JvanKatwijk";
+    repo = "sdr-j-fm";
+    rev = "8e3a67f8fbf72dd6968cbeb2e3d7d513fd107c71";
+    hash = "sha256-l9WqfhDp2V01lhleYZqRpmyL1Ww+tJj10bjkMMlvyA0=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    wrapQtAppsHook
+    pkg-config
+  ];
+
+  buildInputs = [
+    qtbase
+    qwt
+    fftwFloat
+    libsamplerate
+    portaudio
+    libusb1
+    libsndfile
+  ];
+  cmakeFlags = lib.mapAttrsToList lib.cmakeBool finalAttrs.passthru.features;
+
+  passthru = {
+    features = {
+      # All of these features don't require an external depencies, althought it
+      # may be implied - upstraem bundles everything they need in their repo.
+      AIRSPY =     true;
+      SDRPLAY =    true;
+      SDRPLAY_V3 = true;
+      HACKRF =     true;
+      PLUTO =      true;
+      # Some more cmake flags are mentioned in upstream's CMakeLists.txt file
+      # but they don't actually make a difference.
+    } // featuresOverride;
+  };
+
+  postInstall = ''
+    # Weird default of upstream
+    mv $out/linux-bin $out/bin
+  '';
+
+  meta = with lib; {
+    description = "SDR based FM radio receiver software";
+    homepage = "https://github.com/JvanKatwijk/sdr-j-fm";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ doronbehar ];
+    # Upstream doesn't find libusb1 on Darwin. Upstream probably doesn't
+    # support it officially.
+    platforms = platforms.linux;
+  };
+})