diff --git a/pkgs/by-name/lp/LPCNet/package.nix b/pkgs/by-name/lp/LPCNet/package.nix new file mode 100644 index 000000000000..0d94114f4e6d --- /dev/null +++ b/pkgs/by-name/lp/LPCNet/package.nix @@ -0,0 +1,56 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchurl, + cmake, + codec2, + # for tests + octave, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "LPCNet"; + version = "0.5"; + + src = fetchFromGitHub { + owner = "drowe67"; + repo = "LPCNet"; + rev = "v${finalAttrs.version}"; + hash = "sha256-tHZLKXmuM86A6OpfS3CRRjhFbqj1Q/w1w56msdgLHb0="; + }; + passthru = { + # Prebuilt neural network model that is needed during the build - can be overrwritten + nnmodel = fetchurl { + url = "http://rowetel.com/downloads/deep/lpcnet_191005_v1.0.tgz"; + hash = "sha256-UJRAkkdR/dh/+qVoPuPd3ZN69cgzuRBMzOZdUWFJJsg="; + }; + }; + preConfigure = '' + mkdir build + cp \ + ${finalAttrs.finalPackage.passthru.nnmodel} \ + build/${finalAttrs.finalPackage.passthru.nnmodel.name} + ''; + + prePatch = '' + patchShebangs *.sh unittest/*.sh + ''; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ codec2 ]; + nativeCheckInputs = [ octave ]; + + doCheck = true; + preCheck = '' + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}/build/source/build/src" + ''; + + meta = with lib; { + description = "Experimental Neural Net speech coding for FreeDV"; + homepage = "https://github.com/drowe67/LPCNet"; + license = licenses.bsd3; + maintainers = with maintainers; [ doronbehar ]; + platforms = platforms.all; + }; +})