-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Matthew Ballance <[email protected]>
- Loading branch information
Showing
3 changed files
with
94 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh -x | ||
|
||
echo "BUILD_NUM=${BUILD_NUM}" >> python/debug_mgr/__build_num__.py | ||
${IVPM_PYTHON} -m pip install ivpm cython | ||
${IVPM_PYTHON} -m ivpm update -a | ||
|
||
PYTHON=./packages/python/bin/python | ||
${PYTHON} -m pip install twine auditwheel ninja wheel cython | ||
${PYTHON} setup.py bdist_wheel | ||
|
||
for whl in dist/*.whl; do | ||
${PYTHON} -m auditwheel repair $whl | ||
rm $whl | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import os | ||
import sys | ||
import platform | ||
import subprocess | ||
|
||
def main(): | ||
scripts_dir = os.path.dirname(os.path.abspath(__file__)) | ||
proj_dir = os.path.dirname(scripts_dir) | ||
|
||
if os.path.isdir(os.path.join(proj_dir, "packages")): | ||
packages_dir = os.path.join(proj_dir, "packages") | ||
else: | ||
packages_dir = os.path.dirname(proj_dir) | ||
|
||
print("proj_dir: %s" % str(proj_dir), flush=True) | ||
print("packages_dir: %s" % str(packages_dir), flush=True) | ||
|
||
sys.path.insert(0, os.path.join(packages_dir, "pyastbuilder", "src")) | ||
|
||
print("PYTHONPATH: %s" % str(sys.path), flush=True) | ||
|
||
env = os.environ.copy() | ||
ps = ";" if platform.system() == "Windows" else ":" | ||
env["PYTHONPATH"] = ps.join(sys.path) | ||
|
||
try: | ||
import astbuilder | ||
except ImportError as e: | ||
print("Failed to import astbuilder: %s" % str(e)) | ||
|
||
cmd = [sys.executable, "-m", "astbuilder", "gen-cpp", "-name", "ast"] | ||
cmd.extend(["-namespace", "zsp::ast", "-astdir", os.path.join(proj_dir, "ast")]) | ||
cmd.extend(["-license", os.path.join(proj_dir, "etc", "copyright.cpp")]) | ||
|
||
result = subprocess.run( | ||
cmd, | ||
stderr=subprocess.STDOUT, | ||
stdout=sys.stdout, | ||
env=env) | ||
if result.returncode != 0: | ||
raise Exception("Failed to run gen-cpp") | ||
|
||
cmd = [sys.executable, "-m", "astbuilder", "gen-pyext", "-name", "ast"] | ||
cmd.extend(["-namespace", "zsp::ast", "-astdir", os.path.join(proj_dir, "ast")]) | ||
cmd.extend(["-package", "zsp_parser.ast", "-o", "../ext"]) | ||
|
||
result = subprocess.run( | ||
cmd, | ||
stderr=subprocess.STDOUT, | ||
stdout=sys.stdout, | ||
env=env) | ||
if result.returncode != 0: | ||
raise Exception("Failed to run gen-cpp") | ||
|
||
# ${PYTHON} -m astbuilder gen-cpp -name ast -namespace zsp::ast -astdir ${CMAKE_CURRENT_SOURCE_DIR}/ast -license ${CMAKE_CURRENT_SOURCE_DIR}/etc/copyright.cpp && | ||
# ${PYTHON} -m astbuilder gen-pyext -name ast -namespace zsp::ast -package zsp_parser.ast -astdir ${CMAKE_CURRENT_SOURCE_DIR}/ast -o ../ext | ||
pass | ||
|
||
if __name__ == "__main__": | ||
main() | ||
|