diff --git a/qt/aqt/package.py b/qt/aqt/package.py index 6bece47d1..ace75ca23 100644 --- a/qt/aqt/package.py +++ b/qt/aqt/package.py @@ -68,6 +68,10 @@ def _patch_certifi() -> None: certifi.where = where +def _fix_protobuf_path() -> None: + sys.path.append(str(Path(sys.prefix) / "../Resources")) + + def packaged_build_setup() -> None: if not getattr(sys, "frozen", False): return @@ -76,6 +80,8 @@ def packaged_build_setup() -> None: if sys.platform == "win32": _fix_pywin32() + elif sys.platform == "darwin": + _fix_protobuf_path() _patch_pkgutil() _patch_certifi() diff --git a/qt/bundle/mac/src/main.rs b/qt/bundle/mac/src/main.rs index 81c9559e6..d0d3bcb49 100644 --- a/qt/bundle/mac/src/main.rs +++ b/qt/bundle/mac/src/main.rs @@ -135,7 +135,10 @@ fn make_app(kind: DistKind, mut plist: plist::Dictionary, stamp: &Utf8Path) -> R let path_str = relative_path.to_str().unwrap(); if path_str.contains("libankihelper") { builder.add_file_macos("libankihelper.dylib", entry)?; - } else if path_str.contains("aqt/data") || path_str.contains("certifi") { + } else if path_str.contains("aqt/data") + || path_str.contains("certifi") + || path_str.contains("google/protobuf") + { builder.add_file_resources(relative_path.strip_prefix("lib").unwrap(), entry)?; } else { if path_str.contains("__pycache__") {