whisper_cpp: init at 1.2.0

master
Simon Bruder 2023-03-06 21:57:54 +01:00
parent d907a41518
commit b095898a01
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
3 changed files with 37 additions and 1 deletions

View File

@ -45,4 +45,6 @@ in
unxwb = callPackage ./unxwb { };
VisiCut = callPackage ./VisiCut { };
whisper_cpp = callPackage ./whisper_cpp { };
}

View File

@ -58,7 +58,8 @@
nsz
playgsf
textidote
unxwb;
unxwb
whisper_cpp;
mpvScripts = lib.recurseIntoAttrs {
inherit (pkgs.mpvScripts)

33
whisper_cpp/default.nix Normal file
View File

@ -0,0 +1,33 @@
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "whisper.cpp";
version = "1.2.0";
src = fetchFromGitHub {
owner = "ggerganov";
repo = pname;
rev = "v${version}";
sha256 = "sha256-7/10t1yE7Gbs+cyj8I9vJoDeaxEz9Azc2j3f6QCjDGM=";
};
postPatch = ''
substituteInPlace models/download-ggml-model.sh \
--replace 'models_path="$(get_script_path)"' 'models_path="$HOME/.local/share/whisper_cpp"'
'';
installPhase = ''
runHook preInstall
install -D main $out/bin/${pname}
install -D models/download-ggml-model.sh $out/bin/download-ggml-model
runHook postInstall
'';
meta = with lib; {
description = "Port of OpenAI's Whisper model in C/C++";
homepage = "https://github.com/ggerganov/whisper.cpp/";
license = licenses.mit;
maintainers = with maintainers; [ sbruder ];
platforms = platforms.unix;
};
}