Last active
August 14, 2020 21:41
-
-
Save zachlewis/f0ea36e2ed16d7c00bbc1e584fce7929 to your computer and use it in GitHub Desktop.
yaml_cpp rez package
This file contains hidden or 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
name = 'yamlcpp' | |
version = '0.6.3' | |
description = 'A YAML parser and emitter in C++' | |
authors = ['Jesse Beder'] | |
private_build_requires = [ | |
'gcc-4+<10', | |
'cmake-3', | |
] | |
def pre_build_commands(): | |
url = 'https://github.com/jbeder/yaml-cpp.git' | |
env.CXXFLAGS = '$CXXFLAGS -fvisibility=hidden -fPIC -fvisibility-inlines-hidden' | |
build_command = """ | |
git clone --branch=yaml-cpp-$REZ_BUILD_PROJECT_VERSION https://github.com/jbeder/yaml-cpp.git | |
cd yaml-cpp | |
mkdir static && cd static | |
cmake .. -DCMAKE_INSTALL_PREFIX=$REZ_BUILD_INSTALL_PATH | |
make {install} -j$REZ_BUILD_THREAD_COUNT | |
cd .. | |
CXXFLAGS='-fPIC' | |
mkdir shared && cd shared | |
cmake .. -DCMAKE_INSTALL_PREFIX=$REZ_BUILD_INSTALL_PATH \ | |
-DYAML_BUILD_SHARED_LIBS=ON | |
make {install} -j$REZ_BUILD_THREAD_COUNT | |
""" | |
def commands(): | |
if building: | |
env.CFLAGS.set('-I{root}/include $CFLAGS') | |
env.CXXFLAGS.set('-I{root}/include $CPPFLAGS') | |
env.LDFLAGS.set('-L{root}/lib -Wl,-rpath,{root}/lib $LDFLAGS') | |
env.CMAKE_MODULE_PATH.append('{root}/lib/cmake') | |
env.PKG_CONFIG_PATH.append('{root}/lib/pkgconfig') | |
@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-**"] | |
return [expand_requires(*requires)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment