openimageio: fix armv[56]* and mips*

These targets need to link against libatomic which isn't auto detected.
This commit is contained in:
Jürgen Buchmüller 2018-03-27 18:12:38 +02:00
parent 10ba29df5f
commit 49a2f91c1d

View file

@ -1,14 +1,11 @@
# Template file for 'openimageio'
pkgname=openimageio
version=1.7.17
revision=2
revision=3
wrksrc=oiio-Release-${version}
build_style=cmake
configure_args="-DUSE_OPENGL=0 -DUSE_QT=0 -DUSE_PYTHON=0 -DOIIO_BUILD_TESTS=0
-DSTOP_ON_WARNING=0 -DCMAKE_SYSTEM_PROCESSOR=${XBPS_TARGET_MACHINE}"
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*) configure_args+=" -DUSE_SIMD=sse2" ;;
esac
hostmakedepends="pkg-config"
makedepends="boost-devel giflib-devel libraw-devel libopenjpeg-devel libwebp-devel
libjpeg-turbo-devel tiff-devel libpng-devel libopenexr-devel freetype-devel
@ -21,11 +18,27 @@ distfiles="https://github.com/OpenImageIO/oiio/archive/Release-${version}.tar.gz
checksum=669c59d06399dd882c3e2469bb3a4b33d537db150f6fe056495c3429b5c3838f
CXXFLAGS="-faligned-new"
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*) configure_args+=" -DUSE_SIMD=sse2" ;;
armv[56]*|mips*) makedepends+=" libatomic-devel" ;;
esac
pre_build() {
local f
# Replace -isystem with -I to avoid "#include_next <stdlib.h>" file not found
sed -i CMakeLists.txt -e "s;-isystem;-I;g"
find ${wrksrc} -type f -exec sed -i "{}" -e "s;<sys/poll\.h>;<poll.h>;g" \;
case "$XBPS_TARGET_MACHINE" in
armv[56]*|mips*)
# Add libatomic to the targets
sed -i src/libOpenImageIO/CMakeLists.txt \
-e "s;^\(target_link_libraries (OpenImageIO ${ZLIB_LIBRARIES}\));\1 atomic);"
for f in idiff igrep iconvert iinfo maketx testtex oiiotool; do
sed -i src/${f}/CMakeLists.txt \
-e "s;^\(target_link_libraries .*\));\1 atomic);"
done
;;
esac
}
post_install() {