Mercurial > hgrepos > FreeBSD > ports > PyPy
diff files/py37/patch-lib-python_3_sysconfig.py @ 101:962a1436b2c0
FIX: Do not try to write sysconfigdata into the current directory: use WRKDIR instead
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 09 Oct 2022 16:48:12 +0200 |
| parents | 56d0e959bcf0 |
| children |
line wrap: on
line diff
--- a/files/py37/patch-lib-python_3_sysconfig.py Sun Oct 09 12:57:54 2022 +0200 +++ b/files/py37/patch-lib-python_3_sysconfig.py Sun Oct 09 16:48:12 2022 +0200 @@ -1,12 +1,23 @@ ---- lib-python/3/sysconfig.py.orig 2022-03-28 09:53:47 UTC +--- lib-python/3/sysconfig.py.orig 2022-03-28 09:51:49 UTC +++ lib-python/3/sysconfig.py -@@ -436,7 +436,11 @@ def _generate_posix_vars(args): +@@ -442,7 +442,11 @@ def _generate_posix_vars(args): + module.build_time_vars = vars + sys.modules[name] = module + ++ pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port ++ + pybuilddir = 'build/lib.%s-%s' % (get_platform(), _PY_VERSION_SHORT) ++ if pypy_wrkdir is not None: ++ pybuilddir = os.path.join(pypy_wrkdir, pybuilddir) + if hasattr(sys, "gettotalrefcount"): + pybuilddir += '-pydebug' + os.makedirs(pybuilddir, exist_ok=True) +@@ -455,7 +459,10 @@ def _generate_posix_vars(args): pprint.pprint(vars, stream=f) # Create file used for sys.path fixup -- see Modules/getpath.c - with open('pybuilddir.txt', 'w', encoding='ascii') as f: + pybuilddir_txt = 'pybuilddir.txt' -+ pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port + if pypy_wrkdir is not None: + pybuilddir_txt = os.path.join(pypy_wrkdir, pybuilddir_txt) + with open(pybuilddir_txt, 'w', encoding='utf8') as f:
