Skip to content

Commit 13a392a

Browse files
committed
Force-remove libobjc.A.dylib from CoreFoundation.tbd
1 parent 7ed6e07 commit 13a392a

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

build.sh

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,21 @@ patch_corefoundation_tbd() {
4949
local tbd_path=$1
5050

5151
python3 - "$tbd_path" <<'PY'
52-
import re
5352
import sys
5453
from pathlib import Path
5554
5655
tbd_path = Path(sys.argv[1])
57-
text = tbd_path.read_text()
58-
59-
text = re.sub(
60-
r"reexported-libraries:\s*(\n\s*-\s*/usr/lib/libobjc\.A\.dylib\s*)+",
61-
"reexported-libraries: []\n",
62-
text,
63-
)
64-
text = re.sub(
65-
r"reexported-libraries:\s*\[\s*/usr/lib/libobjc\.A\.dylib\s*\]\s*",
66-
"reexported-libraries: []\n",
67-
text,
68-
)
69-
70-
tbd_path.write_text(text)
56+
lines = tbd_path.read_text().splitlines()
57+
updated = []
58+
59+
for line in lines:
60+
if "libobjc.A.dylib" in line:
61+
if "reexported-libraries" in line:
62+
updated.append("reexported-libraries: []")
63+
continue
64+
updated.append(line)
65+
66+
tbd_path.write_text("\n".join(updated) + "\n")
7167
PY
7268
}
7369

0 commit comments

Comments
 (0)