Support openssl's legacy module on windows as well

Le sigh
This commit is contained in:
Kovid Goyal 2023-10-10 19:53:09 +05:30
parent 299a5788e2
commit 6fe8e094f5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 10 additions and 4 deletions

View File

@ -128,10 +128,10 @@ def freeze(env, ext_dir, incdir):
printf('\tAdding misc binary deps')
def copybin(x):
shutil.copy2(x, env.dll_dir)
def copybin(x, dest=env.dll_dir):
shutil.copy2(x, dest)
with contextlib.suppress(FileNotFoundError):
shutil.copy2(x + '.manifest', env.dll_dir)
shutil.copy2(x + '.manifest', dest)
bindir = os.path.join(PREFIX, 'bin')
for x in ('pdftohtml', 'pdfinfo', 'pdftoppm', 'pdftotext', 'jpegtran-calibre', 'cjpeg-calibre', 'optipng-calibre', 'cwebp-calibre', 'JXRDecApp-calibre'):
@ -139,6 +139,10 @@ def freeze(env, ext_dir, incdir):
for f in glob.glob(os.path.join(bindir, '*.dll')):
if re.search(r'(easylzma|icutest)', f.lower()) is None:
copybin(f)
ossm = os.path.join(env.dll_dir, 'ossl-modules')
os.mkdir(ossm)
for f in glob.glob(os.path.join(PREFIX, 'lib', 'ossl-modules', '*.dll')):
copybin(f, ossm)
copybin(os.path.join(env.python_base, 'python%s.dll' % env.py_ver.replace('.', '')))
copybin(os.path.join(env.python_base, 'python%s.dll' % env.py_ver[0]))

View File

@ -43,6 +43,8 @@ get_app_dirw(void) {
static void
get_install_locations(void) {
get_app_dirw();
_snwprintf_s(qt_prefix_dir, MAX_PATH-1, _TRUNCATE, L"%ls\\ossl-modules", interpreter_data.executables_path);
_wputenv_s(L"OPENSSL_MODULES", qt_prefix_dir);
_snwprintf_s(qt_prefix_dir, MAX_PATH-1, _TRUNCATE, L"%ls\\app", interpreter_data.app_dir);
_wputenv_s(L"CALIBRE_QT_PREFIX", qt_prefix_dir);
}

View File

@ -1387,7 +1387,7 @@ def sanitize_env_vars():
'LD_LIBRARY_PATH':'/lib', 'OPENSSL_MODULES': '/lib/ossl-modules',
}
elif iswindows:
env_vars = {}
env_vars = {'OPENSSL_MODULES': None}
elif ismacos:
env_vars = {k:None for k in (
'FONTCONFIG_FILE FONTCONFIG_PATH SSL_CERT_FILE OPENSSL_ENGINES OPENSSL_MODULES').split()}