Skip to content

Commit a452f43

Browse files
committed
unix: link against Cocoa framework for tkinter
When debugging a separate tk issue, I noticed that tk's build system links against Cocoa in its latest version. So we should do the same.
1 parent bb072a5 commit a452f43

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

cpython-unix/static-modules.3.10.macos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _testimportmultiple _testimportmultiple.c
3434
_testinternalcapi _testinternalcapi.c -DPy_BUILD_CORE_MODULE
3535
_testmultiphase _testmultiphase.c
3636
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
37-
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
37+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework Cocoa -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
3838
_uuid _uuidmodule.c -Xlinker -hidden-luuid
3939
_xxsubinterpreters _xxsubinterpretersmodule.c
4040
_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c

cpython-unix/static-modules.3.8.macos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _scproxy _scproxy.c -framework SystemConfiguration -framework CoreFoundation
2929
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -Xlinker -hidden-lsqlite3
3030
_ssl _ssl.c -Xlinker -hidden-lssl -Xlinker -hidden-lcrypto
3131
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
32-
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
32+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework Cocoa -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
3333
_uuid _uuidmodule.c -Xlinker -hidden-luuid
3434
pyexpat pyexpat.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat
3535
readline readline.c -Xlinker -hidden-ledit -Xlinker -hidden-lncurses

cpython-unix/static-modules.3.9.macos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _testimportmultiple _testimportmultiple.c
3434
_testinternalcapi _testinternalcapi.c -DPy_BUILD_CORE_MODULE
3535
_testmultiphase _testmultiphase.c
3636
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
37-
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
37+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework Cocoa -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
3838
_uuid _uuidmodule.c -Xlinker -hidden-luuid
3939
_xxsubinterpreters _xxsubinterpretersmodule.c
4040
_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c

src/validation.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ static DARWIN_ALLOWED_DYLIBS: Lazy<Vec<MachOAllowedDylib>> = Lazy::new(|| {
269269
max_compatibility_version: "2.0.0".try_into().unwrap(),
270270
required: true,
271271
},
272+
MachOAllowedDylib {
273+
name: "/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa".to_string(),
274+
max_compatibility_version: "1.0.0".try_into().unwrap(),
275+
required: true,
276+
},
272277
MachOAllowedDylib {
273278
name:
274279
"/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"

0 commit comments

Comments
 (0)