Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
jobs: 4
containerImage:
# Something simple to start. When ready, the projects below should be included in the first job.
projectsString: --projects GafferResources
projectsString: --projects GafferResources BitstreamVera PCG
# projectsString: --projects LibFFI TBB Python ZLib Boost Imath OpenEXR HDF5 Alembic BitstreamVera Blosc CMark PyBind11 LibJPEG-Turbo LibTIFF LibPNG OpenJPEG Expat YAML-CPP PyString Minizip OpenColorIO LibRaw PugiXML Fmt LibWebP FreeType OpenImageIO LLVM OpenShadingLanguage GLEW OpenVDB OpenSubdiv PyOpenGL Qt PySide

uses: ./.github/workflows/buildDependencyBatch.yml
Expand Down
7 changes: 4 additions & 3 deletions BitstreamVera/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

"license" : "COPYRIGHT.TXT",

"commands" : [
"commands" : [],

"mkdir -p {buildDir}/fonts",
"cp *.ttf {buildDir}/fonts"
"postBuildCopy" : [

( None, "*.ttf", "{buildDir}/fonts" ),

],

Expand Down
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
11.x.x (relative to 11.0.0a4)
------

- build.py : Added `postBuildCopy` and `postBuildMove` configuration steps.


11.0.0a4 (relative to 11.0.0a3)
Expand Down
19 changes: 13 additions & 6 deletions Cycles/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,20 @@
" ..",
"cd build && make install -j {jobs} VERBOSE=1",

"mkdir -p {buildDir}/cycles/include",
"cd src && find . -name '*.h' | cpio -pdm {buildDir}/cycles/include",
"cp -r third_party/atomic/* {buildDir}/cycles/include",
"mkdir -p {buildDir}/cycles/bin",
"mv {buildDir}/cycles/cycles {buildDir}/cycles/bin/cycles",
"cp -r build/lib {buildDir}/cycles",
],

"postBuildCopy" : [

( "src", "**/*.h", "{buildDir}/cycles/include" ),
( "third_party/atomic", "**/*.h", "{buildDir}/cycles/include" ),
( "build/lib", "**/*", "{buildDir}/cycles/lib" ),

],

"postBuildMove" : [

( "{buildDir}/cycles", "cycles", "{buildDir}/cycles/bin" ),

],

"manifest" : [
Expand Down
17 changes: 12 additions & 5 deletions OpenColorIO/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,19 @@

"cd build && make clean && make VERBOSE=1 -j {jobs} && make install",

"mkdir -p {buildDir}/python",
"mv {buildDir}/lib*/python*/site-packages/PyOpenColorIO* {buildDir}/python",
],

"postBuildCopy" : [


( "..", "studio-config-v3.0.0_aces-v2.0_ocio-v2.4.ocio", "{buildDir}/openColorIO" ),
( "..", "cg-config-v3.0.0_aces-v2.0_ocio-v2.4.ocio", "{buildDir}/openColorIO" ),

],

"postBuildMove" : [

"mkdir -p {buildDir}/openColorIO",
"cp ../studio-config-v3.0.0_aces-v2.0_ocio-v2.4.ocio {buildDir}/openColorIO",
"cp ../cg-config-v3.0.0_aces-v2.0_ocio-v2.4.ocio {buildDir}/openColorIO",
( "{buildDir}/lib/python{pythonVersion}/site-packages", "PyOpenColorIO*/**/*", "{buildDir}/python" ),

],

Expand Down
9 changes: 6 additions & 3 deletions OpenShadingLanguage/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@
" {extraArguments}"
" ..",
"cd gafferBuild && make install -j {jobs} VERBOSE=1",
"{extraCommands}",

],

"variables" : {

"extraArguments" : "",
"extraCommands" : "",
"useBatched" : "b8_AVX,b8_AVX2,b8_AVX2_noFMA,b8_AVX512,b8_AVX512_noFMA,b16_AVX512,b16_AVX512_noFMA",

},
Expand Down Expand Up @@ -81,9 +79,14 @@

"platform:macos" : {

"postBuildMove" : [

( "{buildDir}/lib/python{pythonVersion}/site-packages", "oslquery", "{pythonLibDir}/python{pythonVersion}/site-packages" ),

],

"variables" : {

"extraCommands" : "mv {buildDir}/lib/python{pythonVersion}/site-packages/oslquery {pythonLibDir}/python{pythonVersion}/site-packages/oslquery",
"useBatched" : "0",

},
Expand Down
7 changes: 4 additions & 3 deletions PCG/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

"license" : "LICENSE-MIT.txt",

"commands" : [],

"commands" : [
"mkdir -p {buildDir}/include/pcg",
"cp include/*.hpp {buildDir}/include/pcg",
"postBuildCopy" : [

( "include", "*.hpp", "{buildDir}/include/pcg" ),

],

Expand Down
7 changes: 6 additions & 1 deletion PyString/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
" -D BUILD_SHARED_LIBS=ON"
" ..",
"cd build && make -j {jobs} && make install",
"mkdir -p {buildDir}/include/pystring && cp pystring.h {buildDir}/include/pystring",

],

"postBuildCopy" : [

( None, "pystring.h", "{buildDir}/include/pystring" ),

],

Expand Down
6 changes: 4 additions & 2 deletions Qt.py/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@

"dependencies" : [ "Python" ],

"commands" : [
"commands" : [],

"cp Qt.py {buildDir}/python",
"postBuildCopy" : [

( None, "Qt.py", "{buildDir}/python" )

],

Expand Down
10 changes: 7 additions & 3 deletions Qt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@

"cmake --build . --parallel {jobs} && cmake --install .",

"cp {buildDir}/libexec/moc {buildDir}/bin",
"cp {buildDir}/libexec/rcc {buildDir}/bin",
"cp {buildDir}/libexec/uic {buildDir}/bin",
],

"postBuildCopy" : [

( "{buildDir}/libexec", "moc", "{buildDir}/bin" ),
( "{buildDir}/libexec", "rcc", "{buildDir}/bin" ),
( "{buildDir}/libexec", "uic", "{buildDir}/bin" ),

],

Expand Down
7 changes: 6 additions & 1 deletion USD/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@
"make install",

"rm -rf {buildDir}/python/pxr",
"mv {buildDir}/lib/python/pxr {buildDir}/python",

],

"postBuildMove" : [

( "{buildDir}/lib/python", "pxr/**/*", "{buildDir}/python" ),

],

Expand Down
30 changes: 29 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
import os
import operator
import multiprocessing
import pathlib
import subprocess
import shutil
import stat
import sys
import tarfile
import zipfile
Expand Down Expand Up @@ -39,6 +41,13 @@
- enabled : May be set to `False` to disable a project entirely. This is
only expected to be useful in conjunction with platform overrides or
variants.
- postBuildCopy / postBuildMove : List of copy / move directives, each
of the form ( sourceRoot, globPattern, destinationRoot )
specifying paths that should be copied / moved after all `commands`
have run. Files in `sourceRoot` that match `globPattern` (including
the recursive `**` pattern) are copied / moved, with their path relative
to `sourceRoot`, to `destinationRoot`. Destination directories will be
created if necessary.

### Packaging

Expand Down Expand Up @@ -188,6 +197,8 @@ def __updateDigest( project, config ) :
__appendHash( config["digest"], config.get( "environment" ) )
__appendHash( config["digest"], config.get( "commands" ) )
__appendHash( config["digest"], config.get( "symbolicLinks" ) )
__appendHash( config["digest"], config.get( "postBuildCopy" ) )
__appendHash( config["digest"], config.get( "postBuildMove" ) )
for e in config.get( "requiredEnvironment", [] ) :
__appendHash( config["digest"], os.environ.get( e, "" ) )

Expand Down Expand Up @@ -316,15 +327,32 @@ def __buildProject( project, config, buildDir, cleanup ) :
sys.stderr.write( command + "\n" )
subprocess.check_call( command, shell = True, env = environment )

for operation in [ "postBuildCopy", "postBuildMove" ] :
for sourceRoot, pattern, destinationRoot in config.get( operation, () ) :
sourceRoot = pathlib.Path( sourceRoot or "." )
destinationRoot = pathlib.Path( destinationRoot )

for p in sourceRoot.glob( pattern ) :
destinationPath = destinationRoot / p.relative_to( sourceRoot )
destinationPath.parent.mkdir( parents = True, exist_ok = True )
if operation == "postBuildCopy" :
shutil.copy( p, destinationPath )
else :
p.replace( destinationPath )

for link in config.get( "symbolicLinks", [] ) :
sys.stderr.write( "Linking {} to {}\n".format( link[0], link[1] ) )
if os.path.lexists( link[0] ) :
os.remove( link[0] )
os.symlink( link[1], link[0] )

if cleanup :
def removeReadonly( func, path, *unused ) :
os.chmod( path, stat.S_IWRITE )
func( path )

os.chdir( buildRootDirectory )
shutil.rmtree( fullWorkingDir )
shutil.rmtree( fullWorkingDir, onexc = removeReadonly )

def __checkConfigs( projects, configs ) :

Expand Down
Loading