Skip to content

Commit 02dc30d

Browse files
committed
Rename matplotlib symbols.
1 parent f26b796 commit 02dc30d

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

packages/np311-macos/matplotlib/build.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ def run(wheel_directory):
2525

2626
wheel_location = glob.glob(os.path.join("dist", "matplotlib-*.whl"))[0]
2727

28+
wheel_files = []
29+
with TemporaryDirectory() as tmpdir:
30+
with WheelFile(wheel_location) as wf:
31+
for filename in wf.namelist():
32+
wheel_files.append(filename)
33+
wf.extract(filename, tmpdir)
34+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib/_c_internal_utils.nuitkapython-311-darwin.a"), "matplotlib__c_internal_utils_", [".*fflush.*"])
35+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib/_image.nuitkapython-311-darwin.a"), "matplotlib__image_", [".*fflush.*"])
36+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib/_path.nuitkapython-311-darwin.a"), "matplotlib__path_", [".*fflush.*"])
37+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib/_qhull.nuitkapython-311-darwin.a"), "matplotlib__qhull_", [".*fflush.*"])
38+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib/_tri.nuitkapython-311-darwin.a"), "matplotlib__tri_", [".*fflush.*"])
39+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib/ft2font.nuitkapython-311-darwin.a"), "matplotlib_ft2font_", [".*fflush.*"])
40+
with WheelFile(wheel_location, 'w') as wf:
41+
for filename in wheel_files:
42+
wf.write(os.path.join(tmpdir, filename), filename)
43+
2844
wheel_name = os.path.basename(wheel_location)
2945
shutil.copy(wheel_location, os.path.join(wheel_directory, wheel_name))
3046
return os.path.join(wheel_directory, wheel_name)

packages/np311-windows/matplotlib/build.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ def run(wheel_directory):
2323
"-Csetup-args=-Dsystem-freetype=True")
2424

2525
wheel_location = glob.glob(os.path.join("dist", "matplotlib-*.whl"))[0]
26+
27+
os.environ["PATH"] = (os.path.dirname(__np__.find_build_tool_exe("7zip", "7z.exe")) + os.path.pathsep +
28+
os.path.dirname(__np__.find_build_tool_exe("mingw", "objdump.exe")) + os.path.pathsep + os.environ["PATH"])
29+
wheel_files = []
30+
with TemporaryDirectory() as tmpdir:
31+
with WheelFile(wheel_location) as wf:
32+
for filename in wf.namelist():
33+
wheel_files.append(filename)
34+
wf.extract(filename, tmpdir)
35+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib\\_backend_agg.lib"), "matplotlib__backend_agg_", [".*fflush.*"])
36+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib\\_c_internal_utils.lib"), "matplotlib__c_internal_utils_", [".*fflush.*"])
37+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib\\_image.lib"), "matplotlib__image_", [".*fflush.*"])
38+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib\\_path.lib"), "matplotlib__path_", [".*fflush.*"])
39+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib\\_qhull.lib"), "matplotlib__qhull_", [".*fflush.*"])
40+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib\\_tkagg.lib"), "matplotlib__tkagg_", [".*fflush.*"])
41+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib\\_tri.lib"), "matplotlib__tri_", [".*fflush.*"])
42+
__np__.rename_symbols_in_file(os.path.join(tmpdir, "matplotlib\\ft2font.lib"), "matplotlib_ft2font_", [".*fflush.*"])
43+
with WheelFile(wheel_location, 'w') as wf:
44+
for filename in wheel_files:
45+
wf.write(os.path.join(tmpdir, filename), filename)
46+
2647
wheel_name = os.path.basename(wheel_location)
2748
shutil.copy(wheel_location, os.path.join(wheel_directory, wheel_name))
2849
return os.path.join(wheel_directory, wheel_name)

0 commit comments

Comments
 (0)