Merge pull request #131526 from ckiee/kaldi

dragonfly: init at 0.32.0

authored by

Luke Granger-Brown and committed by
GitHub
f584ae37 878e198e

+527 -13
+10 -10
maintainers/maintainer-list.nix
··· 2096 githubId = 25088352; 2097 name = "Christian Kögler"; 2098 }; 2099 clkamp = { 2100 email = "c@lkamp.de"; 2101 github = "clkamp"; ··· 9694 github = "rongcuid"; 9695 githubId = 1312525; 9696 name = "Rongcui Dong"; 9697 - }; 9698 - ronthecookie = { 9699 - name = "Ron B"; 9700 - email = "me@ronthecookie.me"; 9701 - github = "ronthecookie"; 9702 - githubId = 2526321; 9703 - keys = [{ 9704 - longkeyid = "rsa2048/0x6F5B32DE5E5FA80C"; 9705 - fingerprint = "4B2C DDA5 FA35 642D 956D 7294 6F5B 32DE 5E5F A80C"; 9706 - }]; 9707 }; 9708 roosemberth = { 9709 email = "roosembert.palacios+nixpkgs@posteo.ch";
··· 2096 githubId = 25088352; 2097 name = "Christian Kögler"; 2098 }; 2099 + ckie = { 2100 + email = "nixpkgs-0efe364@ckie.dev"; 2101 + github = "ckiee"; 2102 + githubId = 2526321; 2103 + keys = [{ 2104 + longkeyid = "rsa4096/0x13E79449C0525215"; 2105 + fingerprint = "539F 0655 4D35 38A5 429A E253 13E7 9449 C052 5215"; 2106 + }]; 2107 + name = "ckie"; 2108 + }; 2109 clkamp = { 2110 email = "c@lkamp.de"; 2111 github = "clkamp"; ··· 9704 github = "rongcuid"; 9705 githubId = 1312525; 9706 name = "Rongcui Dong"; 9707 }; 9708 roosemberth = { 9709 email = "roosembert.palacios+nixpkgs@posteo.ch";
+1 -1
pkgs/applications/graphics/blockbench-electron/default.nix
··· 42 description = "A boxy 3D model editor powered by Electron"; 43 homepage = "https://blockbench.net/"; 44 license = licenses.gpl3Only; 45 - maintainers = [ maintainers.ronthecookie ]; 46 platforms = [ "x86_64-linux" ]; 47 }; 48 }
··· 42 description = "A boxy 3D model editor powered by Electron"; 43 homepage = "https://blockbench.net/"; 44 license = licenses.gpl3Only; 45 + maintainers = [ maintainers.ckie ]; 46 platforms = [ "x86_64-linux" ]; 47 }; 48 }
+77
pkgs/development/python-modules/dragonfly/default.nix
···
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + , decorator 5 + , packaging 6 + , pynput 7 + , regex 8 + , lark-parser 9 + , enum34 10 + , pyperclip 11 + , six 12 + , requests 13 + , psutil 14 + , json-rpc 15 + , werkzeug 16 + , kaldi-active-grammar 17 + , sounddevice 18 + , webrtcvad 19 + , setuptools 20 + , xdotool 21 + , wmctrl 22 + , xorg 23 + }: 24 + 25 + buildPythonPackage rec { 26 + pname = "dragonfly"; 27 + version = "0.32.0"; 28 + 29 + src = fetchFromGitHub { 30 + owner = "dictation-toolbox"; 31 + repo = pname; 32 + rev = version; 33 + sha256 = "BUbIhc8as/DVx8/4VeQS9emOLGcWFujNCxesSEEBqKQ="; 34 + }; 35 + 36 + postPatch = '' 37 + substituteInPlace setup.py --replace 'lark-parser == 0.8.*' 'lark-parser' 38 + substituteInPlace dragonfly/actions/keyboard/_x11_xdotool.py \ 39 + --replace 'xdotool = "xdotool"'${" "}'xdotool = "${xdotool}/bin/xdotool"' 40 + substituteInPlace dragonfly/windows/x11_window.py \ 41 + --replace 'xdotool = "xdotool"'${" "}'xdotool = "${xdotool}/bin/xdotool"' \ 42 + --replace 'xprop = "xprop"'${" "}'xprop = "${xorg.xprop}/bin/xprop"' \ 43 + --replace 'wmctrl = "wmctrl"'${" "}'wmctrl = "${wmctrl}/bin/wmctrl"' 44 + ''; 45 + 46 + propagatedBuildInputs = [ 47 + decorator 48 + packaging 49 + pynput 50 + regex 51 + lark-parser 52 + enum34 53 + pyperclip 54 + six 55 + requests 56 + psutil 57 + json-rpc 58 + werkzeug 59 + kaldi-active-grammar # for the Kaldi engine 60 + sounddevice 61 + webrtcvad 62 + setuptools # needs pkg_resources at runtime 63 + ]; 64 + 65 + # Too many tests fail because of the unusual environment or 66 + # because of the missing dependencies for some of the engines. 67 + doCheck = false; 68 + 69 + pythonImportsCheck = [ "dragonfly" ]; 70 + 71 + meta = with lib; { 72 + description = "Speech recognition framework allowing powerful Python-based scripting"; 73 + homepage = "https://github.com/dictation-toolbox/dragonfly"; 74 + license = licenses.lgpl3Plus; 75 + maintainers = with maintainers; [ ckie ]; 76 + }; 77 + }
+156
pkgs/development/python-modules/kaldi-active-grammar/0001-stub.patch
···
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 66e6d49..78f7b42 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -1,23 +1,6 @@ 6 + cmake_minimum_required(VERSION 3.13.0) 7 + project(kaldi_binaries) 8 + 9 + -include(ExternalProject) 10 + -include(ProcessorCount) 11 + - 12 + -ProcessorCount(NCPU) 13 + -if(NOT NCPU EQUAL 0) 14 + - set(MAKE_FLAGS -j${NCPU}) 15 + -endif() 16 + - 17 + -set(DST ${PROJECT_SOURCE_DIR}/kaldi_active_grammar/exec) 18 + -if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin") 19 + - set(DST ${DST}/macos/) 20 + -elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") 21 + - set(DST ${DST}/linux/) 22 + -else() 23 + - set(DST ${DST}/windows/) 24 + -endif() 25 + - 26 + set(BINARIES 27 + tools/openfst/bin/fstarcsort${CMAKE_EXECUTABLE_SUFFIX} 28 + tools/openfst/bin/fstcompile${CMAKE_EXECUTABLE_SUFFIX} 29 + @@ -29,63 +12,6 @@ set(LIBRARIES 30 + src/lib/libkaldi-dragonfly${CMAKE_SHARED_LIBRARY_SUFFIX} 31 + ) 32 + 33 + -# For MacOS, we handle all the "indirect" shared libraries manually. 34 + -if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin") 35 + - list(APPEND LIBRARIES 36 + - tools/openfst/lib/libfst${CMAKE_SHARED_LIBRARY_SUFFIX} 37 + - tools/openfst/lib/libfstscript${CMAKE_SHARED_LIBRARY_SUFFIX} 38 + - src/lib/libkaldi-base${CMAKE_SHARED_LIBRARY_SUFFIX} 39 + - src/lib/libkaldi-chain${CMAKE_SHARED_LIBRARY_SUFFIX} 40 + - src/lib/libkaldi-cudamatrix${CMAKE_SHARED_LIBRARY_SUFFIX} 41 + - src/lib/libkaldi-decoder${CMAKE_SHARED_LIBRARY_SUFFIX} 42 + - src/lib/libkaldi-feat${CMAKE_SHARED_LIBRARY_SUFFIX} 43 + - src/lib/libkaldi-fstext${CMAKE_SHARED_LIBRARY_SUFFIX} 44 + - src/lib/libkaldi-gmm${CMAKE_SHARED_LIBRARY_SUFFIX} 45 + - src/lib/libkaldi-hmm${CMAKE_SHARED_LIBRARY_SUFFIX} 46 + - src/lib/libkaldi-ivector${CMAKE_SHARED_LIBRARY_SUFFIX} 47 + - src/lib/libkaldi-lat${CMAKE_SHARED_LIBRARY_SUFFIX} 48 + - src/lib/libkaldi-lm${CMAKE_SHARED_LIBRARY_SUFFIX} 49 + - src/lib/libkaldi-matrix${CMAKE_SHARED_LIBRARY_SUFFIX} 50 + - src/lib/libkaldi-nnet2${CMAKE_SHARED_LIBRARY_SUFFIX} 51 + - src/lib/libkaldi-nnet3${CMAKE_SHARED_LIBRARY_SUFFIX} 52 + - src/lib/libkaldi-online2${CMAKE_SHARED_LIBRARY_SUFFIX} 53 + - src/lib/libkaldi-rnnlm${CMAKE_SHARED_LIBRARY_SUFFIX} 54 + - src/lib/libkaldi-transform${CMAKE_SHARED_LIBRARY_SUFFIX} 55 + - src/lib/libkaldi-tree${CMAKE_SHARED_LIBRARY_SUFFIX} 56 + - src/lib/libkaldi-util${CMAKE_SHARED_LIBRARY_SUFFIX} 57 + - ) 58 + -endif() 59 + - 60 + -if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") 61 + - message(FATAL_ERROR "CMake build not supported on Windows") 62 + - # FIXME: copy files? 63 + - # https://cmake.org/cmake/help/latest/command/foreach.html 64 + - # https://stackoverflow.com/questions/34799916/copy-file-from-source-directory-to-binary-directory-using-cmake 65 + -endif() 66 + - 67 + -find_program(MAKE_EXE NAMES make gmake nmake) 68 + - 69 + -if(DEFINED ENV{INTEL_MKL_DIR}) 70 + - # Default: INTEL_MKL_DIR=/opt/intel/mkl/ 71 + - message("Compiling with MKL in: $ENV{INTEL_MKL_DIR}") 72 + - set(KALDI_CONFIG_FLAGS --shared --static-math --use-cuda=no --mathlib=MKL --mkl-root=$ENV{INTEL_MKL_DIR}) 73 + - set(MATHLIB_BUILD_COMMAND true) 74 + -else() 75 + - message("Compiling with OpenBLAS") 76 + - set(KALDI_CONFIG_FLAGS --shared --static-math --use-cuda=no --mathlib=OPENBLAS) 77 + - set(MATHLIB_BUILD_COMMAND cd tools 78 + - && git clone -b v0.3.13 --single-branch https://github.com/xianyi/OpenBLAS 79 + - && ${MAKE_EXE} ${MAKE_FLAGS} -C OpenBLAS DYNAMIC_ARCH=1 TARGET=GENERIC USE_LOCKING=1 USE_THREAD=0 all 80 + - && ${MAKE_EXE} ${MAKE_FLAGS} -C OpenBLAS PREFIX=install install 81 + - && cd ..) 82 + -endif() 83 + - 84 + -if(DEFINED ENV{KALDI_BRANCH}) 85 + - set(KALDI_BRANCH $ENV{KALDI_BRANCH}) 86 + -else() 87 + - message(FATAL_ERROR "KALDI_BRANCH not set! Use 'origin/master'?") 88 + - # set(KALDI_BRANCH "origin/master") 89 + -endif() 90 + 91 + message("MAKE_EXE = ${MAKE_EXE}") 92 + message("PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}") 93 + @@ -99,63 +25,4 @@ message("CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}") 94 + 95 + # CXXFLAGS are set and exported in kaldi-configure-wrapper.sh 96 + 97 + -if(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") 98 + - set(STRIP_LIBS_COMMAND find src/lib tools/openfst/lib -name *${CMAKE_SHARED_LIBRARY_SUFFIX} | xargs strip) 99 + - set(STRIP_DST_COMMAND find ${DST} | xargs strip) 100 + - if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin") 101 + - list(APPEND STRIP_LIBS_COMMAND -x) 102 + - list(APPEND STRIP_DST_COMMAND -x) 103 + - endif() 104 + - ExternalProject_Add(kaldi 105 + - GIT_CONFIG advice.detachedHead=false 106 + - GIT_REPOSITORY https://github.com/daanzu/kaldi-fork-active-grammar.git 107 + - GIT_TAG ${KALDI_BRANCH} 108 + - GIT_SHALLOW TRUE 109 + - CONFIGURE_COMMAND sed -i.bak -e "s/status=0/exit 0/g" tools/extras/check_dependencies.sh && cp ${PROJECT_SOURCE_DIR}/building/kaldi-configure-wrapper.sh src/ 110 + - BUILD_IN_SOURCE TRUE 111 + - BUILD_COMMAND ${MATHLIB_BUILD_COMMAND} && cd tools && ${MAKE_EXE} ${MAKE_FLAGS} && cd openfst && autoreconf && cd ../../src && bash ./kaldi-configure-wrapper.sh ./configure ${KALDI_CONFIG_FLAGS} && ${MAKE_EXE} ${MAKE_FLAGS} depend && ${MAKE_EXE} ${MAKE_FLAGS} dragonfly dragonflybin bin fstbin lmbin 112 + - LIST_SEPARATOR " " 113 + - INSTALL_COMMAND ${STRIP_LIBS_COMMAND} && mkdir -p ${DST} && cp ${BINARIES} ${LIBRARIES} ${DST} 114 + - ) 115 + -endif() 116 + - 117 + -# Fix dynamic libraries loading paths on macOS. The libraries and 118 + -# executables are built with RPATH settings embedded in them, pointing 119 + -# to the locations in temporary directories used to build the 120 + -# binaries. After package installation is done, these directories are 121 + -# deleted and the dynamic libraries cannot be loaded. The following 122 + -# commands generate a shell script that fixes the paths to the dynamic 123 + -# libraries in the built executables and the libraries themselves. 124 + -# Also the commands add a custom target to invoke the generated script 125 + -# after the external project (kaldi) has been built. An alternative 126 + -# would be to change the kaldi engine build system to accept a path to 127 + -# where the binaries would be placed and point RPATH to that location. 128 + -if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin") 129 + - string (REPLACE ";" " " BINARIES_STR "${BINARIES}") 130 + - string (REPLACE ";" " " LIBRARIES_STR "${LIBRARIES}") 131 + - file(GENERATE OUTPUT name_fixer 132 + - CONTENT 133 + - "for a in ${BINARIES_STR} ; do 134 + - a_bare=$\{a##*/\} 135 + - install_name_tool -change ${PROJECT_BINARY_DIR}/kaldi-prefix/src/kaldi/tools/openfst-1.6.7/lib/libfst.10.dylib \"@loader_path/libfst.dylib\" ${DST}$a_bare 136 + - install_name_tool -change ${PROJECT_BINARY_DIR}/kaldi-prefix/src/kaldi/tools/openfst-1.6.7/lib/libfstscript.10.dylib \"@loader_path/libfstscript.dylib\" ${DST}$a_bare 137 + - for b in ${LIBRARIES_STR} ; do 138 + - b_bare=$\{b##*/\} 139 + - install_name_tool -change \"@rpath/$b_bare\" \"@loader_path/$b_bare\" ${DST}$a_bare 140 + - done 141 + - done 142 + - for a in ${LIBRARIES_STR} ; do 143 + - a_bare=$\{a##*/\} 144 + - install_name_tool -id \"@loader_path/$a_bare\" ${DST}$a_bare 145 + - install_name_tool -change ${PROJECT_BINARY_DIR}/kaldi-prefix/src/kaldi/tools/openfst-1.6.7/lib/libfst.10.dylib \"@loader_path/libfst.dylib\" ${DST}$a_bare 146 + - install_name_tool -change ${PROJECT_BINARY_DIR}/kaldi-prefix/src/kaldi/tools/openfst-1.6.7/lib/libfstscript.10.dylib \"@loader_path/libfstscript.dylib\" ${DST}$a_bare 147 + - for b in ${LIBRARIES_STR} ; do 148 + - b_bare=$\{b##*/\} 149 + - install_name_tool -change \"@rpath/$b_bare\" \"@loader_path/$b_bare\" ${DST}$a_bare 150 + - done 151 + - done") 152 + - add_custom_target(fixer ALL COMMAND /bin/sh name_fixer) 153 + - add_dependencies(fixer kaldi) 154 + -endif() 155 + - 156 + install(CODE "MESSAGE(\"Installed kaldi engine binaries.\")")
+34
pkgs/development/python-modules/kaldi-active-grammar/0002-exec-path.patch
···
··· 1 + diff --git a/kaldi_active_grammar/utils.py b/kaldi_active_grammar/utils.py 2 + index 0b70c7f..21e1d62 100644 3 + --- a/kaldi_active_grammar/utils.py 4 + +++ b/kaldi_active_grammar/utils.py 5 + @@ -79,7 +79,7 @@ elif sys.platform.startswith('linux'): platform = 'linux' 6 + elif sys.platform.startswith('darwin'): platform = 'macos' 7 + else: raise KaldiError("unknown sys.platform") 8 + 9 + -exec_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'exec', platform) 10 + +exec_dir = '/' 11 + library_extension = dict(windows='.dll', linux='.so', macos='.dylib')[platform] 12 + subprocess_seperator = '^&' if platform == 'windows' else ';' 13 + 14 + @@ -89,13 +89,13 @@ class ExternalProcess(object): 15 + 16 + shell = ush.Shell(raise_on_error=True) 17 + 18 + - fstcompile = shell(os.path.join(exec_dir, 'fstcompile')) 19 + - fstarcsort = shell(os.path.join(exec_dir, 'fstarcsort')) 20 + - fstaddselfloops = shell(os.path.join(exec_dir, 'fstaddselfloops')) 21 + - fstinfo = shell(os.path.join(exec_dir, 'fstinfo')) 22 + - # compile_graph = shell(os.path.join(exec_dir, 'compile-graph')) 23 + - compile_graph_agf = shell(os.path.join(exec_dir, 'compile-graph-agf')) 24 + - # compile_graph_agf_debug = shell(os.path.join(exec_dir, 'compile-graph-agf-debug')) 25 + + fstcompile = shell('fstcompile') 26 + + fstarcsort = shell('fstarcsort') 27 + + fstaddselfloops = shell('fstaddselfloops') 28 + + fstinfo = shell('fstinfo') 29 + + # compile_graph = shell('compile-graph') 30 + + compile_graph_agf = shell('compile-graph-agf') 31 + + # compile_graph_agf_debug = shell('compile-graph-agf-debug') 32 + 33 + make_lexicon_fst = shell([sys.executable, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'kaldi', 'make_lexicon_fst%s.py' % ('_py2' if PY2 else ''))]) 34 +
+13
pkgs/development/python-modules/kaldi-active-grammar/0003-ffi-path.patch
···
··· 1 + diff --git a/kaldi_active_grammar/ffi.py b/kaldi_active_grammar/ffi.py 2 + index 936ed35..1eb2f3d 100644 3 + --- a/kaldi_active_grammar/ffi.py 4 + +++ b/kaldi_active_grammar/ffi.py 5 + @@ -15,7 +15,7 @@ from cffi import FFI 6 + from .utils import exec_dir, platform 7 + 8 + _ffi = FFI() 9 + -_library_binary_path = os.path.join(exec_dir, dict(windows='kaldi-dragonfly.dll', linux='libkaldi-dragonfly.so', macos='libkaldi-dragonfly.dylib')[platform]) 10 + +_library_binary_path = os.path.join('@kaldiFork@', dict(windows='kaldi-dragonfly.dll', linux='libkaldi-dragonfly.so', macos='libkaldi-dragonfly.dylib')[platform]) 11 + _c_source_ignore_regex = re.compile(r'(\b(extern|DRAGONFLY_API)\b)|("C")|(//.*$)', re.MULTILINE) # Pattern for extraneous stuff to be removed 12 + 13 + def encode(text):
+20
pkgs/development/python-modules/kaldi-active-grammar/0004-fork-cmake.patch
···
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index ededc78b8..7ee1879a5 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -188,6 +188,7 @@ add_subdirectory(src/ivector) 6 + add_subdirectory(src/online) 7 + add_subdirectory(src/online2) 8 + add_subdirectory(src/kws) 9 + +add_subdirectory(src/dragonfly) 10 + 11 + add_subdirectory(src/itf) 12 + 13 + @@ -219,6 +220,7 @@ add_subdirectory(src/ivectorbin) 14 + add_subdirectory(src/onlinebin) 15 + add_subdirectory(src/online2bin) 16 + add_subdirectory(src/kwsbin) 17 + +add_subdirectory(src/dragonflybin) 18 + 19 + # add all cuda executables 20 + if(CUDA_FOUND)
+26
pkgs/development/python-modules/kaldi-active-grammar/0006-fork-configure.patch
···
··· 1 + diff --git a/src/configure b/src/configure 2 + index 1186c6d12..4ad355e64 100755 3 + --- a/src/configure 4 + +++ b/src/configure 5 + @@ -1045,9 +1045,6 @@ echo "AS = $AS" >> kaldi.mk 6 + echo "RANLIB = $RANLIB" >> kaldi.mk 7 + echo >> kaldi.mk 8 + 9 + -echo "Checking compiler $CXX ..." 10 + -check_compiler $CXX 11 + - 12 + echo "# Base configuration" >> kaldi.mk 13 + echo >> kaldi.mk 14 + if $dynamic_kaldi ; then 15 + @@ -1066,11 +1063,6 @@ if [ ! -f $FSTROOT/include/fst/fst.h ]; then 16 + failure "Could not find file $FSTROOT/include/fst/fst.h: 17 + you may not have installed OpenFst. See ../tools/INSTALL" 18 + fi 19 + -OPENFST_VER=${OPENFST_VER:-$(grep 'PACKAGE_VERSION' $FSTROOT/Makefile | sed -e 's:.*= ::')} 20 + -OPENFST_VER_NUM=$(echo $OPENFST_VER | sed 's/\./ /g' | xargs printf "%d%02d%02d") 21 + -if [ $OPENFST_VER_NUM -lt 10600 ]; then 22 + - failure "OpenFst-$OPENFST_VER is not supported. You need OpenFst >= 1.6.0.)" 23 + -fi 24 + echo "OPENFSTINC = $FSTROOT/include" >> kaldi.mk 25 + if $static_fst ; then 26 + OPENFSTLIBS="$FSTROOT/lib/libfst.a"
+61
pkgs/development/python-modules/kaldi-active-grammar/default.nix
···
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + , scikit-build 5 + , cmake 6 + , ush 7 + , requests 8 + , numpy 9 + , cffi 10 + , openfst 11 + , substituteAll 12 + , callPackage 13 + }: 14 + 15 + let 16 + kaldi = callPackage ./fork.nix { }; 17 + in 18 + buildPythonPackage rec { 19 + pname = "kaldi-active-grammar"; 20 + version = "2.1.0"; 21 + 22 + src = fetchFromGitHub { 23 + owner = "daanzu"; 24 + repo = pname; 25 + rev = "v${version}"; 26 + sha256 = "ArbwduoH7mMmIjlFfYAFvcpR39rrkVUJhYEyQzZqsbY="; 27 + }; 28 + 29 + KALDI_BRANCH = "foo"; 30 + KALDIAG_SETUP_RAW = "1"; 31 + 32 + patches = [ 33 + # Makes sure scikit-build doesn't try to build the dependencies for us 34 + ./0001-stub.patch 35 + # Uses the dependencies' binaries from $PATH instead of a specific directory 36 + ./0002-exec-path.patch 37 + # Makes it dynamically link to the correct Kaldi library 38 + (substituteAll { 39 + src = ./0003-ffi-path.patch; 40 + kaldiFork = "${kaldi}/lib"; 41 + }) 42 + ]; 43 + 44 + # scikit-build puts us in the wrong folder. That is bad. 45 + preBuild = '' 46 + cd .. 47 + ''; 48 + 49 + buildInputs = [ openfst kaldi ]; 50 + nativeBuildInputs = [ scikit-build cmake ]; 51 + propagatedBuildInputs = [ ush requests numpy cffi ]; 52 + 53 + meta = with lib; { 54 + description = "Python Kaldi speech recognition"; 55 + homepage = "https://github.com/daanzu/kaldi-active-grammar"; 56 + license = licenses.agpl3Plus; 57 + maintainers = with maintainers; [ ckie ]; 58 + # Other platforms are supported upstream. 59 + platforms = platforms.linux; 60 + }; 61 + }
+94
pkgs/development/python-modules/kaldi-active-grammar/fork.nix
···
··· 1 + { lib 2 + , stdenv 3 + , blas 4 + , lapack 5 + , openfst 6 + , icu 7 + , pkg-config 8 + , fetchFromGitHub 9 + , git 10 + , python3 11 + , openblas 12 + , zlib 13 + , gfortran 14 + }: 15 + 16 + let 17 + old-openfst = openfst.overrideAttrs (self: { 18 + src = fetchFromGitHub { 19 + owner = "kkm000"; 20 + repo = "openfst"; 21 + rev = "0bca6e76d24647427356dc242b0adbf3b5f1a8d9"; 22 + sha256 = "1802rr14a03zl1wa5a0x1fa412kcvbgprgkadfj5s6s3agnn11rx"; 23 + }; 24 + buildInputs = [ zlib ]; 25 + }); in 26 + 27 + assert blas.implementation == "openblas" && lapack.implementation == "openblas"; 28 + 29 + stdenv.mkDerivation rec { 30 + pname = "kaldi"; 31 + version = "kag-v2.1.0"; 32 + 33 + src = fetchFromGitHub { 34 + owner = "daanzu"; 35 + repo = "kaldi-fork-active-grammar"; 36 + rev = version; 37 + sha256 = "+kT2xJRwDj/ECv/v/J1FpsINWOK8XkP9ZvZ9moFRl70="; 38 + }; 39 + 40 + patches = [ 41 + ./0004-fork-cmake.patch 42 + ./0006-fork-configure.patch 43 + ]; 44 + 45 + enableParallelBuilding = true; 46 + 47 + buildInputs = [ 48 + openblas 49 + old-openfst 50 + icu 51 + ]; 52 + 53 + nativeBuildInputs = [ 54 + pkg-config 55 + python3 56 + gfortran 57 + ]; 58 + 59 + buildFlags = [ 60 + "dragonfly" 61 + "dragonflybin" 62 + "bin" 63 + "fstbin" 64 + "lmbin" 65 + ]; 66 + 67 + postPatch = '' 68 + # Replace the shebangs for the various build scripts 69 + patchShebangs src 70 + ''; 71 + 72 + configurePhase = '' 73 + cd src 74 + ./configure --shared --fst-root="${old-openfst}" --use-cuda=no --openblas-root="${openblas}" --mathlib=OPENBLAS 75 + ''; 76 + 77 + installPhase = '' 78 + # Fixes "patchelf: wrong ELF type" 79 + find . -type f -name "*.o" -print0 | xargs -0 rm -f 80 + mkdir -p $out/{bin,lib} 81 + cp lib/* $out/lib/ 82 + patchelf \ 83 + --set-rpath "${lib.makeLibraryPath buildInputs}:$out/lib" \ 84 + $out/lib/* 85 + ''; 86 + 87 + meta = with lib; { 88 + description = "Speech Recognition Toolkit"; 89 + homepage = "https://kaldi-asr.org"; 90 + license = licenses.mit; 91 + maintainers = with maintainers; [ ckie ]; 92 + platforms = platforms.linux; 93 + }; 94 + }
+27
pkgs/development/python-modules/ush/default.nix
···
··· 1 + { lib, buildPythonPackage, fetchFromGitHub, pytestCheckHook}: 2 + 3 + buildPythonPackage rec { 4 + pname = "ush"; 5 + version = "3.1.0"; 6 + 7 + src = fetchFromGitHub { 8 + owner = "tarruda"; 9 + repo = "python-ush"; 10 + rev = version; 11 + sha256 = "sha256-eL3vG3yS02enbLYorKvvYKbju9HInffUhrZgkodwhvo="; 12 + }; 13 + 14 + checkInputs = [ pytestCheckHook ]; 15 + 16 + disabledTestPaths = [ 17 + # seems to be outdated? 18 + "tests/test_glob.py" 19 + ]; 20 + 21 + meta = with lib; { 22 + description = "Powerful API for invoking with external commands"; 23 + homepage = "https://github.com/tarruda/python-ush"; 24 + license = licenses.mit; 25 + maintainers = with maintainers; [ ckie ]; 26 + }; 27 + }
+1 -1
pkgs/servers/pufferpanel/default.nix
··· 54 description = "A free, open source game management panel"; 55 homepage = "https://www.pufferpanel.com/"; 56 license = with licenses; [ asl20 ]; 57 - maintainers = with maintainers; [ ronthecookie ]; 58 }; 59 }
··· 54 description = "A free, open source game management panel"; 55 homepage = "https://www.pufferpanel.com/"; 56 license = with licenses; [ asl20 ]; 57 + maintainers = with maintainers; [ ckie ]; 58 }; 59 }
+1 -1
pkgs/tools/misc/zthrottle/default.nix
··· 21 description = "A program that throttles a pipeline, only letting a line through at most every $1 seconds."; 22 homepage = "https://github.com/anko/zthrottle"; 23 license = licenses.unlicense; 24 - maintainers = [ maintainers.ronthecookie ]; 25 platforms = platforms.unix; 26 }; 27 }
··· 21 description = "A program that throttles a pipeline, only letting a line through at most every $1 seconds."; 22 homepage = "https://github.com/anko/zthrottle"; 23 license = licenses.unlicense; 24 + maintainers = [ maintainers.ckie ]; 25 platforms = platforms.unix; 26 }; 27 }
+6
pkgs/top-level/python-packages.nix
··· 2261 2262 dpkt = callPackage ../development/python-modules/dpkt { }; 2263 2264 drf-jwt = callPackage ../development/python-modules/drf-jwt { }; 2265 2266 drf-nested-routers = callPackage ../development/python-modules/drf-nested-routers { }; ··· 4012 kaitaistruct = callPackage ../development/python-modules/kaitaistruct { }; 4013 4014 Kajiki = callPackage ../development/python-modules/kajiki { }; 4015 4016 kaptan = callPackage ../development/python-modules/kaptan { }; 4017 ··· 9475 user-agents = callPackage ../development/python-modules/user-agents { }; 9476 9477 userpath = callPackage ../development/python-modules/userpath { }; 9478 9479 utils = callPackage ../development/python-modules/utils { }; 9480
··· 2261 2262 dpkt = callPackage ../development/python-modules/dpkt { }; 2263 2264 + dragonfly = callPackage ../development/python-modules/dragonfly { }; 2265 + 2266 drf-jwt = callPackage ../development/python-modules/drf-jwt { }; 2267 2268 drf-nested-routers = callPackage ../development/python-modules/drf-nested-routers { }; ··· 4014 kaitaistruct = callPackage ../development/python-modules/kaitaistruct { }; 4015 4016 Kajiki = callPackage ../development/python-modules/kajiki { }; 4017 + 4018 + kaldi-active-grammar = callPackage ../development/python-modules/kaldi-active-grammar { }; 4019 4020 kaptan = callPackage ../development/python-modules/kaptan { }; 4021 ··· 9479 user-agents = callPackage ../development/python-modules/user-agents { }; 9480 9481 userpath = callPackage ../development/python-modules/userpath { }; 9482 + 9483 + ush = callPackage ../development/python-modules/ush { }; 9484 9485 utils = callPackage ../development/python-modules/utils { }; 9486