aboutsummaryrefslogtreecommitdiffstats
path: root/testing/openimageio/APKBUILD
blob: 70ab7f8c96d51a880c4a8080b789da0a4a81e7bd (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
# Contributor: Mark Riedesel <mark@klowner.com>
# Maintainer: Mark Riedesel <mark@klowner.com>
pkgname=openimageio
pkgver=2.2.11.1
pkgrel=2
pkgdesc="Image I/O library supporting a multitude of image formats"
options="!check" # 100 out of 120 tests fail
url="https://sites.google.com/site/openimageio/"
arch="all !armv7 !armhf !mips !mips64 !s390x"
# armv7, armhf: unsupported Neon A64 instructions
# s390x, mips, mips64 has missing dependency ptex-dev
license="BSD-3-Clause"
# NOTE: OpenColorIO and OpenImageIO are cross dependent. If an ABI incompatible
# update is done in one, the other also needs to be rebuilt.
makedepends="cmake boost-dev tiff-dev openexr-dev bzip2-dev freetype-dev hdf5-dev
	opencolorio-dev libtbb-dev libtbb ffmpeg-dev giflib-dev libheif-dev
	libraw-dev openjpeg-dev ptex-dev ptex mesa-dev libwebp-dev
	qt5-qtbase-dev fmt-dev python3-dev py3-pybind11-dev"
subpackages="py3-$pkgname:_python $pkgname-dev $pkgname-doc $pkgname-tools"
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenImageIO/oiio/archive/Release-$pkgver.tar.gz"
builddir="$srcdir/oiio-Release-$pkgver"

build() {
	local _py_version=$(python3 --version | cut -c 8-10)
	local _iv="ON"

	case "$CARCH" in aarch64 | armv7 | armhf)
		_iv="OFF";;
	esac

	# fails to build with fortify source enabled
	export CXXFLAGS="$CXXFLAGS -U_FORTIFY_SOURCE"

	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_SKIP_RPATH=ON \
		-DPYTHON_VERSION=$_py_version \
		-DOIIO_BUILD_TESTS=OFF \
		-DSTOP_ON_WARNING=OFF \
		-DENABLE_iv=$_iv \
		-DINSTALL_FONTS=OFF
	cmake --build build
}

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

	mkdir -p "$pkgdir"/usr/lib/cmake
	mv "$pkgdir"/usr/share/cmake/* "$pkgdir"/usr/lib/cmake
}

tools() {
	pkgdesc="Tools for manipulating a multitude of image formats"

	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

_python() {
	local pyver="${subpkgname:2:1}"
	pkgdesc="Python $pyver bindings for OpenImageIO image I/O library"
	depends="python$pyver"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python$pyver* "$subpkgdir"/usr/lib/
}

sha512sums="73809587dd405e64e593d6223ef37d4b94c4f1e1d9682fd1bf09e8e4ee8bc9928ed500b7dcc03036e138e45e65ea1f43c11c53d1cb6436a34eb8d15b2415ada5  openimageio-2.2.11.1.tar.gz"