From cc9a40868ea35267fc18e974d51b06041aeae6d0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 28 Sep 2020 13:50:54 +0530 Subject: [PATCH] Linux: Move the calibre extensions out of site-packages This means path based imports of them will continue to work even after freeze into single dir --- bypy/linux/__main__.py | 2 +- bypy/linux/util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bypy/linux/__main__.py b/bypy/linux/__main__.py index 97538a81b5..01adf0e253 100644 --- a/bypy/linux/__main__.py +++ b/bypy/linux/__main__.py @@ -146,7 +146,7 @@ def copy_python(env, ext_dir): shutil.copytree(c, j(dest, x), ignore=partial(ignore_in_lib, ignored_dirs={})) elif os.path.isfile(c): shutil.copy2(c, j(dest, x)) - pdir = j(dest, 'calibre', 'plugins') + pdir = j(env.lib_dir, 'calibre-extensions') if not os.path.exists(pdir): os.mkdir(pdir) for x in glob.glob(j(ext_dir, '*.so')): diff --git a/bypy/linux/util.c b/bypy/linux/util.c index db3ac864c2..9abb5658bd 100644 --- a/bypy/linux/util.c +++ b/bypy/linux/util.c @@ -38,7 +38,7 @@ get_paths() { swprintf(interpreter_data.python_lib_path, arraysz(interpreter_data.python_lib_path), L"%ls/lib/python%d.%d", interpreter_data.python_home_path, PY_VERSION_MAJOR, PY_VERSION_MINOR); swprintf(interpreter_data.resources_path, arraysz(interpreter_data.resources_path), L"%ls/resources", interpreter_data.python_home_path); - swprintf(interpreter_data.extensions_path, arraysz(interpreter_data.extensions_path), L"%ls/site-packages/calibre/plugins", interpreter_data.python_lib_path); + swprintf(interpreter_data.extensions_path, arraysz(interpreter_data.extensions_path), L"%ls/lib/calibre-extensions", interpreter_data.python_home_path); } void