about summary refs log tree commit diff
path: root/pkgs/by-name/lp
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2020-04-09 23:15:16 +0300
committerDoron Behar <doron.behar@gmail.com>2024-06-06 09:26:06 +0300
commit1a00c7665948b4adcebc0ee24dc1977e25903cc2 (patch)
treeaa00aa3876cce12bd1484c1e6767d9095adcb8b4 /pkgs/by-name/lp
parent340d46ceac0640399b3618b52874ce6f5dbf30cf (diff)
LPCNet: init at 0.5
Diffstat (limited to 'pkgs/by-name/lp')
-rw-r--r--pkgs/by-name/lp/LPCNet/package.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/by-name/lp/LPCNet/package.nix b/pkgs/by-name/lp/LPCNet/package.nix
new file mode 100644
index 0000000000000..0d94114f4e6dc
--- /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;
+  };
+})