diff options
author | bartus | 2020-02-20 12:18:51 +0100 |
---|---|---|
committer | bartus | 2020-02-20 12:18:51 +0100 |
commit | 2289d75548b77a37d6268801a53b0f8ffcf52b10 (patch) | |
tree | 79bb793306f47e7356a8c8e9713cb9bb088c2704 | |
parent | 33a30c30f09cc12043c8c58836020651e9d7c8a2 (diff) | |
download | aur-2289d75548b77a37d6268801a53b0f8ffcf52b10.tar.gz |
Rewind to to blender version with some patches.
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 14 | ||||
-rw-r--r-- | blender.patch | 139 |
3 files changed, 152 insertions, 9 deletions
@@ -1,6 +1,6 @@ pkgbase = usd pkgdesc = 3D VFX pipeline interchange file format. - pkgver = 20.02.r0.gbe1a80f8c + pkgver = 19.11 pkgrel = 1 url = https://www.openusd.org arch = x86_64 @@ -19,11 +19,13 @@ pkgbase = usd depends = pyside2 depends = python2 depends = python2-opengl - provides = usd=20.02.r0.gbe1a80f8c - source = git+https://github.com/PixarAnimationStudios/USD.git#tag=v20.02 + provides = usd=19.11 + source = git+https://github.com/PixarAnimationStudios/USD.git#tag=v19.11 source = boost_python2.patch + source = blender.patch sha256sums = SKIP sha256sums = 92ff2922bf2a615e3279f1fb834dd1f0a356f843ce511efbeaf9797578409d49 + sha256sums = a4b92e59eb6330109f65d1b168ad0c4b1292c5317f579dcbf0594df22ffbc587 pkgname = usd @@ -1,11 +1,11 @@ # Maintainer : bartus <arch-user-repoᘓbartus.33mail.com> # shellcheck disable=SC2034 -_ver="v20.02" +_ver="v19.11" #switch to last blender supported version, latest is "v20.02" _fragment="#tag=$_ver" pkgname=usd -pkgver=20.02.r0.gbe1a80f8c +pkgver=${_ver#v} pkgrel=1 pkgdesc="3D VFX pipeline interchange file format." arch=('x86_64') @@ -15,12 +15,14 @@ eval depends=('boost-libs' 'glew' 'openexr' 'opensubdiv' 'pyside2' "python2{,-op eval makedepends=('boost' 'cmake' 'git' 'intel-tbb' 'ninja' "python2-{jinja,pyside-tools}") provides=("usd=${pkgver}") source=("git+https://github.com/PixarAnimationStudios/USD.git${_fragment}" - "boost_python2.patch") + "boost_python2.patch" + "blender.patch") sha256sums=('SKIP' - '92ff2922bf2a615e3279f1fb834dd1f0a356f843ce511efbeaf9797578409d49') + '92ff2922bf2a615e3279f1fb834dd1f0a356f843ce511efbeaf9797578409d49' + 'a4b92e59eb6330109f65d1b168ad0c4b1292c5317f579dcbf0594df22ffbc587') prepare() { - git -C USD apply -v ${srcdir}/boost_python2.patch + git -C USD apply -v ${srcdir}/{boost_python2,blender}.patch } #pkgver() { @@ -33,7 +35,7 @@ build() { -DPXR_BUILD_TESTS:BOOL=OFF # -DPXR_ENABLE_PYTHON_SUPPORT:BOOL=OFF -DPXR_BUILD_MONOLITHIC:BOOL=ON # Required by blender-2.83 - -DPXR_PYTHON_SHEBANG:STRING=python2 + -DPXR_PYTHON_SHEBANG:STRING="/usr/bin/python2" ) cmake -S USD -B build -G Ninja "${_CMAKE_FLAGS[@]}" ninja -C build $([ -v MAKEFLAGS ] || echo -j1) diff --git a/blender.patch b/blender.patch new file mode 100644 index 000000000000..6302f13796b8 --- /dev/null +++ b/blender.patch @@ -0,0 +1,139 @@ +diff -x .git -ur usd.orig/cmake/defaults/Options.cmake external_usd/cmake/defaults/Options.cmake +--- usd.orig/cmake/defaults/Options.cmake 2019-10-24 22:39:53.000000000 +0200 ++++ external_usd/cmake/defaults/Options.cmake 2019-11-28 13:00:33.197957712 +0100 +@@ -25,6 +25,7 @@ + option(PXR_VALIDATE_GENERATED_CODE "Validate script generated code" OFF) + option(PXR_HEADLESS_TEST_MODE "Disallow GUI based tests, useful for running under headless CI systems." OFF) + option(PXR_BUILD_TESTS "Build tests" ON) ++option(PXR_BUILD_USD_TOOLS "Build commandline tools" ON) + option(PXR_BUILD_IMAGING "Build imaging components" ON) + option(PXR_BUILD_EMBREE_PLUGIN "Build embree imaging plugin" OFF) + option(PXR_BUILD_OPENIMAGEIO_PLUGIN "Build OpenImageIO plugin" OFF) +diff -x .git -ur usd.orig/cmake/defaults/Packages.cmake external_usd/cmake/defaults/Packages.cmake +--- usd.orig/cmake/defaults/Packages.cmake 2019-10-24 22:39:53.000000000 +0200 ++++ external_usd/cmake/defaults/Packages.cmake 2019-11-28 13:00:33.185957483 +0100 +@@ -64,7 +64,7 @@ + endif() + + # --TBB +-find_package(TBB REQUIRED COMPONENTS tbb) ++find_package(TBB) + add_definitions(${TBB_DEFINITIONS}) + + # --math +diff -x .git -ur usd.orig/pxr/base/lib/plug/initConfig.cpp external_usd/pxr/base/lib/plug/initConfig.cpp +--- usd.orig/pxr/base/lib/plug/initConfig.cpp 2019-10-24 22:39:53.000000000 +0200 ++++ external_usd/pxr/base/lib/plug/initConfig.cpp 2019-12-11 11:00:37.643323127 +0100 +@@ -69,8 +69,38 @@ + + ARCH_CONSTRUCTOR(Plug_InitConfig, 2, void) + { ++ /* The contents of this constructor have been moved to usd_initialise_plugin_path(...) */ ++} ++ ++}; // end of anonymous namespace ++ ++/** ++ * The contents of this function used to be in the static constructor Plug_InitConfig. ++ * This static constructor made it impossible for Blender to pass a path to the USD ++ * library at runtime, as the constructor would run before Blender's main() function. ++ * ++ * This function is wrapped in a C function of the same name (defined below), ++ * so that it can be called from Blender's main() function. ++ * ++ * The datafiles_usd_path path is used to point to the USD plugin path when Blender ++ * has been installed. The fallback_usd_path path should point to the build-time ++ * location of the USD plugin files so that Blender can be run on a development machine ++ * without requiring an installation step. ++ */ ++void ++usd_initialise_plugin_path(const char *datafiles_usd_path) ++{ + std::vector<std::string> result; + ++ // Add Blender-specific paths. They MUST end in a slash, or symlinks will not be treated as directory. ++ if (datafiles_usd_path != NULL && datafiles_usd_path[0] != '\0') { ++ std::string datafiles_usd_path_str(datafiles_usd_path); ++ if (datafiles_usd_path_str.back() != '/') { ++ datafiles_usd_path_str += "/"; ++ } ++ result.push_back(datafiles_usd_path_str); ++ } ++ + // Determine the absolute path to the Plug shared library. + // Any relative paths specified in the plugin search path will be + // anchored to this directory, to allow for relocatability. +@@ -94,9 +124,24 @@ + _AppendPathList(&result, installLocation, sharedLibPath); + #endif // PXR_INSTALL_LOCATION + +- Plug_SetPaths(result); +-} ++ if (!TfGetenv("PXR_PATH_DEBUG").empty()) { ++ printf("USD Plugin paths: (%zu in total):\n", result.size()); ++ for(const std::string &path : result) { ++ printf(" %s\n", path.c_str()); ++ } ++ } + ++ Plug_SetPaths(result); + } + + PXR_NAMESPACE_CLOSE_SCOPE ++ ++/* Workaround to make it possible to pass a path at runtime to USD. */ ++extern "C" { ++void ++usd_initialise_plugin_path( ++ const char *datafiles_usd_path) ++{ ++ PXR_NS::usd_initialise_plugin_path(datafiles_usd_path); ++} ++} +diff -x .git -ur usd.orig/pxr/usd/CMakeLists.txt external_usd/pxr/usd/CMakeLists.txt +--- usd.orig/pxr/usd/CMakeLists.txt 2019-10-24 22:39:53.000000000 +0200 ++++ external_usd/pxr/usd/CMakeLists.txt 2019-11-28 13:00:33.197957712 +0100 +@@ -1,6 +1,5 @@ + set(DIRS + lib +- bin + plugin + ) + +@@ -8,3 +7,8 @@ + add_subdirectory(${d}) + endforeach() + ++if (PXR_BUILD_USD_TOOLS) ++ add_subdirectory(bin) ++else() ++ message(STATUS "Skipping commandline tools because PXR_BUILD_USD_TOOLS=OFF") ++endif() +diff -Naur external_usd_orig/pxr/base/lib/tf/preprocessorUtils.h external_usd/pxr/base/lib/tf/preprocessorUtils.h +--- external_usd_orig/pxr/base/lib/tf/preprocessorUtils.h 2019-10-24 14:39:53 -0600 ++++ external_usd/pxr/base/lib/tf/preprocessorUtils.h 2020-01-14 09:30:18 -0700 +@@ -189,7 +189,7 @@ + /// Exapnds to 1 if the argument is a tuple, and 0 otherwise. + /// \ingroup group_tf_Preprocessor + /// \hideinitializer +-#if defined(ARCH_OS_WINDOWS) ++#if defined(ARCH_COMPILER_MSVC) + #define TF_PP_IS_TUPLE(sequence) \ + BOOST_VMD_IS_TUPLE(sequence) + #else +diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros/Public.cmake +--- external_usd_base/cmake/macros/Public.cmake 2019-10-24 14:39:53 -0600 ++++ external_usd/cmake/macros/Public.cmake 2020-01-11 13:33:29 -0700 +@@ -996,6 +996,12 @@ + foreach(lib ${PXR_OBJECT_LIBS}) + string(TOUPPER ${lib} uppercaseName) + list(APPEND exports "${uppercaseName}_EXPORTS=1") ++ # When building for blender, we do NOT want to export all symbols on windows. ++ # This is a dirty hack, but USD makes it impossible to do the right thing ++ # with the default options exposed. ++ if (WIN32) ++ list(APPEND exports "PXR_STATIC=1") ++ endif() + endforeach() + foreach(lib ${PXR_OBJECT_LIBS}) + set(objects "${objects};\$<TARGET_OBJECTS:${lib}>") |