Skip to content

Commit ccf7aa2

Browse files
committed
unix: remove tk patches on macOS
These patches were added to avoid introducing symbols from modern macOS SDKs because of linking issues when using an older SDK. With the investigation in indygreg/PyOxidizer#373 and the conclusion to require a minimum SDK version to relink, it should be safe to introduce these symbols back into the binaries. I'm pretty certain that the symbol mentioned inline is already being pulled in by CPython 3.9 anyway. So these patches were arguably already out of date before the aforementioned policy change.
1 parent 2422255 commit ccf7aa2

File tree

1 file changed

+1
-84
lines changed

1 file changed

+1
-84
lines changed

cpython-unix/build-tk.sh

Lines changed: 1 addition & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -12,90 +12,7 @@ export PKG_CONFIG_PATH=${TOOLS_PATH}/deps/share/pkgconfig:${TOOLS_PATH}/deps/lib
1212

1313
tar -xf tk${TK_VERSION}-src.tar.gz
1414

15-
pushd tk${TK_VERSION}
16-
17-
if [ "${PYBUILD_PLATFORM}" = "macos" ]; then
18-
# The @available annotations create missing symbol errors
19-
# for ___isOSVersionAtLeast. We work around this by removing
20-
# their use.
21-
#
22-
# This is not an ideal solution.
23-
patch -p1 << EOF
24-
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
25-
index 80b368f..b51796e 100644
26-
--- a/macosx/tkMacOSXColor.c
27-
+++ b/macosx/tkMacOSXColor.c
28-
@@ -278,11 +278,9 @@ SetCGColorComponents(
29-
OSStatus err = noErr;
30-
NSColor *bgColor, *color = nil;
31-
CGFloat rgba[4] = {0, 0, 0, 1};
32-
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 101400
33-
NSInteger colorVariant;
34-
static CGFloat graphiteAccentRGBA[4] =
35-
{152.0 / 255, 152.0 / 255, 152.0 / 255, 1.0};
36-
-#endif
37-
38-
if (!deviceRGB) {
39-
deviceRGB = [NSColorSpace deviceRGBColorSpace];
40-
@@ -373,16 +371,6 @@ SetCGColorComponents(
41-
deviceRGB];
42-
break;
43-
case 8:
44-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
45-
- if (@available(macOS 10.14, *)) {
46-
- color = [[NSColor controlAccentColor] colorUsingColorSpace:
47-
- deviceRGB];
48-
- } else {
49-
- color = [NSColor colorWithColorSpace: deviceRGB
50-
- components: blueAccentRGBA
51-
- count: 4];
52-
- }
53-
-#else
54-
colorVariant = [[NSUserDefaults standardUserDefaults]
55-
integerForKey:@"AppleAquaColorVariant"];
56-
if (colorVariant == 6) {
57-
@@ -394,7 +382,6 @@ SetCGColorComponents(
58-
components: blueAccentRGBA
59-
count: 4];
60-
}
61-
-#endif
62-
break;
63-
default:
64-
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
65-
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
66-
index ceb3f3f..5c04f17 100644
67-
--- a/macosx/tkMacOSXWm.c
68-
+++ b/macosx/tkMacOSXWm.c
69-
@@ -5928,12 +5928,6 @@ WmWinAppearance(
70-
resultString = appearanceStrings[APPEARANCE_AUTO];
71-
} else if (appearance == NSAppearanceNameAqua) {
72-
resultString = appearanceStrings[APPEARANCE_AQUA];
73-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
74-
- } else if (@available(macOS 10.14, *)) {
75-
- if (appearance == NSAppearanceNameDarkAqua) {
76-
- resultString = appearanceStrings[APPEARANCE_DARKAQUA];
77-
- }
78-
-#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
79-
}
80-
result = Tcl_NewStringObj(resultString, strlen(resultString));
81-
}
82-
@@ -5953,12 +5947,6 @@ WmWinAppearance(
83-
NSAppearanceNameAqua];
84-
break;
85-
case APPEARANCE_DARKAQUA:
86-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
87-
- if (@available(macOS 10.14, *)) {
88-
- win.appearance = [NSAppearance appearanceNamed:
89-
- NSAppearanceNameDarkAqua];
90-
- }
91-
-#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
92-
break;
93-
default:
94-
win.appearance = nil;
95-
EOF
96-
fi
97-
98-
pushd unix
15+
pushd tk${TK_VERSION}/unix
9916

10017
CFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC"
10118
LDFLAGS="${EXTRA_TARGET_LDFLAGS}"

0 commit comments

Comments
 (0)