def build(source_path, build_path, install_path, targets=None): from rezutil import lib targets = targets or [] if "install" in targets: dst = install_path + "/payload" else: dst = build_path + "/payload" dst = os.path.normpath(dst) if os.path.isdir(dst): lib.clean(dst) filename = "mgear_%s.zip" % (os.environ["REZ_BUILD_PROJECT_VERSION"]) # Download the source url = "%s/%s" % (url_prefix, filename) archive = lib.download(url, filename, "download") # Unzip the source source_root = lib.open_archive(archive) # Deploy # (we cannot use setup.py to install avalon, there are additional files # currently not being installed by it) lib.copy_dir(source_root, dst)
def build(source_path, build_path, install_path, targets=None): from rezutil import lib targets = targets or [] if "install" in targets: dst = install_path + "/payload" else: dst = build_path + "/payload" dst = os.path.normpath(dst) if os.path.isdir(dst): lib.clean(dst) filename = "%s.zip" % os.environ["REZ_BUILD_PROJECT_VERSION"] # Download the source url = "%s/%s" % (url_prefix, filename) archive = lib.download(url, filename) # Unzip the source source_root = lib.open_archive(archive) # Deploy # (we cannot use setup.py to install avalon, there are additional files # currently not being installed by it) lib.copy_dir(source_root, dst) # Additional dst_root = os.path.dirname(dst) for dir_name in ["apps", "bin", "python", "config", "template"]: dst_dir = os.path.join(dst_root, dir_name) lib.copy_dir(os.path.join(source_path, dir_name), dst_dir)
def win_build(source, install): # On Windows, we simply copy headers and pre-built DLLs to # the appropriate location. # Install the files, like usd build script: lib.copy_files(source + "/bin/intel64/vc14/*.*", install + "/bin") lib.copy_files(source + "/lib/intel64/vc14/*.*", install + "/lib") lib.copy_dir(source + "/include/tbb", install + "/include/tbb") lib.copy_dir(source + "/include/serial", install + "/include/serial")
def win_build(source, install): # On Windows, we install headers and pre-built binaries per # https://glew.sourceforge.net/install.html # Note that we are installing just the shared library. This is required # by the USD build; if the static library is present, that one will be # used and that causes errors with USD and OpenSubdiv. lib.copy_files(source + "/bin/Release/x64/glew32.dll", install + "/bin") lib.copy_files(source + "/lib/Release/x64/glew32.lib", install + "/lib") lib.copy_dir(source + "/include/GL", install + "/include/GL")
def lnx_mac_build(source, install): if IS_MAC: # Note: (v2017_U6) TBB installation fails on OSX when cuda is installed, a # suggested fix: # https://github.com/spack/spack/issues/6000#issuecomment-358817701 lib.patch_file(source + "/build/macos.inc", [("shell clang -v ", "shell clang --version ")]) # TBB does not support out-of-source builds in a custom location. args = [ "make", "-j%s" % os.environ["REZ_BUILD_THREAD_COUNT"], ] subprocess.check_call(args, cwd=source) # Install both release and debug builds. USD requires the debug # libraries when building in debug mode, and installing both # makes it easier for users to install dependencies in some # location that can be shared by both release and debug USD # builds. Plus, the TBB build system builds both versions anyway. lib.copy_files(source + "/build/*_release/libtbb*.*", install + "/bin") lib.copy_files(source + "/build/*_debug/libtbb*.*", install + "/lib") lib.copy_dir(source + "/include/tbb", install + "/include/tbb") lib.copy_dir(source + "/include/serial", install + "/include/serial")
def copy_additionals(source_path, install_path): for dirname in ["resources"]: src = os.path.join(source_path, dirname) dst = os.path.join(install_path, dirname) lib.copy_dir(src, dst)