Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding usd package #16666

Closed
wants to merge 13 commits into from
Closed
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
29 changes: 29 additions & 0 deletions recipes/usd/bld.bat
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions recipes/usd/build.sh
Original file line number Diff line number Diff line change
@@ -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
51 changes: 51 additions & 0 deletions recipes/usd/meta.yaml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions recipes/usd/support_old_macos.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From b926805925649e70a9fbb00c1c46b14cf2297b07 Mon Sep 17 00:00:00 2001
From: Silvio Traversaro <[email protected]>
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;