from build import copy if __name__ == "__main__": copy("manifest-firefox-dev.json", "../Builds/2/Development")
def main(bin_dir): repo_dir = Path(__file__).parent.parent libs_dir = repo_dir / "libs" rm_dir(libs_dir) print(f"Copying libs to: {libs_dir}") usd_dir = bin_dir / "USD/install" libs_dir.mkdir(parents=True) copy(usd_dir / "bin", libs_dir / "bin", ('*.pdb', )) copy(usd_dir / "lib", libs_dir / "lib", ("*.pdb", "*.lib", "*.def", "cmake", "__pycache__")) copy(usd_dir / "plugin", libs_dir / "plugin", ("*.pdb", "*.lib")) copy(usd_dir / "python", libs_dir / "python", ("*.lib", "build")) copy(usd_dir / "libraries", libs_dir / "libraries") copy(repo_dir / "deps/mx_libs/alglib", libs_dir / "libraries/alglib") if OS == 'Windows': copy( bin_dir / "USD/build/openexr-2.3.0/OpenEXR/IlmImf/Release/" "IlmImf-2_3.dll", libs_dir / "lib/IlmImf-2_3.dll") if OS == 'Linux': print("Configuring rpath") patchelf_args = [ 'patchelf', '--remove-rpath', str(libs_dir / 'plugin/usd/hdRpr.so') ] print(patchelf_args) subprocess.check_call(patchelf_args) patchelf_args = [ 'patchelf', '--force-rpath', '--set-rpath', "$ORIGIN/../../lib", str(libs_dir / 'plugin/usd/hdRpr.so') ] print(patchelf_args) subprocess.check_call(patchelf_args) for glob in ("libIlm*.so", "libIex*.so", "libhio*.so", "libHalf*.so"): for f in iterate_files(libs_dir / "lib", glob): patchelf_args = [ 'patchelf', '--set-rpath', "$ORIGIN/.", str(f) ] print(patchelf_args) subprocess.check_call(patchelf_args) # Clear lib/python/rpr/RprUsd/__init__.py rpr_usd_init_py = libs_dir / "lib/python/rpr/RprUsd/__init__.py" print(f"Clearing {rpr_usd_init_py}") rpr_usd_init_py.write_text("")
sys.path.append(normpath(dirname(abspath(__file__)) + "/src")) if True: from build import clean from build import copy from build import lib from build import src from build import wipe def dist(subpath=None): return "dist/linux/sqink" + (subpath or "") clean(dist()) copy("README.md", dist()) copy(src("/crossknight"), dist("/lib/crossknight")) copy(src("/resources/images"), dist("/resources/images")) copy(src("/resources/js"), dist("/resources/js")) copy(src("/resources/notes/DESCRIPTION.txt"), dist("/resources/notes")) copy(src("/resources/styles"), dist("/resources/styles")) copy(src("/sqink.ico"), dist()) copy(src("/sqink.py"), dist()) copy(lib("/apiclient"), dist("/lib/apiclient")) copy(lib("/certifi"), dist("/lib/certifi")) copy(lib("/chardet"), dist("/lib/chardet")) copy(lib("/dropbox"), dist("/lib/dropbox")) copy(lib("/googleapiclient"), dist("/lib/googleapiclient")) copy(lib("/httplib2"), dist("/lib/httplib2")) copy(lib("/idna"), dist("/lib/idna"))
def build(ver, script, icon, target): name = "Scroll, Quill & INK" params = { "build_exe": target, "packages": ["pkg_resources"], "includes": ["idna.idnadata", "queue"], "excludes": ["distutils", "lib2to3", "multiprocessing", "pydoc_data", "unittest", "win32com"]} executable = Executable(script, base="Win32GUI", icon=icon, copyright="Copyright CrossKnight © 2014") setup(name=name, version=ver, description=name, options={"build_exe": params}, executables=[executable]) clean(dist()) copy("README.md", dist()) copy(src("/resources/images"), dist("/resources/images")) copy(src("/resources/notes/DESCRIPTION.txt"), dist("/resources/notes")) copy(src("/resources/styles"), dist("/resources/styles")) build(version(), src("/sqink.py"), src("/sqink.ico"), dist()) wipe(dist("/imageformats/*d4.dll")) wipe(dist("/PySide/docs")) wipe(dist("/PySide/examples")) wipe(dist("/PySide/imports")) wipe(dist("/PySide/include")) wipe(dist("/PySide/plugins")) wipe(dist("/PySide/scripts")) wipe(dist("/PySide/translations")) wipe(dist("/PySide/typesystems"))
from build import copy if __name__ == "__main__": copy("manifest-chrome.json", "../Builds/2/Chrome")
from build import copy if __name__ == "__main__": copy("manifest-firefox.json", "../Builds/2/Firefox")
def main(bin_dir, build_var): repo_dir = Path(__file__).parent.parent libs_dir = repo_dir / f"libs-{PYTHON_VERSION}" rm_dir(libs_dir) print(f"Copying libs to: {libs_dir}") usd_dir = bin_dir / "USD/install" libs_dir.mkdir(parents=True) ignore_base = ("*.pdb", ) if build_var == 'release' else () build_name = { 'release': 'Release', 'debug': 'Debug', 'relwithdebuginfo': 'RelWithDebInfo' }[build_var] copy(usd_dir / "bin", libs_dir / "bin", ignore_base) copy(usd_dir / "lib", libs_dir / "lib", ignore_base + ("*.lib", "*.def", "cmake", "__pycache__")) copy(usd_dir / "plugin", libs_dir / "plugin", ignore_base + ("*.lib", )) copy(usd_dir / "python", libs_dir / "python", ("*.lib", "build")) copy(usd_dir / "libraries", libs_dir / "libraries") copy(repo_dir / "deps/mx_libs/alglib", libs_dir / "libraries/alglib") if OS == 'Windows': copy( bin_dir / f"USD/build/openexr-2.3.0/OpenEXR/IlmImf/{build_name}/IlmImf-2_3.dll", libs_dir / "lib/IlmImf-2_3.dll") if build_var != 'release': copy( bin_dir / f"USD/build/openexr-2.3.0/OpenEXR/IlmImf/{build_name}/IlmImf-2_3.pdb", libs_dir / "lib/IlmImf-2_3.pdb") copy( repo_dir / f"deps/HdRPR/build/pxr/imaging/rprUsd/{build_name}/rprUsd.pdb", libs_dir / "lib/rprUsd.pdb") copy( repo_dir / f"deps/HdRPR/build/pxr/imaging/plugin/hdRpr/{build_name}/hdRpr.pdb", libs_dir / "plugin/usd/hdRpr.pdb") if OS == 'Linux': print("Configuring rpath") patchelf_args = [ 'patchelf', '--remove-rpath', str(libs_dir / 'plugin/usd/hdRpr.so') ] print(patchelf_args) subprocess.check_call(patchelf_args) patchelf_args = [ 'patchelf', '--force-rpath', '--set-rpath', "$ORIGIN/../../lib", str(libs_dir / 'plugin/usd/hdRpr.so') ] print(patchelf_args) subprocess.check_call(patchelf_args) for glob in ("libIlm*.so", "libIex*.so", "libhio*.so", "libHalf*.so"): for f in iterate_files(libs_dir / "lib", glob): patchelf_args = [ 'patchelf', '--set-rpath', "$ORIGIN/.", str(f) ] print(patchelf_args) subprocess.check_call(patchelf_args) # Clear lib/python/rpr/RprUsd/__init__.py rpr_usd_init_py = libs_dir / "lib/python/rpr/RprUsd/__init__.py" print(f"Clearing {rpr_usd_init_py}") rpr_usd_init_py.write_text("")