openimageio: add recipe for version 2.0.12.

This commit is contained in:
Jerome Duval
2019-11-06 23:28:34 +01:00
parent d30f996797
commit 58ee5066eb
2 changed files with 252 additions and 0 deletions

View File

@@ -0,0 +1,132 @@
SUMMARY="A library to read and write images"
DESCRIPTION="OpenImageIO is a library for reading and writing images, and a \
bunch of related classes, utilities, and applications. There is a particular \
emphasis on formats and functionality used in professional, large-scale \
animation and visual effects work for film.
OpenImageIO is used extensively in animation and VFX studios all over the \
world, and is also incorporated into several commercial products."
HOMEPAGE="https://github.com/OpenImageIO/"
COPYRIGHT="2008-2019 Larry Gritz et al."
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="$HOMEPAGE/oiio/archive/Release-$portVersion.tar.gz"
CHECKSUM_SHA256="930a142c9cabbbc3b249577083c97e9f0407cc8cbf933144f3a3ed0f3ec9cfe0"
SOURCE_FILENAME="openimageio-$portVersion.tar.gz"
SOURCE_DIR="oiio-Release-$portVersion"
PATCHES="openimageio-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
openimageio$secondaryArchSuffix = $portVersion
cmd:iconvert$secondaryArchSuffix
cmd:idiff$secondaryArchSuffix
cmd:igrep$secondaryArchSuffix
cmd:iinfo$secondaryArchSuffix
cmd:maketx$secondaryArchSuffix
cmd:oiiotool$secondaryArchSuffix
lib:libopenimageio$secondaryArchSuffix = $portVersion compat >= 2.0
lib:libopenimageio_util$secondaryArchSuffix = $portVersion compat >= 2.0
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libboost_atomic$secondaryArchSuffix
lib:libboost_chrono$secondaryArchSuffix
lib:libboost_date_time$secondaryArchSuffix
lib:libboost_filesystem$secondaryArchSuffix
lib:libboost_system$secondaryArchSuffix
lib:libboost_thread$secondaryArchSuffix
lib:libbz2$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libgif$secondaryArchSuffix
lib:libglew$secondaryArchSuffix
lib:libhalf_2_4$secondaryArchSuffix
lib:libiex_2_4$secondaryArchSuffix
lib:libimath_2_4$secondaryArchSuffix
lib:libilmthread_2_4$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:libopencolorio$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libpugixml$secondaryArchSuffix
lib:libraw$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libtiff$secondaryArchSuffix
lib:libwebp$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
openimageio${secondaryArchSuffix}_devel = $portVersion
devel:libopenimageio$secondaryArchSuffix = $portVersion compat >= 2.0
devel:libopenimageio_util$secondaryArchSuffix = $portVersion compat >= 2.0
"
REQUIRES_devel="
openimageio$secondaryArchSuffix == $portVersion base
devel:libboost_system$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libboost_system$secondaryArchSuffix >= 1.69
devel:libbz2$secondaryArchSuffix
devel:libcrypto$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libgif$secondaryArchSuffix
devel:libglew$secondaryArchSuffix
devel:libhalf_2_4$secondaryArchSuffix
devel:libilmimf_2_4$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:libopencolorio$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
devel:libpugixml$secondaryArchSuffix
devel:libraw$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libtiff$secondaryArchSuffix
devel:libwebp$secondaryArchSuffix
devel:libz$secondaryArchSuffix
devel:robin_map
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:python3
"
defineDebugInfoPackage openimageio$secondaryArchSuffix \
$binDir/iconvert \
$binDir/idiff \
$binDir/igrep \
$binDir/iinfo \
$binDir/maketx \
$binDir/oiiotool \
$libDir/libOpenImageIO.so.$portVersion \
$libDir/libOpenImageIO_Util.so.$portVersion
BUILD()
{
mkdir -p build
cd build
cmake .. \
-DUSE_PYTHON=OFF \
-DUSE_EXTERNAL_PUGIXML=ON \
$cmakeDirArgs
make $jobArgs
}
INSTALL()
{
cd build
make install
prepareInstalledDevelLibs libOpenImageIO libOpenImageIO_Util
fixPkgconfig
# devel package
packageEntries devel \
$developDir
}

View File

@@ -0,0 +1,120 @@
From 7b71ab34d25bda3c95fd91774ef520930c8e4fba Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sun, 7 Jun 2015 22:05:26 +0000
Subject: Haiku patch
diff --git a/src/libutil/farmhash.cpp b/src/libutil/farmhash.cpp
index 9b50f14..af7bf4b 100644
--- a/src/libutil/farmhash.cpp
+++ b/src/libutil/farmhash.cpp
@@ -167,6 +167,13 @@
#define bswap_64(x) bswap64(x)
#endif
+#elif defined(__HAIKU__)
+
+#undef bswap_32
+#undef bswap_64
+#define bswap_32 __builtin_bswap32
+#define bswap_64 __builtin_bswap64
+
#else
#undef bswap_32
diff --git a/src/libutil/sysutil.cpp b/src/libutil/sysutil.cpp
index defbd78..b17f19c 100644
--- a/src/libutil/sysutil.cpp
+++ b/src/libutil/sysutil.cpp
@@ -80,6 +80,12 @@
# include <unistd.h>
#endif
+#if defined (__HAIKU__)
+# include <sys/types.h>
+# include <sys/resource.h>
+# include <unistd.h>
+#endif
+
#include <OpenImageIO/dassert.h>
#include <OpenImageIO/strutil.h>
#include <OpenImageIO/sysutil.h>
@@ -276,7 +282,7 @@ Sysutil::this_program_path()
size_t cb = sizeof(filename);
int r = 1;
sysctl(mib, 4, filename, &cb, NULL, 0);
-#elif defined(__GNU__) || defined(__OpenBSD__) || defined(_WIN32)
+#elif defined(__GNU__) || defined(__OpenBSD__) || defined(_WIN32) || defined(__HAIKU__)
int r = 0;
#else
// No idea what platform this is
diff --git a/src/libutil/xxhash.cpp b/src/libutil/xxhash.cpp
index 46a8ce1..becaadd 100644
--- a/src/libutil/xxhash.cpp
+++ b/src/libutil/xxhash.cpp
@@ -126,8 +126,10 @@ typedef unsigned long long U64;
#if defined(__GNUC__) && !defined(XXH_USE_UNALIGNED_ACCESS)
# define _PACKED __attribute__ ((packed))
#else
+#ifndef __HAIKU__
# define _PACKED
#endif
+#endif
#if !defined(XXH_USE_UNALIGNED_ACCESS) && !defined(__GNUC__)
# ifdef __IBMC__
diff --git a/src/make/detectplatform.mk b/src/make/detectplatform.mk
index dacdc2e..4918389 100644
--- a/src/make/detectplatform.mk
+++ b/src/make/detectplatform.mk
@@ -46,6 +46,14 @@ ifeq (${platform},unknown)
endif
endif
+ # Haiku
+ ifeq (${uname},haiku)
+ platform := haiku
+ ifeq (${hw},x86_64)
+ platform := haiku64
+ endif
+ endif
+
# Windows
ifeq (${uname},cygwin)
platform := windows
--
2.23.0
From a93e85695c6796a11553a712030c7bb277dd40eb Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 6 Nov 2019 23:18:49 +0100
Subject: tiff uses uint32 instead of uint32_t
diff --git a/src/tiff.imageio/tiffinput.cpp b/src/tiff.imageio/tiffinput.cpp
index 416ebfa..205f6a4 100644
--- a/src/tiff.imageio/tiffinput.cpp
+++ b/src/tiff.imageio/tiffinput.cpp
@@ -34,6 +34,7 @@
#include <cstdio>
#include <cstdlib>
+
#include <boost/thread/tss.hpp>
#include <tiffio.h>
@@ -51,6 +52,10 @@
#include "imageio_pvt.h"
+#if defined(__HAIKU__) && defined(__INTEL__)
+#define uint32_t uint32
+#endif
+
OIIO_PLUGIN_NAMESPACE_BEGIN
--
2.23.0