aboutsummaryrefslogblamecommitdiffstats
path: root/community/openexr/APKBUILD
blob: 77075fd307c93fc002a4380a922ab3d73fbecaef (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                              
                                                   
                                                     
               
            
        
                                                        
                              
                                    
                      










                     
                      


                               


                                                                                           
         
 
           



                     




                      
         
                        


                                             
                                         

                                               
                                  
                     

 



                                       


                                                                        



                                
           
                                               

 
















                                                                                                     



                                                                                 
                                                                                              






                                                                                          
         

                                              

 
                                                                                                                                                                   
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Mark Riedesel <mark+alpine@klowner.com>
pkgname=openexr
pkgver=2.5.5
pkgrel=3
pkgdesc="A high dynamic-range image file format library"
url="https://www.openexr.com/"
arch="all !mips !mips64" # py3-numpy
license="BSD-3-Clause"
makedepends="
	boost-dev
	boost-python3
	chrpath
	cmake
	py3-numpy-dev
	python3-dev
	zlib-dev
	"
subpackages="
	$pkgname-doc
	$pkgname-tools
	py3-$pkgname-dev:py3dev
	py3-$pkgname:py3
	$pkgname-dev
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/openexr/openexr/archive/v$pkgver.tar.gz
	"

# secfixes:
#   2.5.4-r0:
#     - CVE-2021-3477
#     - CVE-2021-3478
#     - CVE-2021-3479
#   2.5.2-r0:
#     - CVE-2020-15304
#     - CVE-2020-15305
#     - CVE-2020-15306

build() {
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		$CMAKE_CROSSOPTS .
	make -C build
}

check() {
	cd build

	_exclude_tests="OpenEXR.IlmImf"
	case "$CARCH" in
		x86) _exclude_tests="($_exclude_tests|IlmBase.Imath)" ;;
	esac

	ctest -E $_exclude_tests
}

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

py3dev() {
	pkgdesc="$pkgdesc (Python3 bindings for the Imath vector/matrix classes) (development files)"

	depends="openexr-dev=$pkgver-r$pkgrel"
	amove /usr/include/OpenEXR/Py*
	amove /usr/lib/cmake/PyIlmBase
	amove /usr/lib/pkgconfig/PyIlmBase.pc
	cd $pkgdir
	# move *.so links needed when linking the apps to -dev packages
	for i in lib/libPy*.so usr/lib/libPy*.so; do
		if [ -L "$i" ]; then
			mkdir -p "$subpkgdir"/"${i%/*}"
			mv "$i" "$subpkgdir/$i"
		fi
	done
}

py3() {
	pkgdesc="$pkgdesc (Python3 bindings for the Imath vector/matrix classes)"

	# Install missing python module
	_pythonpath=$(python3 -c "from sysconfig import get_path; print(get_path('platlib'))")
	install -Dm755 $builddir/build/python3*/imathnumpy.so -t "$subpkgdir"/$_pythonpath
	chrpath -d $subpkgdir/$_pythonpath/imathnumpy.so
	mv $pkgdir$_pythonpath/* $subpkgdir$_pythonpath
	mv $pkgdir/usr/lib/*Python* $subpkgdir/usr/lib/
	rm -rf $pkgdir/usr/lib/python*
}

tools() {
	mkdir -p "$subpkgdir"/usr/
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="e511af26a8fe2175a641fd25d2dcc6ef807e00bee2aff06a4784125f916ffd47fe376fe0621d385b604180a239bbfee063f8ceee3f7b731fde3c38558e9fdcdf  openexr-2.5.5.tar.gz"