kaldi: fix build (#412663)

This commit is contained in:
Vladimír Čunát
2025-05-31 16:54:42 +02:00
2 changed files with 29 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
From 580bd3f0fea7ddc913329537070ab08fd3bf6033 Mon Sep 17 00:00:00 2001
From: matthiasdotsh <git@matthias.sh>
Date: Mon, 26 May 2025 11:22:01 +0200
Subject: [PATCH] Fix build for gcc >=14
---
src/include/fst/fst.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/include/fst/fst.h b/src/include/fst/fst.h
index 20e6bb3..2cb1364 100644
--- a/src/include/fst/fst.h
+++ b/src/include/fst/fst.h
@@ -652,8 +652,8 @@ class FstImpl {
FstImpl &operator=(const FstImpl<Arc> &impl) {
properties_ = impl.properties_;
type_ = impl.type_;
- isymbols_ = impl.isymbols_ ? impl.isymbols_->Copy() : nullptr;
- osymbols_ = impl.osymbols_ ? impl.osymbols_->Copy() : nullptr;
+ isymbols_ = impl.isymbols_ ? std::unique_ptr<fst::SymbolTable>(impl.isymbols_->Copy()) : nullptr;
+ osymbols_ = impl.osymbols_ ? std::unique_ptr<fst::SymbolTable>(impl.osymbols_->Copy()) : nullptr;
return *this;
}
+5 -1
View File
@@ -62,6 +62,8 @@ stdenv.mkDerivation (finalAttrs: {
cp -r ../egs $out/share/kaldi
'';
dontCheckForBrokenSymlinks = true; #TODO: investigate
passthru = {
sources = {
# rev from https://github.com/kaldi-asr/kaldi/blob/master/cmake/third_party/openfst.cmake
@@ -69,7 +71,9 @@ stdenv.mkDerivation (finalAttrs: {
owner = "kkm000";
repo = "openfst";
rev = "338225416178ac36b8002d70387f5556e44c8d05";
hash = "sha256-MGEUuw7ex+WcujVdxpO2Bf5sB6Z0edcAeLGqW/Lo1Hs=";
hash = "sha256-y1E6bQgBfYt1Co02UutOyEM2FnETuUl144tHwypiX+M=";
# https://github.com/kkm000/openfst/issues/59
postFetch = ''(cd "$out"; patch -p1 < '${./gcc14.patch}')'';
};
};