aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-04-17 00:55:15 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-05-02 19:28:35 -0400
commit877d5ea8e02c13bb606969d33d0491cfd4e08275 (patch)
tree92e53a128407d95872359edbbd8af498b1fa9d9c /mesonbuild/modules
parent6a1427401c76db73081e478c4ff49fcc75420de6 (diff)
downloadmeson-877d5ea8e02c13bb606969d33d0491cfd4e08275.zip
meson-877d5ea8e02c13bb606969d33d0491cfd4e08275.tar.gz
meson-877d5ea8e02c13bb606969d33d0491cfd4e08275.tar.bz2
bytecompile: switch to handling destdir in the script launcher env
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/python.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
index a3868a0..984d724 100644
--- a/mesonbuild/modules/python.py
+++ b/mesonbuild/modules/python.py
@@ -322,13 +322,13 @@ class PythonModule(ExtensionModule):
for t in installdata.targets:
if should_append(t.out_name):
- py_files.append(os.path.join(installdata.prefix, t.outdir, os.path.basename(t.fname)))
+ py_files.append((t.out_name, os.path.join(installdata.prefix, t.outdir, os.path.basename(t.fname))))
for d in installdata.data:
if should_append(d.install_path_name):
- py_files.append(os.path.join(installdata.prefix, d.install_path))
+ py_files.append((d.install_path_name, os.path.join(installdata.prefix, d.install_path)))
for d in installdata.install_subdirs:
if should_append(d.install_path_name, True):
- py_files.append(os.path.join(installdata.prefix, d.install_path))
+ py_files.append((d.install_path_name, os.path.join(installdata.prefix, d.install_path)))
import importlib.resources
pycompile = os.path.join(self.interpreter.environment.get_scratch_dir(), 'pycompile.py')
@@ -340,13 +340,15 @@ class PythonModule(ExtensionModule):
i = T.cast(PythonExternalProgram, i)
manifest = f'python-{i.info["version"]}-installed.json'
manifest_json = []
- for f in py_files:
+ for name, f in py_files:
if f.startswith((os.path.join(installdata.prefix, i.platlib), os.path.join(installdata.prefix, i.purelib))):
- manifest_json.append(f)
+ manifest_json.append(name)
with open(os.path.join(self.interpreter.environment.get_scratch_dir(), manifest), 'w', encoding='utf-8') as f:
json.dump(manifest_json, f)
cmd = i.command + [pycompile, manifest, str(optlevel)]
- script = backend.get_executable_serialisation(cmd, verbose=True)
+
+ script = backend.get_executable_serialisation(cmd, verbose=True,
+ installdir_map={'py_purelib': i.purelib, 'py_platlib': i.platlib})
ret.append(script)
return ret