Pantograph/build.py

18 lines
663 B
Python
Raw Normal View History

2024-04-19 16:47:35 -07:00
#!/usr/bin/env python3
import subprocess, shutil, os, stat
from pathlib import Path
# -- Install Panograph
# Define paths for Pantograph source and Pantograph Python interface
2024-04-19 16:47:35 -07:00
PATH_PANTOGRAPH = Path("./src")
PATH_PY = Path("./pantograph")
with subprocess.Popen(["lake", "build", "repl"], cwd=PATH_PANTOGRAPH) as p:
2024-04-19 16:47:35 -07:00
p.wait()
path_executable = PATH_PY / "pantograph-repl"
shutil.copyfile(PATH_PANTOGRAPH / ".lake/build/bin/repl", path_executable)
2024-04-19 16:47:35 -07:00
os.chmod(path_executable, os.stat(path_executable).st_mode | stat.S_IEXEC)
# -- Copy the Lean toolchain file to the specified path
shutil.copyfile(PATH_PANTOGRAPH / "lean-toolchain", PATH_PY / "lean-toolchain")