Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ if(WITH_PY)
${sources_dir}/punctuator.cpp
${sources_dir}/fasterwhisper_engine.hpp
${sources_dir}/fasterwhisper_engine.cpp
${sources_dir}/canary_engine.hpp
${sources_dir}/canary_engine.cpp
${sources_dir}/mimic3_engine.hpp
${sources_dir}/mimic3_engine.cpp
${sources_dir}/parler_engine.cpp
Expand All @@ -442,18 +444,24 @@ endif()
configure_file(config.h.in config.h)

# qt version selection
set(QT_VERSION_MAJOR "" CACHE STRING "Qt major version to use. Empty selects the platform default.")
set_property(CACHE QT_VERSION_MAJOR PROPERTY STRINGS "" 5 6)

if(WITH_SFOS)
# on sfos use qt5
find_package(Qt5 COMPONENTS Core REQUIRED)
set(QT_VERSION_MAJOR 5)
message(STATUS "Using Qt5")
else()
# on everything else use qt6
find_package(Qt6 COMPONENTS Core REQUIRED)
set(QT_VERSION_MAJOR 6)
message(STATUS "Using Qt6")
if(NOT "${QT_VERSION_MAJOR}" STREQUAL "" AND
NOT "${QT_VERSION_MAJOR}" STREQUAL "5")
message(FATAL_ERROR "Sailfish OS builds require Qt5")
endif()
set(QT_VERSION_MAJOR 5 CACHE STRING "Qt major version to use" FORCE)
elseif("${QT_VERSION_MAJOR}" STREQUAL "")
set(QT_VERSION_MAJOR 6 CACHE STRING "Qt major version to use" FORCE)
elseif(NOT "${QT_VERSION_MAJOR}" MATCHES "^[56]$")
message(FATAL_ERROR "QT_VERSION_MAJOR must be 5 or 6")
endif()

find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
message(STATUS "Using Qt${QT_VERSION_MAJOR}")

include(${cmake_path}/dbus_api.cmake)

add_library(dsnote_lib STATIC ${dsnote_lib_sources})
Expand Down Expand Up @@ -564,7 +572,7 @@ pkg_search_module(pulse REQUIRED libpulse)
list(APPEND deps_libs ${pulse_LIBRARIES})
list(APPEND includes ${pulse_INCLUDE_DIRS})

find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Multimedia Qml Xml Sql Gui Quick DBus LinguistTools REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Multimedia Qml Xml Sql Gui Quick DBus REQUIRED)
list(APPEND deps_libs Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Multimedia
Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::DBus Qt${QT_VERSION_MAJOR}::Xml Qt${QT_VERSION_MAJOR}::Sql)
Expand Down Expand Up @@ -603,7 +611,7 @@ if(WITH_DESKTOP)

# Qt6 removed X11Extras - functionality moved to Qt6::Gui
# Qt5 needs X11Extras
if(QT_VERSION_MAJOR EQUAL 5)
if("${QT_VERSION_MAJOR}" STREQUAL "5")
find_package(Qt5 COMPONENTS X11Extras REQUIRED)
list(APPEND deps_libs Qt5::X11Extras)
endif()
Expand Down
24 changes: 15 additions & 9 deletions cmake/dbus_api.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ configure_file(${dbus_dir}/dsnote.xml.in ${dbus_dsnote_interface_file})

find_package(Qt${QT_VERSION_MAJOR} COMPONENTS DBus REQUIRED)

if(NOT DEFINED QT_CMAKE_EXPORT_NAMESPACE)
set(qdbusxml2cpp_target Qt${QT_VERSION_MAJOR}::qdbusxml2cpp)
if(TARGET ${qdbusxml2cpp_target})
set(qdbusxml2cpp_bin ${qdbusxml2cpp_target})
elseif(DEFINED QT_CMAKE_EXPORT_NAMESPACE AND
TARGET ${QT_CMAKE_EXPORT_NAMESPACE}::qdbusxml2cpp)
set(qdbusxml2cpp_bin ${QT_CMAKE_EXPORT_NAMESPACE}::qdbusxml2cpp)
else()
unset(qdbusxml2cpp_bin CACHE)
find_program(qdbusxml2cpp_bin qdbusxml2cpp)
if(${qdbusxml2cpp_bin} MATCHES "-NOTFOUND$")
find_program(qdbusxml2cpp_bin qdbusxml2cpp-qt5)
if(${qdbusxml2cpp_bin} MATCHES "-NOTFOUND$")
message(FATAL_ERROR "qdbusxml2cpp not found but it is required")
endif()
find_program(qdbusxml2cpp_bin
NAMES qdbusxml2cpp qdbusxml2cpp-qt5
HINTS
"/usr/lib64/qt${QT_VERSION_MAJOR}/bin"
"/usr/lib/qt${QT_VERSION_MAJOR}/bin"
"/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/qt${QT_VERSION_MAJOR}/bin")
if(NOT qdbusxml2cpp_bin)
message(FATAL_ERROR "qdbusxml2cpp not found but it is required")
endif()
else()
set(qdbusxml2cpp_bin ${QT_CMAKE_EXPORT_NAMESPACE}::qdbusxml2cpp)
endif()

add_custom_command(
Expand Down
16 changes: 14 additions & 2 deletions cmake/translations.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ set(enabled_translations ar ca_ES cs de en es fr fr_CA it nl no pt_BR pl ru sv s
set(enabled_translations ar ca_ES de en es fr fr_CA it nl no pt_BR pl ru sv sl tr_TR uk zh_CN zh_TW)

# QT_VERSION_MAJOR is set in main CMakeLists.txt
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core LinguistTools)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core LinguistTools QUIET)
if(NOT Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
if("${QT_VERSION_MAJOR}" STREQUAL "5")
message(FATAL_ERROR
"Qt5 LinguistTools is required to build translations. "
"Install the Qt5 translation tools package, e.g. "
"dev-qt/linguist-tools on Gentoo, qt5-linguist on Fedora, "
"or qttools5-dev-tools on Debian/Ubuntu.")
else()
message(FATAL_ERROR
"Qt6 LinguistTools is required to build translations.")
endif()
endif()

set(ts_files "")
foreach(lang ${enabled_translations})
Expand All @@ -25,7 +37,7 @@ function(ADD_TRANSLATIONS_RESOURCE res_file)
set(${res_file} ${_res_file} PARENT_SCOPE)
endfunction()

if(QT_VERSION_MAJOR EQUAL 6)
if("${QT_VERSION_MAJOR}" STREQUAL "6")
qt6_create_translation(qm_files ${CMAKE_SOURCE_DIR}/src ${desktop_dir}/qml ${sfos_dir}/qml ${ts_files})
else()
if(WITH_SFOS)
Expand Down
71 changes: 53 additions & 18 deletions config/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -36239,16 +36239,51 @@
"speaker": "zm_yunxia",
"options": "a"
},
{
"name": "中文 (Kokoro 82M Yunyang Male)",
"model_id": "zh_kokoro_82m_zm_yunyang",
"model_alias_of": "multilang_kokoro_82m",
"pack_id": "zh_kokoro_82m",
"lang_id": "zh",
"speaker": "zm_yunyang",
"options": "a"
}
],
{
"name": "中文 (Kokoro 82M Yunyang Male)",
"model_id": "zh_kokoro_82m_zm_yunyang",
"model_alias_of": "multilang_kokoro_82m",
"pack_id": "zh_kokoro_82m",
"lang_id": "zh",
"speaker": "zm_yunyang",
"options": "a"
},
{
"name": "Multilingual (Canary 1B v2)",
"model_id": "multilang_canary_1b_v2",
"file_name": "canary-1b-v2.nemo",
"engine": "stt_canary",
"lang_id": "multilang",
"info": "NVIDIA Canary 1B v2 - multilingual ASR and speech translation",
"options": "ti",
"score": 5,
"checksum": "sha256:ae5ef1bf06812a95a1594a8f5f0ee9c51f35418e5ba96939fa6b98ab00431094",
"checksum_quick": "647d6498",
"urls": [
"hf://nvidia/canary-1b-v2/canary-1b-v2.nemo?revision=87bc52657add533cd0156b3fc1aef027280754bf"
],
"size": "6358958080",
"features": [
"high_quality",
"slow_processing",
"stt_punctuation"
],
"license": {
"id": "CC-BY-4.0",
"name": "Creative Commons Attribution 4.0 International",
"url": "https://creativecommons.org/licenses/by/4.0/",
"accept_required": false
}
},
{
"name": "English (Canary 1B v2)",
"model_id": "en_canary_1b_v2",
"model_alias_of": "multilang_canary_1b_v2",
"lang_id": "en",
"lang_code": "en",
"score": 5
}
],
"packs": [
{
"name": "English (April-ASR)",
Expand Down Expand Up @@ -37171,14 +37206,14 @@
"engine": "stt_whisper",
"lang_id": "yo"
},
{
"name": "中文 (FasterWhisper)",
"id": "zh_fasterwhisper",
"engine": "stt_fasterwhisper",
"lang_id": "zh"
},
{
"name": "中文 (WhisperCpp)",
{
"name": "中文 (FasterWhisper)",
"id": "zh_fasterwhisper",
"engine": "stt_fasterwhisper",
"lang_id": "zh"
},
{
"name": "中文 (WhisperCpp)",
"id": "zh_whisper",
"engine": "stt_whisper",
"lang_id": "zh"
Expand Down
Loading