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

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

78 lines
1.6 KiB
Nix
Raw Normal View History

{ config
, lib
2021-10-20 17:38:32 +02:00
, stdenv
, fetchFromGitHub
, cmake
, codec2
, libpulseaudio
2021-10-20 17:38:32 +02:00
, libsamplerate
, libsndfile
, lpcnetfreedv
, portaudio
, speexdsp
, hamlib
2022-10-06 00:56:43 +02:00
, wxGTK32
, pulseSupport ? config.pulseaudio or stdenv.isLinux
2022-08-30 05:15:42 +02:00
, AppKit
, AVFoundation
, Cocoa
, CoreMedia
2021-10-20 17:38:32 +02:00
}:
stdenv.mkDerivation rec {
pname = "freedv";
2022-12-26 08:00:11 +01:00
version = "1.8.6";
2021-10-20 17:38:32 +02:00
src = fetchFromGitHub {
owner = "drowe67";
repo = "freedv-gui";
rev = "v${version}";
2022-12-26 08:00:11 +01:00
hash = "sha256-zzzRePBc09fK1ILoDto3EVz7IxJKePi39E18BrQedE0=";
2021-10-20 17:38:32 +02:00
};
2022-08-30 05:15:42 +02: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 17:38:32 +02:00
nativeBuildInputs = [ cmake ];
2022-08-30 05:15:42 +02:00
2021-10-20 17:38:32 +02:00
buildInputs = [
codec2
libsamplerate
libsndfile
lpcnetfreedv
speexdsp
hamlib
2022-10-06 00:56:43 +02:00
wxGTK32
2022-08-30 05:15:42 +02:00
] ++ (if pulseSupport then [ libpulseaudio ] else [ portaudio ])
++ lib.optionals stdenv.isDarwin [
AppKit
AVFoundation
Cocoa
CoreMedia
];
2021-10-20 17:38:32 +02:00
cmakeFlags = [
"-DUSE_INTERNAL_CODEC2:BOOL=FALSE"
"-DUSE_STATIC_DEPS:BOOL=FALSE"
2022-11-01 01:53:31 +01:00
"-DUNITTEST=ON"
] ++ lib.optionals pulseSupport [ "-DUSE_PULSEAUDIO:BOOL=TRUE" ];
2021-10-20 17:38:32 +02:00
2022-10-06 00:55:15 +02:00
NIX_CFLAGS_COMPILE = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
"-DAPPLE_OLD_XCODE"
];
2022-11-01 01:53:31 +01:00
doCheck = true;
2021-10-20 17:38:32 +02:00
meta = with lib; {
homepage = "https://freedv.org/";
description = "Digital voice for HF radio";
license = licenses.lgpl21;
2022-08-30 05:15:42 +02:00
maintainers = with maintainers; [ mvs wegank ];
2022-02-15 13:09:48 +01:00
platforms = platforms.unix;
2021-10-20 17:38:32 +02:00
};
}