Commit 8e0c43ec authored by Doron Behar's avatar Doron Behar
Browse files

sdr-j-fm: init at 3.16-unstable-2023-12-07

parent 340d46ce
Loading
Loading
Loading
Loading
+77 −0
Original line number Diff line number Diff line
{
  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;
  };
})
+2 −0
Original line number Diff line number Diff line
@@ -24258,6 +24258,8 @@ with pkgs;
  sdrplay = callPackage ../applications/radio/sdrplay { };
  sdr-j-fm = libsForQt5.callPackage ../applications/radio/sdr-j-fm { };
  sdrpp = callPackage ../applications/radio/sdrpp {
    inherit (darwin.apple_sdk.frameworks) AppKit;
  };