nixpkgs/pkgs/applications/radio/freedv/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
1.6 KiB
Nix
Raw Normal View History

{ config
, lib
2021-10-20 15:38:32 +00:00
, stdenv
, fetchFromGitHub
, cmake
, codec2
, libpulseaudio
2021-10-20 15:38:32 +00:00
, libsamplerate
, libsndfile
, lpcnetfreedv
, portaudio
, speexdsp
, hamlib
, wxGTK31-gtk3
, pulseSupport ? config.pulseaudio or stdenv.isLinux
2022-08-30 03:15:42 +00:00
, AppKit
, AVFoundation
, Cocoa
, CoreMedia
2021-10-20 15:38:32 +00:00
}:
stdenv.mkDerivation rec {
pname = "freedv";
2022-08-17 10:54:47 +00:00
version = "1.8.3.1";
2021-10-20 15:38:32 +00:00
src = fetchFromGitHub {
owner = "drowe67";
repo = "freedv-gui";
rev = "v${version}";
2022-08-17 10:54:47 +00:00
hash = "sha256-LPCY5gPinxJkfPfumKggI/JQorcW+Qw/ZAP6XQmPkeA=";
2021-10-20 15:38:32 +00:00
};
2022-08-30 03:15:42 +00:00
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace src/CMakeLists.txt \
--replace "if(APPLE)" "if(0)" \
--replace "\''${FREEDV_LINK_LIBS})" "\''${FREEDV_LINK_LIBS} \''${FREEDV_LINK_LIBS_OSX})" \
--replace "\''${RES_FILES})" "\''${RES_FILES} \''${FREEDV_SOURCES_OSX})"
'';
2021-10-20 15:38:32 +00:00
nativeBuildInputs = [ cmake ];
2022-08-30 03:15:42 +00:00
2021-10-20 15:38:32 +00:00
buildInputs = [
codec2
libsamplerate
libsndfile
lpcnetfreedv
speexdsp
hamlib
wxGTK31-gtk3
2022-08-30 03:15:42 +00:00
] ++ (if pulseSupport then [ libpulseaudio ] else [ portaudio ])
++ lib.optionals stdenv.isDarwin [
AppKit
AVFoundation
Cocoa
CoreMedia
];
2021-10-20 15:38:32 +00:00
cmakeFlags = [
"-DUSE_INTERNAL_CODEC2:BOOL=FALSE"
"-DUSE_STATIC_DEPS:BOOL=FALSE"
] ++ lib.optionals pulseSupport [ "-DUSE_PULSEAUDIO:BOOL=TRUE" ];
2021-10-20 15:38:32 +00:00
2022-10-05 22:55:15 +00:00
NIX_CFLAGS_COMPILE = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
"-DAPPLE_OLD_XCODE"
];
2021-10-20 15:38:32 +00:00
meta = with lib; {
homepage = "https://freedv.org/";
description = "Digital voice for HF radio";
license = licenses.lgpl21;
2022-08-30 03:15:42 +00:00
maintainers = with maintainers; [ mvs wegank ];
2022-02-15 12:09:48 +00:00
platforms = platforms.unix;
2021-10-20 15:38:32 +00:00
};
}