summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 516da189dfb8160fb97309002d77f690a2bc7863 (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
# Maintainer: Patrick Northon <northon_patrick3@yahoo.ca>

_pkgname=openimageio
pkgname=mingw-w64-${_pkgname}
pkgver=3.0.1.0
pkgrel=1
pkgdesc='A library for reading and writing images, including classes, utilities, and applications (mingw-w64)'
url='http://www.openimageio.org/'
license=('BSD-3-Clause')
depends=(
	'mingw-w64-openexr'
	'mingw-w64-libtiff'
	'mingw-w64-libpng'
	'mingw-w64-libjpeg-turbo'
	'mingw-w64-onetbb'
	'mingw-w64-giflib'
	'mingw-w64-libwebp'
	'mingw-w64-pugixml'
	'mingw-w64-fmt'
	'mingw-w64-freetype2'
	'mingw-w64-opencolorio'
	'mingw-w64-opencv'
	'mingw-w64-ffmpeg'
	'mingw-w64-hdf5'
	'mingw-w64-libraw'
	'mingw-w64-libheif'
	'mingw-w64-ptex'
)
makedepends=('mingw-w64-cmake' 'mingw-w64-robin-map' 'mingw-w64-boost' 'ninja')
#checkdepends=('python')
arch=('any')
options=(!strip !buildflags staticlibs)
optdepends=()
source=("$_pkgname-$pkgver.tar.gz::https://github.com/OpenImageIO/oiio/archive/v${pkgver}.tar.gz")
sha256sums=('7f84c2b9c13be74c4a187fefe3844b391374ba329aa63fbbca21fa232e43c87b')

_srcdir="OpenImageIO-${pkgver}"
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
_flags=(
	-Wno-dev -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE='-DNDEBUG -fpermissive'
	-DBUILD_DOCS=OFF
	-DUSE_EXTERNAL_PUGIXML=ON
	-DCMAKE_CXX_STANDARD=20
	-DINSTALL_DOCS=OFF
	-DUSE_PYTHON=OFF
	-DUSE_QT=OFF
	-DUSE_CCACHE=OFF
	-DUSE_SIMD='sse4.2'
	-DEMBEDPLUGINS=ON
	-DSTOP_ON_WARNING=OFF )

prepare() {
	cd "${_srcdir}"

	#sed -i 's/os.path.join(OIIO_BUILD_ROOT, "bin", app)/os.path.join(OIIO_BUILD_ROOT, "bin", app, ".exe")/' 'testsuite/runtest.py'
}

build() {
	for _arch in ${_architectures}; do
		${_arch}-cmake -G Ninja -S "${_srcdir}" -B "build-${_arch}-static" "${_flags[@]}" \
			-DBUILD_SHARED_LIBS=OFF \
			-DBUILD_TESTING=OFF -DOIIO_BUILD_TESTS=OFF \
			-DOIIO_DOWNLOAD_MISSING_TESTDATA=OFF \
			-DOIIO_BUILD_TOOLS=OFF \
			-DCMAKE_INSTALL_PREFIX="/usr/${_arch}/static" \
			-DCMAKE_FIND_NO_INSTALL_PREFIX=ON
		cmake --build "build-${_arch}-static"

		${_arch}-cmake -G Ninja -S "${_srcdir}" -B "build-${_arch}" "${_flags[@]}" \
			-DBUILD_TESTING=OFF -DOIIO_BUILD_TESTS=OFF \
			-DOIIO_DOWNLOAD_MISSING_TESTDATA=OFF \
			-DOIIO_BUILD_TOOLS=ON
		cmake --build "build-${_arch}"
	done
}

#check() {
#	for _arch in ${_architectures}; do
#		${_arch}-cmake -S "${_srcdir}" -B "build-${_arch}" "${_flags[@]}" -DBUILD_TESTING=ON -DOIIO_BUILD_TESTS=ON -DOIIO_DOWNLOAD_MISSING_TESTDATA=ON
#		cmake --build "build-${_arch}"
#		sed -i "s/wrapper_cmd = \"\"/wrapper_cmd = \"${_arch}-wine\"/" "${_srcdir}/testsuite/runtest.py"
#		cmake --build "build-${_arch}" --target test
#	done
#}

package() {
	for _arch in ${_architectures}; do
		DESTDIR="${pkgdir}" cmake --install "build-${_arch}-static"
		rm -rf "$pkgdir"/usr/${_arch}/static/share
		${_arch}-strip -g "$pkgdir"/usr/${_arch}/static/lib/*.a

		DESTDIR="${pkgdir}" cmake --install "build-${_arch}"
		${_arch}-strip "$pkgdir"/usr/${_arch}/bin/*.exe
		${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
		${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
	done
}