@@ -477,6 +477,12 @@ def lib_platform_files(dirname, names):
477477 or name == "build-details.json"
478478 )
479479 }
480+ elif path .parts [- 1 ] == "lib" :
481+ ignored_names = {
482+ name
483+ for name in names
484+ if name .startswith ("libpython" ) and name .endswith (".dylib" )
485+ }
480486 else :
481487 ignored_names = set ()
482488
@@ -614,6 +620,12 @@ def create_xcframework(platform: str) -> str:
614620 slice_framework / "Headers/pyconfig.h" ,
615621 )
616622
623+ print (f" - { slice_name } shared library" )
624+ # Create a simlink for the fat library
625+ shared_lib = slice_path / f"lib/libpython{ version_tag } .dylib"
626+ shared_lib .parent .mkdir ()
627+ shared_lib .symlink_to ("../Python.framework/Python" )
628+
617629 print (f" - { slice_name } architecture-specific files" )
618630 for host_triple , multiarch in slice_parts .items ():
619631 print (f" - { multiarch } standard library" )
@@ -625,13 +637,15 @@ def create_xcframework(platform: str) -> str:
625637 framework_path (host_triple , multiarch ) / "lib" ,
626638 package_path / "Python.xcframework/lib" ,
627639 ignore = lib_platform_files ,
640+ symlinks = True ,
628641 )
629642 has_common_stdlib = True
630643
631644 shutil .copytree (
632645 framework_path (host_triple , multiarch ) / "lib" ,
633646 slice_path / f"lib-{ arch } " ,
634647 ignore = lib_non_platform_files ,
648+ symlinks = True ,
635649 )
636650
637651 # Copy the host's pyconfig.h to an architecture-specific name.
0 commit comments