diff --git a/media-libs/openimageio/openimageio2.2-2.2.16.0.recipe b/media-libs/openimageio/openimageio2.2-2.2.16.0.recipe new file mode 100644 index 000000000..884548c29 --- /dev/null +++ b/media-libs/openimageio/openimageio2.2-2.2.16.0.recipe @@ -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-present Contributors to the OpenImageIO project." +LICENSE="BSD (3-clause)" +REVISION="1" +SOURCE_URI="$HOMEPAGE/oiio/archive/Release-$portVersion.tar.gz" +CHECKSUM_SHA256="a120e4a5c56b867250a45cf63d48af80e56af7f97f65354c8b91b9bbb15975c5" +SOURCE_FILENAME="openimageio-$portVersion.tar.gz" +SOURCE_DIR="OpenImageIO-Release-$portVersion" +PATCHES="openimageio-$portVersion.patchset" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +libVersion="2.2.16" +libVersionCompat="$libVersion compat >= ${libVersion%.*}" + +PROVIDES=" + openimageio2.2$secondaryArchSuffix = $portVersion + lib:libOpenImageIO$secondaryArchSuffix = $libVersionCompat + lib:libOpenImageIO_Util$secondaryArchSuffix = $libVersionCompat + " +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:libfmt$secondaryArchSuffix + lib:libgif$secondaryArchSuffix + lib:libglew$secondaryArchSuffix + lib:libheif$secondaryArchSuffix + lib:libIex_3_2$secondaryArchSuffix + lib:libIlmThread_3_2$secondaryArchSuffix + lib:libImath_3_1$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix + lib:libOpenColorIO$secondaryArchSuffix + lib:libOpenEXR_3_2$secondaryArchSuffix + lib:libOpenEXRUtil_3_2$secondaryArchSuffix + lib:libpng16$secondaryArchSuffix + lib:libpugixml$secondaryArchSuffix + lib:libraw$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libtiff$secondaryArchSuffix + lib:libwebp$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libboost_system$secondaryArchSuffix >= 1.83.0 + devel:libbz2$secondaryArchSuffix + devel:libcrypto$secondaryArchSuffix + devel:libfreetype$secondaryArchSuffix + devel:libfmt$secondaryArchSuffix + devel:libgif$secondaryArchSuffix + devel:libglew$secondaryArchSuffix + devel:libheif$secondaryArchSuffix + devel:libIex_3_2$secondaryArchSuffix + devel:libIlmThread_3_2$secondaryArchSuffix + devel:libImath_3_1$secondaryArchSuffix + devel:libjpeg$secondaryArchSuffix + devel:libOpenColorIO$secondaryArchSuffix + devel:libOpenEXR_3_2$secondaryArchSuffix + devel:libOpenEXRUtil_3_2$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 openimageio2.2$secondaryArchSuffix \ + $libDir/libOpenImageIO.so.$libVersion \ + $libDir/libOpenImageIO_Util.so.$libVersion + +BUILD() +{ + cmake -B build -S . \ + $cmakeDirArgs \ + -DUSE_PYTHON=OFF \ + -DUSE_EXTERNAL_PUGIXML=ON \ + -DOIIO_BUILD_TESTS=OFF \ + -DBUILD_TESTING=OFF \ + -DOIIO_BUILD_TESTS=OFF \ + -DCMAKE_BUILD_TYPE=Release -Wno-dev + make -C build $jobArgs +} + +INSTALL() +{ + make -C build install + + prepareInstalledDevelLibs libOpenImageIO libOpenImageIO_Util + fixPkgconfig + + # we only need the libraries + rm -rf $developDir \ + $binDir \ + $dataDir/cmake \ + $documentationDir \ + $libDir/cmake +} + +TEST() +{ + # tests fail (also previous version) + # enable TESTS in BUILD to check this + make -C build test +} diff --git a/media-libs/openimageio/patches/openimageio-2.2.16.0.patchset b/media-libs/openimageio/patches/openimageio-2.2.16.0.patchset new file mode 100644 index 000000000..66ce27eb3 --- /dev/null +++ b/media-libs/openimageio/patches/openimageio-2.2.16.0.patchset @@ -0,0 +1,134 @@ +From 59c27b5980e4a98c5861add9889b1f8f7aaf94d2 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Sun, 7 Jun 2015 22:05:26 +0000 +Subject: Haiku patch + + +diff --git a/src/include/OpenImageIO/detail/farmhash.h b/src/include/OpenImageIO/detail/farmhash.h +index a1ea8bd..9015ce7 100644 +--- a/src/include/OpenImageIO/detail/farmhash.h ++++ b/src/include/OpenImageIO/detail/farmhash.h +@@ -175,6 +175,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/libOpenImageIO/CMakeLists.txt b/src/libOpenImageIO/CMakeLists.txt +index 7b89dc0..4abe293 100644 +--- a/src/libOpenImageIO/CMakeLists.txt ++++ b/src/libOpenImageIO/CMakeLists.txt +@@ -176,7 +176,9 @@ if (MINGW) + target_link_libraries (OpenImageIO PRIVATE ws2_32) + endif() + +- ++if (__HAIKU__) ++ target_link_libraries (OpenImageIO network) ++endif() + + if (MSVC) + # In some MSVC setups, the IBA functions with huge template expansions +diff --git a/src/libutil/sysutil.cpp b/src/libutil/sysutil.cpp +index 61edc0b..4627990 100644 +--- a/src/libutil/sysutil.cpp ++++ b/src/libutil/sysutil.cpp +@@ -58,6 +58,12 @@ + # include + #endif + ++#if defined (__HAIKU__) ++# include ++# include ++# include ++#endif ++ + #include + #include + #include +@@ -255,7 +261,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 90fd11b..a28ee3e 100644 +--- a/src/make/detectplatform.mk ++++ b/src/make/detectplatform.mk +@@ -51,6 +51,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.45.1 + + +From a20168f0cf2ccefb1550f2e53f106960fa3acb35 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +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 01c52a4..a651689 100644 +--- a/src/tiff.imageio/tiffinput.cpp ++++ b/src/tiff.imageio/tiffinput.cpp +@@ -8,6 +8,7 @@ + #include + #include + ++ + #define AVOID_WIN32_FILEIO + #include + #include +@@ -24,6 +25,9 @@ + + #include "imageio_pvt.h" + ++#if defined(__HAIKU__) && defined(__INTEL__) ++#define uint32_t uint32 ++#endif + + OIIO_PLUGIN_NAMESPACE_BEGIN + +-- +2.45.1 +