-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to SPI custom build scripts, versioning/disting policy changes
This mostly concerns builds at SPI, but a tiny bit touches the generic build scripts. Most of you will want to tune out now, unless you're especially curious. Changes for everybody: * Switching to a 4-part formal version number (e.g. 2.1.3.0), so there is an additional (rarely used) CMake variable OPENIMAGEIO_VERSION_TWEAK. This gives me a little more flexibility with certain tags and releases in the master branch but there are very few contexts in which anybody will care about or refer to the last tweak number, and in practice we may rarely or never use it. * New CMake option `OIIO_NAMESPACE_INCLUDE_PATCH`, if turned on, will make the "inner namespace" include the patch number (such as namespace OpenImageIO_v2_1_3), whereas the default is the usual major/minor (OpenImageIO_v2_1). In general, for external/supported releases, we want just major/minor, since within a major/minor family we guarantee link compatibility and specifically DON'T want to force a recompile for patch updates only. But for studios like ours who build for production directly from master, link compatibility is not guaranteed at any time, so we make sure even down to the patch level is carefully namespaced. Changes that only have an effect if you're building at SPI: * The *default* build (regular old "make") now uses the generic default namespace. If you want to make the special namespaced version we use for Arnold, build with `make OIIO_ARNOLD=1`. * Change SpComp2 versioning from consecutive low integer SpComp2 versions (like v47, v48) to canonical multidigit numbers corresponding to external releases, such as v20101 for OIIO 2.1.1. Also install the bins in the same place (even though it's nonstandard SpComp2 practice). * A new build mode enabled by `make OIIO_SPIREZ=1` does the kind of build we want for an experimental Rez packaging. Some notable details and options: - `REZ_PACKAGE_ROOT=path` overrides the usual root area where we store the packages. - `OIIO_REZ_NAME=name` overrides the default package name for the Rez distribution (default is "OpenImageIO"). - An appropriate package.py is automatically generated. - The Rez variants fold in the SPI compiler compatibility platform, Python major/minor version, and Boost version. - The build automatically sets the Rpath for the Rez install area so that nobody needs to mess with their LD_LIBRARY_PATH to get the libraries to be found (especially if you're just importing the Python module).
- Loading branch information
Showing
7 changed files
with
191 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
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,12 @@ | ||
option (OIIO_SPIREZ "Enable extra bits for building for SPI Rez install" OFF) | ||
set (OIIO_REZ_PACKAGE_NAME CACHE STRING "${PROJECT_NAME}") | ||
|
||
if (OIIO_SPIREZ) | ||
message (STATUS "Creating package.py from package.py.in") | ||
configure_file ("${PROJECT_SOURCE_DIR}/site/spi/rez/package.py.in" "${CMAKE_BINARY_DIR}/package.py" @ONLY) | ||
|
||
install (FILES ${CMAKE_BINARY_DIR}/package.py | ||
"${PROJECT_SOURCE_DIR}/site/spi/rez/build.py" | ||
DESTINATION ${CMAKE_INSTALL_PREFIX} | ||
COMPONENT developer) | ||
endif () |
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,17 @@ | ||
#!/usr/bin/env python | ||
|
||
# This helper script takes a major.minor.patch semantic version string | ||
# ("2.1.1") and reformats it into the dot-less zero-padded version like | ||
# "20101". This is necessary to turn external release designations into | ||
# integer SpComp2 version numbers. | ||
|
||
from __future__ import print_function | ||
import sys | ||
|
||
if len(sys.argv) != 2 : | ||
print('Need 1 argument: version number with dots') | ||
exit(1) | ||
|
||
vers = sys.argv[1] | ||
parts = vers.split('.') | ||
print ('{:d}{:02d}{:02d}'.format(int(parts[0]), int(parts[1]), int(parts[2]))) |
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,17 @@ | ||
#!/usr/bin/env python | ||
import shutil | ||
import os | ||
|
||
folders = [ | ||
'bin', | ||
'include', | ||
'lib', | ||
'python', | ||
'share', | ||
] | ||
|
||
src = os.environ['REZ_BUILD_SOURCE_PATH'] | ||
dest = os.environ['REZ_BUILD_INSTALL_PATH'] | ||
|
||
for folder in folders: | ||
shutil.copytree(os.path.join(src, folder), os.path.join(dest, folder)) |
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,52 @@ | ||
# -*- coding: utf-8 -*- | ||
# Documentation on packages and available attributes can be found at: | ||
# https://github.com/nerdvegas/rez/wiki/Package-Definition-Guide | ||
|
||
name = '@OIIO_REZ_PACKAGE_NAME@' | ||
|
||
version = '@OIIO_VERSION_MAJOR@.@OIIO_VERSION_MINOR@.@OIIO_VERSION_PATCH@.@OIIO_VERSION_TWEAK@' | ||
|
||
description = \ | ||
""" | ||
Rez package of OpenImageIO | ||
""" | ||
|
||
authors = ['Larry Gritz <[email protected]>'] | ||
|
||
# Add dependencies to other Rez packages here | ||
requires = [] | ||
|
||
build_command = 'python {root}/build.py' | ||
|
||
build_requires = ['buildTools'] | ||
|
||
# Rez has a limitation where it is not possible to add variants to a package that | ||
# does not have any: https://github.com/nerdvegas/rez/wiki/Variants#single-variants. | ||
# Unless you are 100% certain that your package will NEVER require any variants, | ||
# you should define your package with at least one variant. | ||
variants = [ | ||
[ | ||
'@SPI_COMPILER_PLATFORM@', | ||
'python-@PYTHON_VERSION_MAJOR@.@PYTHON_VERSION_MINOR@', | ||
'boost-@BOOST_VERS_SP@' | ||
], | ||
] | ||
|
||
def commands(): | ||
# Add import statements here, not at the top of the file! | ||
|
||
# Uncomment if you have executables under bin/ | ||
env.PATH.append("{root}/bin") | ||
env.LD_LIBRARY_PATH.append("{root}/lib") | ||
|
||
# Uncomment if you have Python code under python/ | ||
env.PYTHONPATH.append("{root}/python") | ||
|
||
# For SpImport.Packages, append the python directory | ||
#env.SPIMPORT_PACKAGES.append("{root}/python") | ||
|
||
#if building: | ||
# Add env vars or custom code you want executed only at build time | ||
|
||
|
||
uuid = '1db87605-b172-4e23-a6cb-7b9ff72a46ae' |
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