diff --git a/setup/extensions.json b/setup/extensions.json index 7fc30f2683..c07af3580d 100644 --- a/setup/extensions.json +++ b/setup/extensions.json @@ -184,6 +184,14 @@ "libraries": "SAPI Ole32", "cflags": "/X" }, + { + "name": "winspeech", + "only": "windows", + "headers": "calibre/utils/cpp_binding.h calibre/utils/windows/common.h", + "sources": "calibre/utils/windows/winspeech.cpp", + "libraries": "shlwapi runtimeobject", + "cflags": "/X" + }, { "name": "wpd", "only": "windows", diff --git a/setup/installers.py b/setup/installers.py index efc433b5d5..ba64955633 100644 --- a/setup/installers.py +++ b/setup/installers.py @@ -261,7 +261,7 @@ class ExtDev(Command): try: path = path.format(ext) src = os.path.join(ext_dir, os.path.basename(path)) - subprocess.check_call(['ssh', '-S', control_path, host, 'chmod', '+w', f'"{path}"']) + subprocess.check_call(['ssh', '-S', control_path, host, 'chmod', '+wx', f'"{path}"']) with open(src, 'rb') as f: p = subprocess.Popen(['ssh', '-S', control_path, host, f'cat - > "{path}"'], stdin=subprocess.PIPE) p.communicate(f.read()) diff --git a/src/calibre/constants.py b/src/calibre/constants.py index 3f82bb6d91..9691910808 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -269,7 +269,7 @@ class ExtensionsImporter: 'uchardet', ) if iswindows: - extra = ('winutil', 'wpd', 'winfonts', 'winsapi') + extra = ('winutil', 'wpd', 'winfonts', 'winsapi', 'winspeech') elif ismacos: extra = ('usbobserver', 'cocoa', 'libusb', 'libmtp') elif isfreebsd or ishaiku or islinux: diff --git a/src/calibre/utils/windows/winspeech.cpp b/src/calibre/utils/windows/winspeech.cpp new file mode 100644 index 0000000000..6af9621e26 --- /dev/null +++ b/src/calibre/utils/windows/winspeech.cpp @@ -0,0 +1,32 @@ +/* + * winspeech.cpp + * Copyright (C) 2023 Kovid Goyal + * + * Distributed under terms of the GPL3 license. + */ + +#include "common.h" + +#define M(name, args) { #name, name, args, ""} +static PyMethodDef methods[] = { + {NULL, NULL, 0, NULL} +}; +#undef M + + +static int +exec_module(PyObject *m) { + return 0; +} + +static PyModuleDef_Slot slots[] = { {Py_mod_exec, (void*)exec_module}, {0, NULL} }; + +static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT}; + +CALIBRE_MODINIT_FUNC PyInit_winspeech(void) { + module_def.m_name = "winspeech"; + module_def.m_doc = "Windows Speech API wrapper"; + module_def.m_methods = methods; + module_def.m_slots = slots; + return PyModuleDef_Init(&module_def); +} diff --git a/src/calibre/utils/windows/winspeech.py b/src/calibre/utils/windows/winspeech.py new file mode 100644 index 0000000000..c8d98cefa4 --- /dev/null +++ b/src/calibre/utils/windows/winspeech.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +# License: GPLv3 Copyright: 2023, Kovid Goyal + + +import calibre_extensions.winspeech as winspeech + +winspeech + + +def develop(): + pass