python3Packages.kaldi-active-grammar: fix build
Update patches
This commit is contained in:
parent
92faf51e39
commit
17e776eeb5
@ -1,8 +1,8 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 66e6d49..78f7b42 100644
|
||||
index 17c7032..12ed398 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,23 +1,6 @@
|
||||
@@ -1,87 +1,12 @@
|
||||
cmake_minimum_required(VERSION 3.13.0)
|
||||
project(kaldi_binaries)
|
||||
|
||||
@ -24,9 +24,8 @@ index 66e6d49..78f7b42 100644
|
||||
-endif()
|
||||
-
|
||||
set(BINARIES
|
||||
tools/openfst/bin/fstarcsort${CMAKE_EXECUTABLE_SUFFIX}
|
||||
tools/openfst/bin/fstcompile${CMAKE_EXECUTABLE_SUFFIX}
|
||||
@@ -29,63 +12,6 @@ set(LIBRARIES
|
||||
)
|
||||
set(LIBRARIES
|
||||
src/lib/libkaldi-dragonfly${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
)
|
||||
|
||||
@ -87,30 +86,33 @@ index 66e6d49..78f7b42 100644
|
||||
- message(FATAL_ERROR "KALDI_BRANCH not set! Use 'origin/master'?")
|
||||
- # set(KALDI_BRANCH "origin/master")
|
||||
-endif()
|
||||
|
||||
-
|
||||
message("MAKE_EXE = ${MAKE_EXE}")
|
||||
message("PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}")
|
||||
@@ -99,63 +25,4 @@ message("CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}")
|
||||
message("PYTHON_INCLUDE_DIR = ${PYTHON_INCLUDE_DIR}")
|
||||
@@ -94,65 +19,4 @@ message("CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
# CXXFLAGS are set and exported in kaldi-configure-wrapper.sh
|
||||
|
||||
-if(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
|
||||
- set(STRIP_LIBS_COMMAND find src/lib tools/openfst/lib -name *${CMAKE_SHARED_LIBRARY_SUFFIX} | xargs strip)
|
||||
- set(STRIP_DST_COMMAND find ${DST} | xargs strip)
|
||||
- # set(STRIP_DST_COMMAND find ${DST} [[[other specifiers]]] | xargs strip)
|
||||
- if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin")
|
||||
- list(APPEND STRIP_LIBS_COMMAND -x)
|
||||
- list(APPEND STRIP_DST_COMMAND -x)
|
||||
- # list(APPEND STRIP_DST_COMMAND -x)
|
||||
- endif()
|
||||
- # set(STRIP_LIBS_COMMAND true)
|
||||
- set(STRIP_DST_COMMAND true)
|
||||
- ExternalProject_Add(kaldi
|
||||
- GIT_CONFIG advice.detachedHead=false
|
||||
- GIT_REPOSITORY https://github.com/daanzu/kaldi-fork-active-grammar.git
|
||||
- GIT_TAG ${KALDI_BRANCH}
|
||||
- GIT_SHALLOW TRUE
|
||||
- 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/
|
||||
- CONFIGURE_COMMAND sed -i.bak -e "s/status=0/exit 0/g" tools/extras/check_dependencies.sh && sed -i.bak -e "s/openfst_add_CXXFLAGS = -g -O2/openfst_add_CXXFLAGS = -g0 -O3/g" tools/Makefile && cp ${PROJECT_SOURCE_DIR}/building/kaldi-configure-wrapper.sh src/
|
||||
- BUILD_IN_SOURCE TRUE
|
||||
- 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
|
||||
- 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
|
||||
- LIST_SEPARATOR " "
|
||||
- INSTALL_COMMAND ${STRIP_LIBS_COMMAND} && mkdir -p ${DST} && cp ${BINARIES} ${LIBRARIES} ${DST}
|
||||
- INSTALL_COMMAND ${STRIP_LIBS_COMMAND} && mkdir -p ${DST} && cp ${BINARIES} ${LIBRARIES} ${DST} && ${STRIP_DST_COMMAND}
|
||||
- )
|
||||
-endif()
|
||||
-
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git a/kaldi_active_grammar/utils.py b/kaldi_active_grammar/utils.py
|
||||
index 0b70c7f..21e1d62 100644
|
||||
index 823f997..3850336 100644
|
||||
--- a/kaldi_active_grammar/utils.py
|
||||
+++ b/kaldi_active_grammar/utils.py
|
||||
@@ -79,7 +79,7 @@ elif sys.platform.startswith('linux'): platform = 'linux'
|
||||
@ -8,10 +8,10 @@ index 0b70c7f..21e1d62 100644
|
||||
|
||||
-exec_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'exec', platform)
|
||||
+exec_dir = '/'
|
||||
library_extension = dict(windows='.dll', linux='.so', macos='.dylib')[platform]
|
||||
subprocess_seperator = '^&' if platform == 'windows' else ';'
|
||||
|
||||
@@ -89,13 +89,13 @@ class ExternalProcess(object):
|
||||
import ush
|
||||
|
||||
@@ -87,13 +87,13 @@ class ExternalProcess(object):
|
||||
|
||||
shell = ush.Shell(raise_on_error=True)
|
||||
|
||||
|
@ -50,6 +50,8 @@ buildPythonPackage rec {
|
||||
nativeBuildInputs = [ scikit-build cmake ];
|
||||
propagatedBuildInputs = [ ush requests numpy cffi ];
|
||||
|
||||
doCheck = false; # no tests exist
|
||||
|
||||
meta = with lib; {
|
||||
description = "Python Kaldi speech recognition";
|
||||
homepage = "https://github.com/daanzu/kaldi-active-grammar";
|
||||
|
Loading…
Reference in New Issue
Block a user