blob: d6b550e03325ad3965ada18632a8541a7aef92f9 (
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
# Maintainer: Alex Hirzel <alex at hirzel period us>
pkgname=mitsuba2-git
pkgver=r2078.76445e90
pkgrel=2
pkgdesc="A Retargetable Forward and Inverse Renderer"
arch=('x86_64')
url="https://www.mitsuba-renderer.org/"
license=('custom')
groups=()
depends=('libpng' 'libjpeg-turbo' 'libc++' 'pugixml' 'tbb')
makedepends=('clang' 'git' 'cmake' 'ninja' 'python' 'python-sphinx' 'python-guzzle-sphinx-theme' 'python-sphinxcontrib-bibtex')
checkdepends=('python-pytest' 'python-pytest-xdist' 'python-numpy')
install=
source=('swap_pybind.patch'
'swap_pugixml.patch'
'swap_tbb.patch'
'swap_pybind_enoki.patch'
'git+https://github.com/mitsuba-renderer/mitsuba2.git'
'git+https://github.com/mitsuba-renderer/asmjit.git'
'git+https://github.com/mitsuba-renderer/enoki.git'
'git+https://github.com/mitsuba-renderer/tinyformat.git'
'git+https://github.com/mitsuba-renderer/mitsuba-data.git'
'git+https://github.com/mitsuba-renderer/openexr.git')
md5sums=('e40fe4bf313d60b1eb7c3da60fb6d434'
'617bd32eecbebd8c7036f738b8275e5f'
'3d896789646b5de546668d9f158697d1'
'eee8327568bbe7e0fa0a8d873eb2dea0'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP')
pkgver() {
cd "$srcdir/${pkgname%-git}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "$srcdir/${pkgname%-git}"
# submodules, some of which need to be compiled with the same compiler as
# mitsuba itself so that ABIs line up
git config submodule.ext/asmjit.url $srcdir/asmjit
git config submodule.ext/enoki.url $srcdir/enoki
git config submodule.ext/tinyformat.url $srcdir/tinyformat
git config submodule.ext/openexr.url $srcdir/openexr
git config submodule.resources/data.url $srcdir/mitsuba-data
git submodule update --init ext/asmjit ext/enoki ext/tinyformat ext/openexr resources/data
# system versions of these modules are used
rmdir ext/zlib ext/libpng ext/libjpeg
# patch the build system to use system versions
rmdir ext/pugixml ext/pybind11
patch -p1 < ../../swap_pybind.patch
patch -p1 < ../../swap_pugixml.patch
patch -p1 < ../../swap_tbb.patch
patch -p1 -d ext/enoki < ../../swap_pybind_enoki.patch
# not used with the current build options
rmdir ext/embree ext/nanogui
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
CC=clang CXX=clang++ cmake -DCMAKE_MODULE_PATH=$site_packages/pybind11/share/cmake/pybind11/ -DMTS_ENABLE_PYTHON=yes -DMTS_ENABLE_GUI=no -DMTS_ENABLE_EMBREE=no -DCMAKE_INSTALL_PREFIX=$pkgdir -GNinja -B "$srcdir/build"
ninja -C "$srcdir/build" mkdoc
}
package() {
cd "$srcdir/${pkgname%-git}"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
ninja -C "$srcdir/build" install
cd "$srcdir/build"
# adapt rpath to where libraries will be installed (so they do not conflict
# with other installed libraries)
patchelf --remove-rpath dist/mitsuba dist/python/mitsuba/*.so dist/libIlmImf.so dist/libIlmThread.so dist/libImath.so
patchelf --set-rpath '/usr/lib/mitsuba2' dist/mitsuba dist/python/mitsuba/*.so
install -Dm755 dist/mitsuba "$pkgdir/usr/bin/mitsuba2"
install -Dm644 dist/*.so -t "$pkgdir/usr/lib/mitsuba2"
install -Dm644 dist/plugins/*.so -t "$pkgdir/usr/lib/mitsuba2/plugins"
# install data
mkdir -p "$pkgdir/usr/share/mitsuba2"
cp -R dist/data "$pkgdir/usr/share/mitsuba2/data"
# install python module
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
mkdir -p "$pkgdir$site_packages"
cp -R dist/python/* "$pkgdir$site_packages"
# install documentation
mkdir -p "$pkgdir/usr/share/doc/mitsuba2"
cp -R "$srcdir/build/html" "$pkgdir/usr/share/doc/mitsuba2"
# folders which are not used/should not be shipped
rm -rf "$pkgdir/include" "$pkgdir/lib"
}
|