From d8cd03649f6c2238e92922d54f866c19d0777400 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 16:40:54 +0200 Subject: [PATCH 01/13] Add usd package --- recipes/usd/meta.yaml | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 recipes/usd/meta.yaml diff --git a/recipes/usd/meta.yaml b/recipes/usd/meta.yaml new file mode 100644 index 0000000000000..bb558f2a386bf --- /dev/null +++ b/recipes/usd/meta.yaml @@ -0,0 +1,48 @@ +{% 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: 9b5bfd811ee523be601f11abc514a93c67fe5c6e957cd6c36fe6ea4f28e009bb + +build: + number: 0 + run_exports: + - {{ pin_subpackage(name, max_pin='x.x') }} + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - ninja + - cmake + - python + host: + - openssl + run: + - openssl + +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 From 5903eb652426f16151ed786b37a500c44f19aa68 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 16:43:25 +0200 Subject: [PATCH 02/13] Create build.sh --- recipes/usd/build.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 recipes/usd/build.sh diff --git a/recipes/usd/build.sh b/recipes/usd/build.sh new file mode 100644 index 0000000000000..7465daa02088c --- /dev/null +++ b/recipes/usd/build.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +mkdir build +cd build + +cmake ${CMAKE_ARGS} -GNinja .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TESTING=ON \ + -DPXR_HEADLESS_TEST_MODE=ON \ + -DPXR_BUILD_IMAGING=OFF \ + -DPXR_BUILD_USD_IMAGING=OFF \ + -DPXR_ENABLE_PYTHON_SUPPORT=OFF + +cmake --build . --config Release +cmake --build . --config Release --target install +ctest --output-on-failure -C Release From 99dd61a72b782d72902f1e2f6f46f9136e9e3b5b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 16:45:12 +0200 Subject: [PATCH 03/13] Create bld.bat --- recipes/usd/bld.bat | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 recipes/usd/bld.bat diff --git a/recipes/usd/bld.bat b/recipes/usd/bld.bat new file mode 100644 index 0000000000000..18129a807f07c --- /dev/null +++ b/recipes/usd/bld.bat @@ -0,0 +1,27 @@ +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 ^ + %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 From c178360a11b49332d2e6b5c0f062f1f0de56740f Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 16:51:59 +0200 Subject: [PATCH 04/13] Update meta.yaml --- recipes/usd/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/usd/meta.yaml b/recipes/usd/meta.yaml index bb558f2a386bf..b3ea40ff92efa 100644 --- a/recipes/usd/meta.yaml +++ b/recipes/usd/meta.yaml @@ -7,7 +7,7 @@ package: source: - url: https://github.com/PixarAnimationStudios/USD/archive/v{{ version }}.tar.gz - sha256: 9b5bfd811ee523be601f11abc514a93c67fe5c6e957cd6c36fe6ea4f28e009bb + sha256: c124c2d99922800f82dcbd0765d38a4f79443880e550ecb1e0532a334f359526 build: number: 0 From a2c646d8c18c0f3d99b417c55a667215abd2ea1b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 16:53:20 +0200 Subject: [PATCH 05/13] Update bld.bat --- recipes/usd/bld.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/usd/bld.bat b/recipes/usd/bld.bat index 18129a807f07c..6e9c754c190d1 100644 --- a/recipes/usd/bld.bat +++ b/recipes/usd/bld.bat @@ -11,6 +11,7 @@ cmake ^ -DPXR_BUILD_IMAGING:BOOL=OFF ^ -DPXR_BUILD_USD_IMAGING=OFF ^ -DPXR_ENABLE_PYTHON_SUPPORT=OFF ^ + -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY:BOOL=ON ^ %SRC_DIR% if errorlevel 1 exit 1 From 4bcd0d22f4a3ff06307cd20147eab12bd0d96f0b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 16:54:09 +0200 Subject: [PATCH 06/13] Update build.sh --- recipes/usd/build.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/recipes/usd/build.sh b/recipes/usd/build.sh index 7465daa02088c..2c8aabc3e0029 100644 --- a/recipes/usd/build.sh +++ b/recipes/usd/build.sh @@ -5,11 +5,12 @@ cd build cmake ${CMAKE_ARGS} -GNinja .. \ -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_TESTING=ON \ - -DPXR_HEADLESS_TEST_MODE=ON \ - -DPXR_BUILD_IMAGING=OFF \ - -DPXR_BUILD_USD_IMAGING=OFF \ - -DPXR_ENABLE_PYTHON_SUPPORT=OFF + -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 cmake --build . --config Release cmake --build . --config Release --target install From 8173048ae7347e0776d7b6b270691fb7b4ba50c5 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 16:57:31 +0200 Subject: [PATCH 07/13] Update meta.yaml --- recipes/usd/meta.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/recipes/usd/meta.yaml b/recipes/usd/meta.yaml index b3ea40ff92efa..c3c538e2a0c9e 100644 --- a/recipes/usd/meta.yaml +++ b/recipes/usd/meta.yaml @@ -20,11 +20,8 @@ requirements: - {{ compiler('cxx') }} - ninja - cmake - - python host: - - openssl - run: - - openssl + - boost-cpp test: commands: From e4a02914288576d99cf919475ed0677008dce34d Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 17:00:18 +0200 Subject: [PATCH 08/13] Update meta.yaml --- recipes/usd/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/usd/meta.yaml b/recipes/usd/meta.yaml index c3c538e2a0c9e..04de51815f488 100644 --- a/recipes/usd/meta.yaml +++ b/recipes/usd/meta.yaml @@ -22,6 +22,8 @@ requirements: - cmake host: - boost-cpp + # Pinned due to https://github.com/PixarAnimationStudios/USD/issues/1471 + - tbb-devel 2020.2 test: commands: From e5e68dc537eb11ba56bad6faae2521eb348ba7fa Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 17:47:36 +0200 Subject: [PATCH 09/13] Update bld.bat --- recipes/usd/bld.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/usd/bld.bat b/recipes/usd/bld.bat index 6e9c754c190d1..6fd0d599148bc 100644 --- a/recipes/usd/bld.bat +++ b/recipes/usd/bld.bat @@ -12,6 +12,7 @@ cmake ^ -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 From f0174a7bb600fa0f619f5a1dc7fbd64eb0d73863 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 17:47:51 +0200 Subject: [PATCH 10/13] Update build.sh --- recipes/usd/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/usd/build.sh b/recipes/usd/build.sh index 2c8aabc3e0029..8fe52a763daae 100644 --- a/recipes/usd/build.sh +++ b/recipes/usd/build.sh @@ -10,7 +10,8 @@ cmake ${CMAKE_ARGS} -GNinja .. \ -DPXR_BUILD_IMAGING:BOOL=OFF \ -DPXR_BUILD_USD_IMAGING:BOOL=OFF \ -DPXR_ENABLE_PYTHON_SUPPORT:BOOL=OFF \ - -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY:BOOL=ON + -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY:BOOL=ON \ + -DPXR_USE_PYTHON_3:BOOL=ON cmake --build . --config Release cmake --build . --config Release --target install From ae6d6f434393485729cb47d085197932999f7f82 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 18:03:50 +0200 Subject: [PATCH 11/13] Create support_old_macos.patch --- recipes/usd/support_old_macos.patch | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 recipes/usd/support_old_macos.patch 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; From 5893ffefb5f6429dd3308b5316d61cb985bc9baa Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 18:04:07 +0200 Subject: [PATCH 12/13] Update meta.yaml --- recipes/usd/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/usd/meta.yaml b/recipes/usd/meta.yaml index 04de51815f488..0274a658955a1 100644 --- a/recipes/usd/meta.yaml +++ b/recipes/usd/meta.yaml @@ -8,6 +8,8 @@ package: source: - url: https://github.com/PixarAnimationStudios/USD/archive/v{{ version }}.tar.gz sha256: c124c2d99922800f82dcbd0765d38a4f79443880e550ecb1e0532a334f359526 + patches: + - support_old_macos.patch build: number: 0 From adc9196c4be72182ddbffae421d5a1081ba9a166 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 28 Oct 2021 18:30:11 +0200 Subject: [PATCH 13/13] Update meta.yaml --- recipes/usd/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/usd/meta.yaml b/recipes/usd/meta.yaml index 0274a658955a1..34b0890861cd0 100644 --- a/recipes/usd/meta.yaml +++ b/recipes/usd/meta.yaml @@ -26,6 +26,8 @@ requirements: - boost-cpp # Pinned due to https://github.com/PixarAnimationStudios/USD/issues/1471 - tbb-devel 2020.2 + run: + - boost-cpp test: commands: