Modify conda env vars in Windows post-install script.

This initializes the environment with the following environment
variables set to empty, so that they are cleared when the environment is
activated and interference from other installations (e.g. PothosSDR) is
avoided:

GR_PREFIX
GRC_BLOCKS_PATH
UHD_PKG_PATH
VOLK_PREFIX
This commit is contained in:
Ryan Volz 2022-02-07 18:15:39 -05:00
parent 27307a7c78
commit 25c1e2787e

View File

@ -120,7 +120,16 @@ def render_constructor(
# write the post_install scripts referenced in the construct dict
if platform.startswith("win"):
with (constructor_dir / "post_install.bat").open("w") as f:
f.write("\n".join((r"del /q %PREFIX%\pkgs\*.tar.bz2", "exit 0", "")))
f.write(
"\n".join(
(
r'echo {"env_vars": {"GR_PREFIX": "", "GRC_BLOCKS_PATH": "", "UHD_PKG_PATH": "", "VOLK_PREFIX": ""}}>%PREFIX%\conda-meta\state',
r"del /q %PREFIX%\pkgs\*.tar.bz2",
"exit 0",
"",
)
)
)
else:
with (constructor_dir / "post_install.sh").open("w") as f:
f.write(