Skip to content

Commit

Permalink
在macOS arm64上使用tkinterdnd2-osxarm64
Browse files Browse the repository at this point in the history
  • Loading branch information
TransparentLC committed Mar 16, 2023
1 parent 84dbe5d commit 740cd52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pyi-hooks/hook-tkinterdnd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@

s = platform.system()
p = {
'Windows': ('win64', {'tkdnd_unix.tcl', 'tkdnd_macosx.tcl'}),
'Linux': ('linux64', {'tkdnd_windows.tcl', 'tkdnd_macosx.tcl'}),
'Darwin': ('osx64', {'tkdnd_windows.tcl', 'tkdnd_unix.tcl'}),
'Windows': ({'win64'}, {'tkdnd_unix.tcl', 'tkdnd_macosx.tcl'}),
'Linux': ({'linux64'}, {'tkdnd_windows.tcl', 'tkdnd_macosx.tcl'}),
'Darwin': ({'osx64', 'osx64arm'}, {'tkdnd_windows.tcl', 'tkdnd_unix.tcl'}),
}
if s in p:
datas = set([
x for x in (
*collect_data_files('tkinterdnd2'),
*collect_dynamic_libs('tkinterdnd2'),
)
if os.path.split(x[1])[1] == p[s][0] and os.path.split(x[0])[1] not in p[s][1]
if os.path.split(x[1])[1] in p[s][0] and os.path.split(x[0])[1] not in p[s][1]
])
else:
raise RuntimeError(f'TkinterDnD2 is not supported on platform "{s}".')
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ darkdetect == 0.8.*
notify-py == 0.3.*
pillow == 9.*
tkinterdnd2 == 0.3.*; sys_platform != 'darwin' or platform_machine != 'arm64'
git+https://github.com/blacklein/tkinterdnd2@master; sys_platform == 'darwin' and platform_machine == 'arm64'
# https://github.com/TransparentLC/realesrgan-gui/issues/18#issuecomment-1469605298
tkinterdnd2-osxarm64 == 0.3.*; sys_platform == 'darwin' and platform_machine == 'arm64'

0 comments on commit 740cd52

Please sign in to comment.