diff --git a/recipes/usd/bld.bat b/recipes/usd/bld.bat new file mode 100644 index 0000000000000..6fd0d599148bc --- /dev/null +++ b/recipes/usd/bld.bat @@ -0,0 +1,29 @@ +mkdir build +cd build + +cmake ^ + -G "Ninja" ^ + -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DBUILD_TESTING:BOOL=ON ^ + -DBUILD_SHARED_LIBS:BOOL=ON ^ + -DPXR_HEADLESS_TEST_MODE:BOOL=ON ^ + -DPXR_BUILD_IMAGING:BOOL=OFF ^ + -DPXR_BUILD_USD_IMAGING=OFF ^ + -DPXR_ENABLE_PYTHON_SUPPORT=OFF ^ + -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY:BOOL=ON ^ + -DPXR_USE_PYTHON_3:BOOL=ON ^ + %SRC_DIR% +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --config Release +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --config Release --target install +if errorlevel 1 exit 1 + +:: Test. +ctest --output-on-failure -C Release +if errorlevel 1 exit 1 diff --git a/recipes/usd/build.sh b/recipes/usd/build.sh new file mode 100644 index 0000000000000..8fe52a763daae --- /dev/null +++ b/recipes/usd/build.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +mkdir build +cd build + +cmake ${CMAKE_ARGS} -GNinja .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TESTING:BOOL=ON \ + -DPXR_HEADLESS_TEST_MODE:BOOL=ON \ + -DPXR_BUILD_IMAGING:BOOL=OFF \ + -DPXR_BUILD_USD_IMAGING:BOOL=OFF \ + -DPXR_ENABLE_PYTHON_SUPPORT:BOOL=OFF \ + -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY:BOOL=ON \ + -DPXR_USE_PYTHON_3:BOOL=ON + +cmake --build . --config Release +cmake --build . --config Release --target install +ctest --output-on-failure -C Release diff --git a/recipes/usd/meta.yaml b/recipes/usd/meta.yaml new file mode 100644 index 0000000000000..34b0890861cd0 --- /dev/null +++ b/recipes/usd/meta.yaml @@ -0,0 +1,51 @@ +{% set name = "usd" %} +{% set version = "21.08" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + - url: https://github.com/PixarAnimationStudios/USD/archive/v{{ version }}.tar.gz + sha256: c124c2d99922800f82dcbd0765d38a4f79443880e550ecb1e0532a334f359526 + patches: + - support_old_macos.patch + +build: + number: 0 + run_exports: + - {{ pin_subpackage(name, max_pin='x.x') }} + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - ninja + - cmake + host: + - boost-cpp + # Pinned due to https://github.com/PixarAnimationStudios/USD/issues/1471 + - tbb-devel 2020.2 + run: + - boost-cpp + +test: + commands: + - test -f ${PREFIX}/include/pxr/pxr.h # [not win] + - test -f ${PREFIX}/lib/libusd_ms.so # [linux] + - test -f ${PREFIX}/lib/libusd_ms.dylib # [osx] + - test -f ${PREFIX}/pxrConfig.cmake # [not win] + - if not exist %PREFIX%\\Library\\include\\pxr\\pxr.h exit 1 # [win] + - if not exist %PREFIX%\\Library\\lib\\usd_ms.lib exit 1 # [win] + - if not exist %PREFIX%\\Library\\bin\\usd_ms.dll exit 1 # [win] + - if not exist %PREFIX%\\Library\\pxrConfig.cmake exit 1 # [win] + +about: + home: https://github.com/PixarAnimationStudios/USD + license: Apache-2.0 + license_file: LICENSE.txt + summary: Library to read and write Universal Scene Description (USD) files. + +extra: + recipe-maintainers: + - traversaro diff --git a/recipes/usd/support_old_macos.patch b/recipes/usd/support_old_macos.patch new file mode 100644 index 0000000000000..3d9c07ae4cafb --- /dev/null +++ b/recipes/usd/support_old_macos.patch @@ -0,0 +1,23 @@ +From b926805925649e70a9fbb00c1c46b14cf2297b07 Mon Sep 17 00:00:00 2001 +From: Silvio Traversaro +Date: Thu, 28 Oct 2021 18:03:15 +0200 +Subject: [PATCH] Support macOS SDK in which MAP_ANONYMOUS is not defined + +See https://gitlab.gnome.org/GNOME/gtk-vnc/-/issues/4 +--- + pxr/base/arch/virtualMemory.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pxr/base/arch/virtualMemory.cpp b/pxr/base/arch/virtualMemory.cpp +index a04ae68b8a..f5ac332678 100644 +--- a/pxr/base/arch/virtualMemory.cpp ++++ b/pxr/base/arch/virtualMemory.cpp +@@ -67,7 +67,7 @@ void * + ArchReserveVirtualMemory(size_t numBytes) + { + void *addr = mmap(NULL, numBytes, PROT_NONE, +- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); ++ MAP_PRIVATE | MAP_ANON, -1, 0); + if (!addr || addr == MAP_FAILED) + return nullptr; + return addr;