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

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

98 lines
2.1 KiB
Nix
Raw Normal View History

{ config
, lib
2021-10-20 15:38:32 +00:00
, stdenv
, fetchFromGitHub
, cmake
2023-01-22 03:17:00 +00:00
, macdylibbundler
, makeWrapper
, darwin
2021-10-20 15:38:32 +00:00
, codec2
, libpulseaudio
2021-10-20 15:38:32 +00:00
, libsamplerate
, libsndfile
, lpcnetfreedv
, portaudio
, speexdsp
2023-05-03 12:46:12 +00:00
, hamlib_4
2022-10-05 22:56:43 +00:00
, wxGTK32
2023-06-06 09:07:31 +00:00
, sioclient
, 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";
2024-02-07 00:01:59 +00:00
version = "1.9.8";
2021-10-20 15:38:32 +00:00
src = fetchFromGitHub {
owner = "drowe67";
repo = "freedv-gui";
rev = "v${version}";
2024-01-20 03:35:29 +00:00
hash = "sha256-JbLP65fC6uHrHXpSUwtgYHB+VLfheo5RU3C44lx8QlQ=";
2021-10-20 15:38:32 +00:00
};
2022-08-30 03:15:42 +00:00
postPatch = lib.optionalString stdenv.isDarwin ''
2023-10-27 17:07:41 +00:00
substituteInPlace CMakeLists.txt \
2024-02-07 00:01:59 +00:00
--replace-fail "-Wl,-ld_classic" ""
2022-08-30 03:15:42 +00:00
substituteInPlace src/CMakeLists.txt \
2024-02-07 00:01:59 +00:00
--replace-fail "\''${CMAKE_SOURCE_DIR}/macdylibbundler/dylibbundler" "dylibbundler"
2023-11-18 05:19:51 +00:00
sed -i "/codesign/d;/hdiutil/d" src/CMakeLists.txt
2022-08-30 03:15:42 +00:00
'';
2023-01-22 03:17:00 +00:00
nativeBuildInputs = [
cmake
] ++ lib.optionals stdenv.isDarwin [
macdylibbundler
makeWrapper
darwin.autoSignDarwinBinariesHook
];
2022-08-30 03:15:42 +00:00
2021-10-20 15:38:32 +00:00
buildInputs = [
codec2
libsamplerate
libsndfile
lpcnetfreedv
speexdsp
2023-05-03 12:46:12 +00:00
hamlib_4
2022-10-05 22:56:43 +00:00
wxGTK32
2023-06-06 09:07:31 +00:00
sioclient
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"
2022-11-01 00:53:31 +00:00
"-DUNITTEST=ON"
2023-08-29 22:40:49 +00:00
"-DUSE_PULSEAUDIO:BOOL=${if pulseSupport then "TRUE" else "FALSE"}"
];
2021-10-20 15:38:32 +00:00
env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
2022-10-05 22:55:15 +00:00
"-DAPPLE_OLD_XCODE"
]);
2022-10-05 22:55:15 +00:00
2022-11-01 00:53:31 +00:00
doCheck = true;
2023-01-22 03:17:00 +00:00
postInstall = lib.optionalString stdenv.isDarwin ''
mkdir -p $out/Applications
mv $out/bin/FreeDV.app $out/Applications
makeWrapper $out/Applications/FreeDV.app/Contents/MacOS/FreeDV $out/bin/freedv
'';
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;
2024-02-11 02:19:15 +00:00
mainProgram = "freedv";
2021-10-20 15:38:32 +00:00
};
}