From d7f8f6407fbabb8900f223c013dc4ed12be60fb6 Mon Sep 17 00:00:00 2001 From: Ihor Shevchuk Date: Mon, 19 Jun 2023 09:53:29 +0300 Subject: [PATCH] Swift Package Added Package.swift file that will allow to integrate flite library using Swift Package Manager. It is the very first step to interate flite to Apple's Voice Over. --- .gitignore | 2 + Package.swift | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 Package.swift diff --git a/.gitignore b/.gitignore index ff96f91..5cdb5da 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ config.status include/flite_version.h main/flite_lang_list.c main/flite_voice_list.c +.swiftpm +.build diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..afc45ac --- /dev/null +++ b/Package.swift @@ -0,0 +1,100 @@ +// swift-tools-version: 5.4 + +import Foundation +import PackageDescription + +let package = Package( + name: "flite", + products: [ + .library( + name: "flite", + targets: ["flite"]) + ], + dependencies: [ + ], + targets: [ + .target( + name: "flite", + dependencies: [ + ], + path:"", + exclude:[ + // Next files designed for specific OS and can't be built on Apple platforms + "src/audio/au_pulseaudio.c", + "src/audio/au_win.c", + "src/audio/au_alsa.c", + "src/audio/au_oss.c", + "src/audio/au_wince.c", + "src/audio/au_command.c", + "src/audio/au_palmos.c", + "src/audio/au_sun.c", + + "src/utils/cst_file_wince.c", + "src/utils/cst_file_palmos.c", + "src/utils/cst_mmap_none.c", + "src/utils/cst_file_wince.c", + "src/utils/cst_mmap_win32.c", + + "lang/cmu_us_rms/cmu_us_rms_voice.cpp", + "lang/cmulex/cmu_lex_num_bytes.c", + "lang/cmulex/cmu_lex_phones_huff_table.c", + "lang/cmulex/cmu_lex_entries_huff_table.c", + "lang/cmulex/cmu_lex_data_raw.c", + // Makefiles shoundn't be "build" + "src/Makefile", + "src/cg/Makefile", + "src/hrg/Makefile", + "src/lexicon/Makefile", + "src/regex/Makefile", + "src/speech/Makefile", + "src/stats/Makefile", + "src/synth/Makefile", + "src/utils/Makefile", + "src/wavesynth/Makefile", + "lang/cmu_indic_lang/Makefile", + "lang/cmu_indic_lex/Makefile", + "lang/cmu_time_awb/Makefile", + "lang/cmu_us_awb/Makefile", + "lang/cmu_us_kal/Makefile", + "lang/cmu_us_kal16/Makefile", + "lang/cmu_us_rms/Makefile", + "lang/cmu_us_slt/Makefile", + "lang/cmulex/Makefile", + "src/audio/Makefile", + "lang/usenglish/Makefile", + "lang/cmulex/make_cmulex", + "lang/usenglish/make_us_regexes", + "lang/usenglish/us_pos.tree", + // vcproj - Windows visual studio files + "lang/cmulex/libflite-cmulex.vcproj", + "lang/cmu_us_rms/cmu_us_rms.vcproj", + "lang/usenglish/libflite-usenglish.vcproj" + ], + sources:[ + // Main sources + "src", + // Voices sourses + "lang/cmu_us_slt/", + "lang/cmu_us_awb/", + "lang/cmu_indic_lang/", + "lang/cmu_indic_lex/", + "lang/cmu_time_awb/", + "lang/cmu_us_awb/", + "lang/cmu_us_kal/", + "lang/cmu_us_kal16/", + "lang/cmu_us_rms/", + "lang/usenglish/", + "lang/cmulex/" + ], + publicHeadersPath:"include/", + cSettings: [ + .headerSearchPath("include/**"), + .headerSearchPath("lang/**"), + .headerSearchPath("lang/usenglish/"), + .headerSearchPath("lang/cmulex/"), + ] + ) + ], + cLanguageStandard: .c17, + cxxLanguageStandard: .cxx17 +)