nixpkgs/pkgs/development/interpreters/python/pypy/tk_tcl_paths.patch
Thiago Kenji Okada 284d9a1067 pypy27: 7.3.9 -> 7.3.11
Also build it with pythonInterpreters.pypy27_prebuilt instead of
python27, to avoid it being broken after #201859 is merged.

Keep in mind that the above change will make this derivation only work
with x86_64-linux for now (since pypy27_prebuilt is only packaged for
that platform). However support for newer platforms can be added later,
and a working package for one platform is better than a broken package
in 4 platforms.
2023-01-07 21:11:48 +00:00

30 lines
1.0 KiB
Diff

--- a/lib_pypy/_tkinter/tklib_build.py
+++ b/lib_pypy/_tkinter/tklib_build.py
@@ -17,23 +17,14 @@ elif sys.platform == 'win32':
incdirs = []
linklibs = ['tcl85', 'tk85']
libdirs = []
-elif sys.platform == 'darwin':
- # homebrew
- homebrew = os.environ.get('HOMEBREW_PREFIX', '')
- incdirs = ['/usr/local/opt/tcl-tk/include']
- linklibs = ['tcl8.6', 'tk8.6']
- libdirs = []
- if homebrew:
- incdirs.append(homebrew + '/include')
- libdirs.append(homebrew + '/opt/tcl-tk/lib')
else:
# On some Linux distributions, the tcl and tk libraries are
# stored in /usr/include, so we must check this case also
- libdirs = []
+ libdirs = ["@tcl@/lib", "@tk@/lib"]
found = False
for _ver in ['', '8.6', '8.5']:
- incdirs = ['/usr/include/tcl' + _ver]
- linklibs = ['tcl' + _ver, 'tk' + _ver]
+ incdirs = ['@tcl_dev@/include', '@tk_dev@/include']
+ linklibs = ['@tcl_libprefix@', '@tk_libprefix@']
if os.path.isdir(incdirs[0]):
found = True
break