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

Dev #3

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
64 changes: 64 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
image: Visual Studio 2017

clone_folder: c:\projects\USDPackaging

branches:
only:
- gbk

platform:
- x64

install:
- ps: $env:USD_YY_VERSION = (Get-Content c:\projects\USD\cmake\defaults\Version.cmake | Where-Object {$_ -match 'PXR_MINOR_VERSION'}).Split("( )")[2].Trim('"').PadLeft(2, "0")
- ps: $env:USD_MM_VERSION = (Get-Content c:\projects\USD\cmake\defaults\Version.cmake | Where-Object {$_ -match 'PXR_PATCH_VERSION'}).Split("( )")[2].Trim('"').PadLeft(2, "0")
- ps: Update-AppveyorBuild -Version "$env:USD_YY_VERSION.$env:USD_MM_VERSION-$env:APPVEYOR_REPO_BRANCH-build$env:APPVEYOR_BUILD_NUMBER"
- ps: Invoke-WebRequest https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2019/Autodesk_Maya_2019_2_Update_DEVKIT_Windows.zip -OutFile devkit_maya2019.zip
- echo "extracting maya devkit 2019 archive..."
- ps: Expand-Archive -Path devkit_maya2019.zip -DestinationPath c:/USDgen/src/devkit_maya2019 -Force
- ps: Invoke-WebRequest https://s3-us-west-2.amazonaws.com/autodesk-adn-transfer/ADN+Extranet/M%26E/Maya/devkit+2018/Autodesk_Maya_2018_6_Update_DEVKIT_Windows.zip -OutFile devkit_maya2018.zip
- echo "extracting maya devkit 2018 archive..."
- ps: Expand-Archive -Path devkit_maya2018.zip -DestinationPath C:/USDgen/src/devkit_maya2018 -Force

cache:
- C:\USDgen\build\boost -> build_scripts/build_usd.py
- C:\USDgen\build\IlmBase -> build_scripts/build_usd.py
- C:\USDgen\build\OpenEXR -> build_scripts/build_usd.py
- C:\USDgen\build\OpenSubdiv-3_1_1 -> build_scripts/build_usd.py
- C:\USDgen\build\zlib-1.2.11 -> build_scripts/build_usd.py
- C:\USDgen\src -> build_scripts/build_usd.py

init:
- set PATH=c:/Python27-x64;c:/Python27-x64/Scripts;%PATH%
- C:\"Program Files (x86)"\"Microsoft Visual Studio"\2017\Community\VC\Auxiliary\Build\vcvarsall.bat amd64
- git clone --single-branch --branch gbk https://github.com/goodbyekansas/USD c:/projects/USD
- git clone --single-branch --branch gbk-master https://github.com/goodbyekansas/maya-usd c:/projects/maya-usd
- git clone https://github.com/goodbyekansas/usd-qt.git c:/projects/usd-qt

before_build:
- python -m pip install --upgrade pip
- pip install pyside
- pip install PyOpenGL

build_script:
- cd c:/projects/USD
- python build_scripts/build_usd.py -vvv --build c:/USDgen/build --src c:/USDgen/src %APPVEYOR_BUILD_FOLDER%/USDinst/USD-core
- cd c:/USDgen/build
- dir
- cd c:/projects/maya-usd
- python build.py -v 3 --pxrusd-location %APPVEYOR_BUILD_FOLDER%/USDinst/USD-core --build-args="-DSKIP_USDMAYA_TESTS=ON,-DUFE_INCLUDE_DIR=c:/USDgen/src/devkit_maya2019/devkitBase/devkit/ufe/include,-DUFE_LIBRARY=c:/USDgen/src/devkit_maya2019/devkitBase/devkit/ufe/lib,-DMAYA_INCLUDE_DIRS=c:/USDgen/src/devkit_maya2019/devkitBase/include" --install-location c:/Usdinst/maya-usd-2019 /tmp/workspace_maya2019 --devkit-location=c:/USDgen/src/devkit_maya2019/devkitBase/devkit
- python build.py -v 3 --pxrusd-location %APPVEYOR_BUILD_FOLDER%/USDinst/USD-core --build-args="-DSKIP_USDMAYA_TESTS=ON,-DUFE_INCLUDE_DIR=c:/USDgen/src/devkit_maya2018/devkitBase/devkit/ufe/include,-DUFE_LIBRARY=c:/USDgen/src/devkit_maya2018/devkitBase/devkit/ufe/lib,-DMAYA_INCLUDE_DIRS=c:/USDgen/src/devkit_maya2018/devkitBase/include" --install-location c:/Usdinst/maya-usd-2018 /tmp/workspace_maya2018 --devkit-location=c:/USDgen/src/devkit_maya2018/devkitBase/devkit

artifacts:
- path: USDInst
name: USD.19
type: zip

deploy:
- provider: GitHub
artifact: USD.19.zip
draft: false
prerelease: True
on:
branch: dev

74 changes: 74 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Windows Packaging
on: push

jobs:
build-core:
name: Build USD Core
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Get version for USD GBK fork
run: echo "::set-env name=USD_REF::$((Get-Content .\versions.json | ConvertFrom-Json).core)"
- name: Checkout USD GBK fork
uses: actions/checkout@v1
with:
repository: goodbyekansas/USD
ref: ${{ env.USD_REF }}
path: usd-core
- name: Set up Python 2.7 Environment
uses: actions/setup-python@v1
with:
python-version: '2.7.x'
architecture: 'x64'
- name: Install Python prereqs
run: |
pip install PySide PyOpenGL Jinja2
- name: Build USD Core
run: |
. ./windows/latest-vs.ps1
./windows/build-usd-core.ps1 -pythondir "$Env:pythonLocation" -installdir ../result/usd-core -srcdir ../usd-core -builddir ../build/usd-core
- name: Zip USD Core Installed Files
run: 7z a usd-core-windows.zip ..\result\usd-core\*
- name: Upload USD Core Installation
uses: actions/upload-artifact@v1
with:
name: usd-core-windows
path: usd-core-windows.zip

build-usd-maya-2019:
name: Build USD Maya 2019
runs-on: windows-latest
needs: build-core
steps:
- uses: actions/checkout@v1
- name: Checkout Maya USD GBK fork
uses: actions/checkout@v1
with:
repository: goodbyekansas/maya-usd
ref: gbk-master
path: usd-maya
- name: Set up Python 2.7 Environment
uses: actions/setup-python@v1
with:
python-version: '2.7.x'
architecture: 'x64'
- name: Download USD core build
uses: actions/download-artifact@v1
with:
name: usd-core-windows
path: ../result/usd-core
- name: Download Maya 2019 DevKit
run: |
Invoke-WebRequest https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2019/Autodesk_Maya_2019_2_Update_DEVKIT_Windows.zip -OutFile devkit_maya2019.zip
Expand-Archive -Path devkit_maya2019.zip -DestinationPath ..\maya-devkit -Force
- name: Install Python prereqs
run: pip install PySide PyOpenGL Jinja2
- name: Compile USD Maya 2019
run: ./windows/build-maya-usd.ps1 -srcdir ../usd-maya -builddir ../build/usd-maya -pythondir $Env:pythonLocation -usdcorelocation ../result/usd-core -patchdir ./windows/patches -devkitlocation ../maya-devkit -installdir ../result/usd-maya
- name: Zip all the files
run: 7z a usd-maya-2019-windows.zip ..\result\usd-maya\*
- name: Upload USD Maya 2019 build
uses: actions/upload-artifact@v1
with:
name: usd-maya-2019
path: usd-maya-2019-windows.zip
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sources
result
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
# USDPackaging
Packaging for USD on Windows and Linux

# Building on Windows

- Download and install Visual Studio 2019 (Community Edition is fine) from
[here](https://visualstudio.microsoft.com/downloads/). Make sure to select the "Desktop development with C++" workload during the installation.
- Make sure Python 2 is installed and available in PATH

## USD Core
- Open a powershell prompt with administrative permissions.
- First, some environment variables need to be set up for Visual Studio. This is done by using the
Powershell script at `./windows/latest-vs.ps1` like this:
```shell
. ./windows/latest-vs.ps1
```
- Kick off the build process by issuing:
```shell
./windows/build-usd-core.ps1 -installdir <dir-to-put-result-in> -srcdir <path-to-us-core-clone> -builddir <dir-to-put-temp-build-stuff-in>
```

You can also use the python build script in the USD core sync directly but our powershell script
makes sure to set needed boost options for building maya USD later.

## USD Maya
16 changes: 16 additions & 0 deletions maya-devkit.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ nixpkgs ? import <nixpkgs> {} }:
with nixpkgs;
stdenv.mkDerivation {
name = "maya-devkit";
src = fetchurl {
url = "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2019/Autodesk_Maya_2019_2_Update_DEVKIT_Linux.tgz";
sha256 = "11v7hi1n01j7p7wkqabdjllndkic96mv6nq83rqh845psc684hs1";
};

phases = [ "unpackPhase" "buildPhase" ];

buildPhase = ''
cp -r . $out
'';
}

43 changes: 43 additions & 0 deletions maya-usd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{ nixpkgs ? import <nixpkgs> {} }:
let
usd-core = nixpkgs.callPackage ./usd-core.nix {};
maya-devkit = nixpkgs.callPackage ./maya-devkit.nix {};
in
with nixpkgs;
(overrideCC stdenv gcc6).mkDerivation {
name = "maya-usd";
nativeBuildInputs = [
cmake
git
cacert
];

buildInputs = [
libGL
usd-core
python27
maya-devkit
python27Packages.jinja2
python27Packages.pyopengl
python27Packages.pyside2
xorg.libX11
];

src = fetchFromGitHub {
owner = "goodbyekansas";
repo = "maya-usd";
rev = "master";
sha256 = "0idwxim4hfgkjv22rdikpbjzrm8zr7s6rfhlbp95ai4xb59zp0p0";
};



phases = [ "unpackPhase" "buildPhase" ];

buildPhase = ''
ls ${usd-core}/bin
export PATH=${usd-core}/bin:$PATH
${python27}/bin/python build.py --pxrusd-location ${usd-core} --maya-location /usr/autodesk/maya2019 --build-args="-DSKIP_USDMAYA_TESTS=ON" --install-location $out /tmp/workspace
'';
}

40 changes: 40 additions & 0 deletions usd-core.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{ nixpkgs ? import <nixpkgs> {} }:
let
pyenv = (nixpkgs.python27.withPackages (ps: with ps; [ pyside2 jinja2 pyopengl pyside2-tools ]));
in
with nixpkgs;
gcc6Stdenv.mkDerivation {
name = "USD-Core";
nativeBuildInputs = [
cmake
cacert
];

buildInputs = [
glew
xorg.libXxf86vm
xorg.libXrandr
xorg.libXcursor
xorg.libXinerama
xorg.libXi
zlib
];

propagatedBuildInputs = [
pyenv
];

src = fetchFromGitHub {
owner = "goodbyekansas";
repo = "USD";
rev = "gbk";
sha256 = "0i9b42sncs7mbg60198x6xzm8zr93g3c0pk0iwwf2srmn4vfz5cz";
};

phases = [ "unpackPhase" "buildPhase" ];

TBB_PLATFORM=linux;
buildPhase = ''
${pyenv}/bin/python build_scripts/build_usd.py --build-args boost,"--with-date_time --with-thread --with-system --with-filesystem" --no-maya -v $out/
'';
}
4 changes: 4 additions & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"core": "6bb97b31ccf6cbc5919aa1b376798ddf226e82cd",
"maya": "gbk-master"
}
30 changes: 30 additions & 0 deletions windows/build-maya-usd.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
param (
[Parameter(Mandatory=$true)][string]$srcdir,
[Parameter(Mandatory=$true)][string]$builddir,
[Parameter(Mandatory=$true)][string]$installdir,
[Parameter(Mandatory=$true)][string]$usdcorelocation,
[Parameter(Mandatory=$true)][string]$devkitlocation,
[string]$pythondir = "C:\Python27",
[Parameter(Mandatory=$true)][string]$patchdir
)

# these need to be full paths for CMake to find things
$usdcorelocation = (Resolve-Path $usdcorelocation).Path
$devkitlocation = (Resolve-Path $devkitlocation).Path

echo "Applying patches to usd core..."
git apply --directory=$usdcorelocation --unsafe-paths (get-item $patchdir\*.patch)

if ($?) {
echo "Patches applied"
} else {
echo "Failed to apply patches, exiting..."
#exit 1
}

python $srcdir/build.py $builddir `
--devkit-location $devkitlocation/devkitBase `
--pxrusd-location $usdcorelocation `
--install-location $installdir `
--generator "Visual Studio 16 2019" `
--build-relwithdebug
26 changes: 26 additions & 0 deletions windows/build-usd-core.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
param (
[string]$pythondir,
[string]$installdir = "installed",
[Parameter(Mandatory=$true)][string]$srcdir,
[Parameter(Mandatory=$true)][string]$builddir
)

$srcdir = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($srcdir)
$installdir = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($installdir)
$builddir = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($builddir)

$pythondirarg = ""
if ($pythondir) {
$pythondirarg = "-DPython_ROOT_DIR='$pythondir' -DPython_EXECUTABLE='$pythondir\python.exe'"
}

$usdoptions = ""
if ($pythondirarg) {
$usdoptions = "USD,$pythondirarg"
}

python $srcdir/build_scripts/build_usd.py `
--build $builddir/build `
--src $builddir/src `
$installdir `
--build-args $usdoptions boost,"--with-date_time --with-thread --with-system --with-filesystem"
6 changes: 6 additions & 0 deletions windows/latest-vs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$vswhere = "$Env:ProgramFiles (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
$installationPath = & $vswhere -latest -property installationPath
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -no_logo -arch=amd64 && set" | foreach-object {
$name, $value = $_ -split '=', 2
set-content env:\"$name" $value
}
11 changes: 11 additions & 0 deletions windows/patches/hdstream.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/cmake/pxrTargets-release.cmake
+++ b/cmake/pxrTargets-release.cmake
@@ -343,7 +343,7 @@ set_target_properties(hdStream PROPERTIES
)

list(APPEND _IMPORT_CHECK_TARGETS hdStream )
-list(APPEND _IMPORT_CHECK_FILES_FOR_hdStream "${_IMPORT_PREFIX}/plugin/usd/hdStream.lib" "${_IMPORT_PREFIX}/plugin/usd/hdStream.dll" )
+# list(APPEND _IMPORT_CHECK_FILES_FOR_hdStream "${_IMPORT_PREFIX}/plugin/usd/hdStream.lib" "${_IMPORT_PREFIX}/plugin/usd/hdStream.dll" )

# Import target "usdImaging" for configuration "Release"
set_property(TARGET usdImaging APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
11 changes: 11 additions & 0 deletions windows/patches/usddancingcubes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/cmake/pxrTargets-release.cmake
+++ b/cmake/pxrTargets-release.cmake
@@ -433,7 +433,7 @@ set_target_properties(usdDancingCubesExample PROPERTIES
)

list(APPEND _IMPORT_CHECK_TARGETS usdDancingCubesExample )
-list(APPEND _IMPORT_CHECK_FILES_FOR_usdDancingCubesExample "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdDancingCubesExample.lib" "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdDancingCubesExample.dll" )
+# list(APPEND _IMPORT_CHECK_FILES_FOR_usdDancingCubesExample "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdDancingCubesExample.lib" "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdDancingCubesExample.dll" )

# Import target "usdRecursivePayloadsExample" for configuration "Release"
set_property(TARGET usdRecursivePayloadsExample APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
11 changes: 11 additions & 0 deletions windows/patches/usdobj.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/cmake/pxrTargets-release.cmake
+++ b/cmake/pxrTargets-release.cmake
@@ -423,7 +423,7 @@ set_target_properties(usdObj PROPERTIES
)

list(APPEND _IMPORT_CHECK_TARGETS usdObj )
-list(APPEND _IMPORT_CHECK_FILES_FOR_usdObj "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdObj.lib" "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdObj.dll" )
+# list(APPEND _IMPORT_CHECK_FILES_FOR_usdObj "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdObj.lib" "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdObj.dll" )

# Import target "usdDancingCubesExample" for configuration "Release"
set_property(TARGET usdDancingCubesExample APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
11 changes: 11 additions & 0 deletions windows/patches/usdrecursivepayload.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/cmake/pxrTargets-release.cmake
+++ b/cmake/pxrTargets-release.cmake
@@ -443,7 +443,7 @@ set_target_properties(usdRecursivePayloadsExample PROPERTIES
)

list(APPEND _IMPORT_CHECK_TARGETS usdRecursivePayloadsExample )
-list(APPEND _IMPORT_CHECK_FILES_FOR_usdRecursivePayloadsExample "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdRecursivePayloadsExample.lib" "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdRecursivePayloadsExample.dll" )
+# list(APPEND _IMPORT_CHECK_FILES_FOR_usdRecursivePayloadsExample "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdRecursivePayloadsExample.lib" "${_IMPORT_PREFIX}/share/usd/examples/plugin/usdRecursivePayloadsExample.dll" )

# Import target "usdSchemaExamples" for configuration "Release"
set_property(TARGET usdSchemaExamples APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
Loading