aboutsummaryrefslogtreecommitdiffstats
path: root/community/opencolorio/APKBUILD
blob: 8f45d020bd7cf4237ea756c213d67197175bd0ac (plain) (blame)
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
# Contributor: Mark Riedesel <mark@klowner.com>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=opencolorio
pkgver=2.1.1
pkgrel=3
pkgdesc="A color management framework for visual effects and animation"
url="https://opencolorio.org/"
arch="all"
# tests in arches other than x86_64 fail but mostly to FP precision
case $CARCH in
	x86_64);;
	*) options="$options !check";;
esac
license="BSD-3-Clause AND GPL-2.0-or-later"
# Please do not include openimageio.
# It creates a circular dependency.
makedepends="cmake
	expat-dev
	freeglut-dev
	glew-dev
	lcms2-dev
	openexr-dev
	py3-pybind11-dev
	python3-dev
	samurai
	yaml-cpp-dev
	"
subpackages="py3-$pkgname:py3 $pkgname-dev $pkgname-tools"
source="$pkgname-$pkgver.tar.gz::https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v$pkgver.tar.gz
	0001-build-type-none.patch
	0002-fix-strtol.patch
	"
builddir="$srcdir/OpenColorIO-$pkgver"

prepare() {
	default_prepare
	find . -name CMakeLists.txt -exec sed -i -e "s/OpenGL::OpenGL/OpenGL::GL/" {} +
}

build() {
	local use_sse2

	case "$CARCH" in
		x86_64) use_sse2=TRUE ;;
		*) use_sse2=FALSE ;;
	esac

	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DOCIO_BUILD_TESTS=OFF \
		-DOCIO_BUILD_GPU_TESTS=OFF \
		-DOCIO_USE_SSE="$use_sse2"
	cmake --build build
}

check() {
	ninja -C build test
}

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

tools() {
	pkgdesc="OpenColorIO color management framework tools"

	amove usr/bin
}

py3() {
	pkgdesc="Python3 bindings for OpenColorIO color management framework"
	depends="python3"

	amove usr/lib/python*
}

sha512sums="
86585ec860d460b158f24efb82f202deced7ce96a6bfefd42f39cad9c112add68cca6935f383f5d718c07fe1c121d8ed8b0d2069321f1dafb8ce68b49bc75194  opencolorio-2.1.1.tar.gz
6943c6126b0572354517428553588f9d7c7393b08fda62a1f9f8ef6e9d3a68da5fec7f063310d44c7480a83d507f52b5d0b65d64325529f1a9f1806a205c8ffb  0001-build-type-none.patch
79bd19bc1cbf69044d6a6e8f631a97b9bc678d12d6d61780402a97b06ba4c857c161fc642be543d261dc49a4d96278e45ed05f9e9c18ac2e57e585a961d84dd8  0002-fix-strtol.patch
"