Fix loading of legacy openssl module on Linux frozen build

Needed by podofo unconditionally even though we dont actually use
encryption.
This commit is contained in:
Kovid Goyal 2023-10-01 14:48:36 +05:30
parent c09d5c9e68
commit 07e47871a7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 9 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import time
from functools import partial
from bypy.constants import (
OUTPUT_DIR, PREFIX, SRC as CALIBRE_DIR, python_major_minor_version,
LIBDIR, OUTPUT_DIR, PREFIX, SRC as CALIBRE_DIR, python_major_minor_version,
)
from bypy.freeze import (
extract_extension_modules, fix_pycryptodome, freeze_python, is_package_dir,
@ -125,6 +125,8 @@ def copy_libs(env):
os.chmod(j(
dest, os.path.basename(x)),
stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
for x in ('ossl-modules',):
shutil.copytree(os.path.join(LIBDIR, x), os.path.join(env.lib_dir, x))
base = j(QT_PREFIX, 'plugins')
dest = j(env.lib_dir, '..', 'plugins')

View File

@ -42,6 +42,9 @@ int main(int argc, char **argv) {
if (ret < 0 || ret > (PATHLEN-2)) { fprintf(stderr, "LD_LIBRARY_PATH too long: %s:%s", lib, ldp); return 1; }
}
SET("LD_LIBRARY_PATH", buf)
ret = snprintf(buf, PATHLEN, "%s/ossl-modules", lib);
if (ret < 0 || ret > (PATHLEN-2)) { fprintf(stderr, "OPENSSL_MODULES too long: %s/ossl-modules", lib); return 1; }
SET("OPENSSL_MODULES", buf)
argv[0] = exe;
if (execv(exe, argv) == -1) {

View File

@ -1383,7 +1383,9 @@ def sanitize_env_vars():
is needed to prevent library conflicts when launching external utilities.'''
if islinux and isfrozen:
env_vars = {'LD_LIBRARY_PATH':'/lib'}
env_vars = {
'LD_LIBRARY_PATH':'/lib', 'OPENSSL_MODULES': '/lib/ossl-modules',
}
elif iswindows:
env_vars = {}
elif ismacos: