From 0d14a379750590d7d0d3181fd9df1efed15732e8 Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Sun, 15 Feb 2026 19:07:11 -0300 Subject: [PATCH] libgimp: Make build-time .gir patching on macOS consider other libs This does not fix any bug but reduces noise when some bug appears. --- libgimp/make-in-build-typelib.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libgimp/make-in-build-typelib.py b/libgimp/make-in-build-typelib.py index 6d37029097..3f8be09fef 100644 --- a/libgimp/make-in-build-typelib.py +++ b/libgimp/make-in-build-typelib.py @@ -26,8 +26,16 @@ tmp_gir_dir.mkdir(parents=True, exist_ok=True) tmp_gir_path = Path(f"{tmp_gir_dir}/{gir_name}") shutil.copy2(Path(f"{builddir}/{gir_name}"), tmp_gir_path) +def get_lib_path(p): + name = os.path.basename(p) + folder = name.split('-')[0] + #Exception: libgimpui is built inside the 'libgimp' directory + if folder == "libgimpui": + folder = "libgimp" + return f"{folder}/{name}" + text = Path(tmp_gir_path).read_text() -text = re.sub(r'shared-library="([^"]+)"', lambda m: 'shared-library="' + ",".join("libgimp/" + os.path.basename(p) for p in m.group(1).split(",")) + '"', text) +text = re.sub(r'shared-library="([^"]+)"', lambda m: 'shared-library="' + ",".join(get_lib_path(p) for p in m.group(1).split(",")) + '"', text) Path(tmp_gir_path).write_text(text) subprocess.run(["g-ir-compiler", f"--includedir={tmp_gir_dir}", f"--includedir={prefix}/share/gir-1.0/", str(tmp_gir_path), "-o", tmp_gir_dir / typelib_name], check=True)