Skip to content

Instantly share code, notes, and snippets.

@zachlewis
Created December 7, 2020 23:41
Show Gist options
  • Save zachlewis/597e2cc938f03da6d38f091aa08b558d to your computer and use it in GitHub Desktop.
Save zachlewis/597e2cc938f03da6d38f091aa08b558d to your computer and use it in GitHub Desktop.
nuke_ml_client rez package
# -*- coding: utf-8 -*-
name = 'nuke_ml_client'
version = '0.0.8.dev20081200'
description = ''
authors = ['Foundry']
tools = []
plugin_for = ['nuke']
@early()
def uuid():
import uuid
return str(uuid.uuid5(uuid.NAMESPACE_DNS, name))
@early()
def variants():
from rez.package_py_utils import expand_requires
requires = ["platform-**", "arch-**", "os-**"]
nukes = [
#'nuke-11.**',
'nuke-12.**'
]
return [expand_requires(*requires + [nuke]) for nuke in nukes]
hashed_variants = True
requires = [
'nuke-11|12',
'protobuf_cpp-3.5.1+<4',
]
private_build_requires = [
'cmake-3',
'gcc-4+<8',
#'git',
]
def pre_build_commands():
env.LDFLAGS = '-Wl,-rpath,{resolve.protobuff_cpp.root}/lib -L$NUKE_ROOT -Wl,-rpath,$NUKE_ROOT $LDFLAGS'
env.REZ_BUILD_CMAKE_ARGS = ' '.join([
'-DCMAKE_INSTALL_PREFIX={build.install_path}/lib',
'-DNUKE_INSTALL_PATH=$NUKE_ROOT',
'-DCMAKE_BUILD_TYPE=Release',
'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={build.install_path}/lib',
'-DCMAKE_INSTALL_RPATH=$NUKE_ROOT',
'-DProtobuf_INCLUDE_DIR={resolve.protobuff_cpp.root}/include',
'-DProtobuf_LIBRARY={resolve.protobuff_cpp.root}/lib/libprotobuf.so',
'-DProtobuf_LIBRARIES={resolve.protobuff_cpp.root}/lib',
'-Wno-dev',
])
build_command = \
"""
git clone https://github.com/TheFoundryVisionmongers/nuke-ML-server.git
cd nuke-ML-server
mkdir build && cd build
cmake .. $REZ_BUILD_CMAKE_ARGS
make -j$REZ_BUILD_THREAD_COUNT
#make {install}
"""
def commands():
env.NUKE_PATH.append('{root}/lib')
env.LD_LIBRARY_PATH.append('{root}/lib')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment