summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1f90d98b25e0fc585d83181e3f9f0989150fd4d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/hint/bash
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
# shellcheck disable=SC2034,SC2154 # unused/uninitialized variables.
# shellcheck disable=SC2191
[[ -v TRAVIS ]] && DISABLE_PYTHON=1

# Configuration.
_ver="v20.05" #switch to last blender supported version, latest is "v20.08"
_fragment="#tag=$_ver"
if ((DISABLE_PYTHON)); then
  _CMAKE_FLAGS+=( "-DPXR_ENABLE_PYTHON_SUPPORT:BOOL=OFF" )
  makedepends+=( python2 )
else
  _CMAKE_FLAGS+=( -DPXR_PYTHON_SHEBANG:STRING="/usr/bin/python2" )
  eval "depends+=( python2{,-opengl,-pyside} )"
  eval "makedepends+=( python2-{jinja,pyside-tools} )"
fi

pkgname=usd
pkgver=${_ver#v}
pkgrel=1
pkgdesc="3D VFX pipeline interchange file format."
arch=('x86_64')
url="https://www.openusd.org"
license=('Apache')
depends+=('boost-libs' 'glew' 'openexr' 'opensubdiv')
makedepends+=('boost' 'cmake' 'git' 'intel-tbb' 'ninja')
provides=("usd=${pkgver}")
source=("git+https://github.com/PixarAnimationStudios/USD.git${_fragment}"
        "boost_python2.patch"
        "blender.patch")
sha256sums=('SKIP'
            '2f595ce72b9fb33e6da7db97b02be11fe6262e31b83b0e59232ee8713afed97e'
            '95a4934ae8154e1650a024b09ed3237ba7d9411ada089a4b6337cbba9312705a')

prepare() {
  git -C USD apply -v "${srcdir}"/{boost_python2,blender}.patch
}

#pkgver() {
#  git -C USD describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
#}

build() {
  _CMAKE_FLAGS+=(
    -DCMAKE_INSTALL_PREFIX:PATH=/usr
    -DPXR_BUILD_TESTS:BOOL=OFF
    -DPXR_BUILD_MONOLITHIC:BOOL=ON          # Required by blender-2.83
    -DBoost_NO_BOOST_CMAKE=ON               # Fix boost overwriting boost_python27 with boost_python
    -DPXR_SET_INTERNAL_NAMESPACE=usdBlender
    -DBUILD_SHARED_LIBS=ON
    -DCMAKE_DEBUG_POSTFIX=_d
  )
  cmake -S USD -B build -G Ninja "${_CMAKE_FLAGS[@]}"
# shellcheck disable=SC2046
  ninja -C build ${MAKEFLAGS:--j1}
}

#check() {
#  ninja -C build test
#}

package() {
  DESTDIR="$pkgdir" ninja -C build install
}

# vim:set ts=2 sw=2 et: