2020-04-09 23:15:16 +03:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchurl,
|
|
|
|
cmake,
|
|
|
|
codec2,
|
2025-05-06 10:44:09 +03:00
|
|
|
sox,
|
2020-04-09 23:15:16 +03:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "LPCNet";
|
2025-05-05 13:50:57 +03:00
|
|
|
version = "0.5-unstable-2025-01-19";
|
2020-04-09 23:15:16 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "drowe67";
|
|
|
|
repo = "LPCNet";
|
2025-05-05 13:50:57 +03:00
|
|
|
rev = "c8e51ac5e2fe674849cb53e7da44689b572cc246";
|
|
|
|
sha256 = "sha256-0Knoym+deTuFAyJrrD55MijVh6DlhJp3lss66BJUHiA=";
|
2020-04-09 23:15:16 +03:00
|
|
|
};
|
2025-05-03 20:33:55 +03:00
|
|
|
|
2025-05-05 13:41:01 +03:00
|
|
|
patches = [
|
|
|
|
# extracted from https://github.com/drowe67/LPCNet/pull/59
|
|
|
|
./darwin.patch
|
|
|
|
];
|
|
|
|
|
2020-04-09 23:15:16 +03:00
|
|
|
passthru = {
|
2025-02-22 21:23:34 +01:00
|
|
|
# Prebuilt neural network model that is needed during the build - can be overwritten
|
2020-04-09 23:15:16 +03:00
|
|
|
nnmodel = fetchurl {
|
|
|
|
url = "http://rowetel.com/downloads/deep/lpcnet_191005_v1.0.tgz";
|
|
|
|
hash = "sha256-UJRAkkdR/dh/+qVoPuPd3ZN69cgzuRBMzOZdUWFJJsg=";
|
|
|
|
};
|
|
|
|
};
|
2025-05-03 20:33:55 +03:00
|
|
|
|
2020-04-09 23:15:16 +03:00
|
|
|
preConfigure = ''
|
|
|
|
mkdir build
|
|
|
|
cp \
|
|
|
|
${finalAttrs.finalPackage.passthru.nnmodel} \
|
|
|
|
build/${finalAttrs.finalPackage.passthru.nnmodel.name}
|
|
|
|
'';
|
|
|
|
|
2025-05-03 20:33:55 +03:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
codec2
|
|
|
|
];
|
|
|
|
|
2020-04-09 23:15:16 +03:00
|
|
|
doCheck = true;
|
2025-05-06 10:44:09 +03:00
|
|
|
nativeCheckInputs = [
|
|
|
|
# NOTE: From some reason, the tests pass without this on x86_64-linux, but
|
|
|
|
# not on aarch64-linux, although the relevant test is not enabled
|
|
|
|
# conditionally, see:
|
|
|
|
# https://github.com/drowe67/LPCNet/blob/c8e51ac5e2fe674849cb53e7da44689b572cc246/CMakeLists.txt#L220-L225
|
|
|
|
sox
|
|
|
|
];
|
2020-04-09 23:15:16 +03:00
|
|
|
|
2025-05-03 20:33:55 +03:00
|
|
|
meta = {
|
2020-04-09 23:15:16 +03:00
|
|
|
description = "Experimental Neural Net speech coding for FreeDV";
|
|
|
|
homepage = "https://github.com/drowe67/LPCNet";
|
2025-05-03 20:33:55 +03:00
|
|
|
license = lib.licenses.bsd3;
|
2025-05-05 13:44:48 +03:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
doronbehar
|
|
|
|
mvs
|
|
|
|
];
|
2025-05-03 20:33:55 +03:00
|
|
|
platforms = lib.platforms.all;
|
2020-04-09 23:15:16 +03:00
|
|
|
};
|
|
|
|
})
|