update to openimageio-2.2.20.0, from Dimitri Karamazov (maintainer)

This commit is contained in:
sthen 2022-03-02 19:55:18 +00:00
parent 5164b3d923
commit 5d3ea9bf8e
10 changed files with 13 additions and 475 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.58 2021/11/02 00:01:16 sthen Exp $
# $OpenBSD: Makefile,v 1.59 2022/03/02 19:55:18 sthen Exp $
# XXX python module is linked with wrong libraries if an old version is
# installed during build
@ -11,12 +11,11 @@ COMMENT = library for reading and writing images
GH_ACCOUNT = OpenImageIO
GH_PROJECT = oiio
GH_TAGNAME = Release-$V
V = 2.2.18.0
V = 2.2.20.0
DISTNAME = openimageio-${V}
REVISION = 0
SHARED_LIBS += OpenImageIO 11.0 # 2.2.18
SHARED_LIBS += OpenImageIO_Util 7.0 # 2.2.18
SHARED_LIBS += OpenImageIO 11.1 # 2.2.20
SHARED_LIBS += OpenImageIO_Util 7.0 # 2.2.20
CATEGORIES = graphics devel
@ -28,12 +27,12 @@ MAINTAINER = Dimitri Karamazov <deserter666@danwin1210.me>
PERMIT_PACKAGE = Yes
WANTLIB += ${COMPILER_LIBCXX}
WANTLIB += GL GLU Iex-3_1 IlmThread-3_1 OpenEXR-3_1
WANTLIB += Imath-3_1 OpenColorIO Qt5Core Qt5Gui Qt5OpenGL Qt5Widgets
WANTLIB += avcodec avformat avutil boost_atomic-mt boost_chrono-mt
WANTLIB += boost_date_time-mt boost_filesystem-mt boost_system-mt
WANTLIB += boost_thread-mt bz2 c freetype gif heif iconv jpeg m
WANTLIB += openjp2 png pugixml raw_r swscale tiff webp webpdemux z
WANTLIB += GL GLU Iex-3_1 IlmThread-3_1 Imath-3_1 OpenColorIO
WANTLIB += OpenEXR-3_1 Qt5Core Qt5Gui Qt5OpenGL Qt5Widgets avcodec
WANTLIB += avformat avutil boost_atomic-mt boost_chrono-mt boost_date_time-mt
WANTLIB += boost_filesystem-mt boost_system-mt boost_thread-mt
WANTLIB += bz2 c freetype gif heif jpeg m openjp2 png pugixml
WANTLIB += raw_r swscale tiff webp webpdemux z
MODULES = devel/cmake \
lang/python \
@ -49,6 +48,7 @@ BUILD_DEPENDS = devel/fmt \
LIB_DEPENDS = devel/boost \
graphics/ffmpeg \
graphics/giflib \
graphics/jpeg \
graphics/libraw \
graphics/libwebp \
graphics/opencolorio \
@ -76,7 +76,4 @@ CONFIGURE_ENV += LDFLAGS="${LDFLAGS} -latomic"
WANTLIB += atomic
.endif
post-install:
find ${PREFIX} -name '*.orig' -delete
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (openimageio-2.2.18.0.tar.gz) = uN0Yn7yX8bFyUo4yTaqQT3ShZrrWLDLnFmymyGZzSik=
SIZE (openimageio-2.2.18.0.tar.gz) = 29246567
SHA256 (openimageio-2.2.20.0.tar.gz) = hZ85PkUz2rOwAdiBxB/U4KPqEU4VnwDXsqol+pjpf5k=
SIZE (openimageio-2.2.20.0.tar.gz) = 29252912

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-src_include_OpenImageIO_strutil_h,v 1.3 2021/01/05 20:53:18 jca Exp $
Add missing header for ports-gcc
Index: src/include/OpenImageIO/strutil.h
--- src/include/OpenImageIO/strutil.h.orig Tue Dec 1 12:39:14 2020
+++ src/include/OpenImageIO/strutil.h Thu Dec 3 16:42:07 2020
@@ -14,6 +14,7 @@
#pragma once
+#include <cstdarg>
#include <cstdio>
#include <map>
#include <sstream>

View File

@ -1,133 +0,0 @@
$OpenBSD: patch-src_include_tbb_machine_gcc_generic_h,v 1.2 2020/11/29 20:05:50 sthen Exp $
Index: src/include/tbb/machine/gcc_generic.h
--- src/include/tbb/machine/gcc_generic.h.orig
+++ src/include/tbb/machine/gcc_generic.h
@@ -0,0 +1,127 @@
+/*
+ Copyright 2005-2012 Intel Corporation. All Rights Reserved.
+
+ This file is part of Threading Building Blocks.
+
+ Threading Building Blocks is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ Threading Building Blocks is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Threading Building Blocks; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ As a special exception, you may use this file as part of a free software
+ library without restriction. Specifically, if other files instantiate
+ templates or use macros or inline functions from this file, or you compile
+ this file and link it with other files to produce an executable, this
+ file does not by itself cause the resulting executable to be covered by
+ the GNU General Public License. This exception does not however
+ invalidate any other reasons why the executable file might be covered by
+ the GNU General Public License.
+*/
+
+#if !defined(__TBB_machine_H) || defined(__TBB_machine_gcc_generic_H)
+#error Do not #include this internal file directly; use public TBB headers instead.
+#endif
+
+#define __TBB_machine_gcc_generic_H
+
+#include <stdint.h>
+#include <unistd.h>
+
+#include <sched.h>
+
+#define __TBB_WORDSIZE __SIZEOF_POINTER__
+
+// For some reason straight mapping does not work on mingw
+#if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__
+ #define __TBB_BIG_ENDIAN 0
+#elif __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__
+ #define __TBB_BIG_ENDIAN 1
+#else
+#error Unsupported endianness
+#endif
+
+/** As this generic implementation has absolutely no information about underlying
+ hardware, its performance most likely will be sub-optimal because of full memory
+ fence usages where a more lightweight synchronization means (or none at all)
+ could suffice. Thus if you use this header to enable TBB on a new platform,
+ consider forking it and relaxing below helpers as appropriate. **/
+#define __TBB_acquire_consistency_helper() __sync_synchronize()
+#define __TBB_release_consistency_helper() __sync_synchronize()
+#define __TBB_full_memory_fence() __sync_synchronize()
+#define __TBB_control_consistency_helper() __sync_synchronize()
+
+#define __TBB_MACHINE_DEFINE_ATOMICS(S,T) \
+inline T __TBB_machine_cmpswp##S( volatile void *ptr, T value, T comparand ) { \
+ return __sync_val_compare_and_swap(reinterpret_cast<volatile T *>(ptr),comparand,value); \
+} \
+ \
+inline T __TBB_machine_fetchadd##S( volatile void *ptr, T value ) { \
+ return __sync_fetch_and_add(reinterpret_cast<volatile T *>(ptr),value); \
+} \
+
+__TBB_MACHINE_DEFINE_ATOMICS(1,int8_t)
+__TBB_MACHINE_DEFINE_ATOMICS(2,int16_t)
+__TBB_MACHINE_DEFINE_ATOMICS(4,int32_t)
+__TBB_MACHINE_DEFINE_ATOMICS(8,int64_t)
+
+#undef __TBB_MACHINE_DEFINE_ATOMICS
+
+namespace tbb{ namespace internal { namespace gcc_builtins {
+ int clz(unsigned int x){ return __builtin_clz(x);};
+ int clz(unsigned long int x){ return __builtin_clzl(x);};
+}}}
+//gcc __builtin_clz builtin count _number_ of leading zeroes
+static inline intptr_t __TBB_machine_lg( uintptr_t x ) {
+ return sizeof(x)*8 - tbb::internal::gcc_builtins::clz(x) -1 ;
+}
+
+static inline void __TBB_machine_or( volatile void *ptr, uintptr_t addend ) {
+ __sync_fetch_and_or(reinterpret_cast<volatile uintptr_t *>(ptr),addend);
+}
+
+static inline void __TBB_machine_and( volatile void *ptr, uintptr_t addend ) {
+ __sync_fetch_and_and(reinterpret_cast<volatile uintptr_t *>(ptr),addend);
+}
+
+
+typedef unsigned char __TBB_Flag;
+
+typedef __TBB_atomic __TBB_Flag __TBB_atomic_flag;
+
+inline bool __TBB_machine_try_lock_byte( __TBB_atomic_flag &flag ) {
+ return __sync_lock_test_and_set(&flag,1)==0;
+}
+
+inline void __TBB_machine_unlock_byte( __TBB_atomic_flag &flag , __TBB_Flag) {
+ __sync_lock_release(&flag);
+}
+
+// Machine specific atomic operations
+#define __TBB_AtomicOR(P,V) __TBB_machine_or(P,V)
+#define __TBB_AtomicAND(P,V) __TBB_machine_and(P,V)
+
+#define __TBB_TryLockByte __TBB_machine_try_lock_byte
+#define __TBB_UnlockByte __TBB_machine_unlock_byte
+
+// Definition of other functions
+#define __TBB_Log2(V) __TBB_machine_lg(V)
+
+#define __TBB_USE_GENERIC_FETCH_STORE 1
+#define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1
+#define __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1
+
+#if __TBB_WORDSIZE==4
+ #define __TBB_USE_GENERIC_DWORD_LOAD_STORE 1
+#endif
+
+#define __TBB_Yield() sched_yield()
+#define __TBB_CompareAndSwap4(P,V,C) __TBB_machine_cmpswp4(P,V,C)
+#define __TBB_CompareAndSwap8(P,V,C) __TBB_machine_cmpswp8(P,V,C)

View File

@ -1,219 +0,0 @@
$OpenBSD: patch-src_include_tbb_machine_sunos_sparc_h,v 1.2 2020/11/29 20:05:50 sthen Exp $
Index: src/include/tbb/machine/sunos_sparc.h
--- src/include/tbb/machine/sunos_sparc.h.orig
+++ src/include/tbb/machine/sunos_sparc.h
@@ -0,0 +1,213 @@
+/*
+ Copyright 2005-2012 Intel Corporation. All Rights Reserved.
+
+ This file is part of Threading Building Blocks.
+
+ Threading Building Blocks is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ Threading Building Blocks is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Threading Building Blocks; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ As a special exception, you may use this file as part of a free software
+ library without restriction. Specifically, if other files instantiate
+ templates or use macros or inline functions from this file, or you compile
+ this file and link it with other files to produce an executable, this
+ file does not by itself cause the resulting executable to be covered by
+ the GNU General Public License. This exception does not however
+ invalidate any other reasons why the executable file might be covered by
+ the GNU General Public License.
+*/
+
+
+#if !defined(__TBB_machine_H) || defined(__TBB_machine_sunos_sparc_H)
+#error Do not #include this internal file directly; use public TBB headers instead.
+#endif
+
+#define __TBB_machine_sunos_sparc_H
+
+#include <stdint.h>
+#include <unistd.h>
+
+#include <sched.h>
+
+#define __TBB_WORDSIZE 8
+#define __TBB_BIG_ENDIAN 1
+
+/** To those working on SPARC hardware. Consider relaxing acquire and release
+ consistency helpers to no-op (as this port covers TSO mode only). **/
+#define __TBB_compiler_fence() __asm__ __volatile__ ("": : :"memory")
+#define __TBB_control_consistency_helper() __TBB_compiler_fence()
+#define __TBB_acquire_consistency_helper() __TBB_compiler_fence()
+#define __TBB_release_consistency_helper() __TBB_compiler_fence()
+#define __TBB_full_memory_fence() __asm__ __volatile__("membar #LoadLoad|#LoadStore|#StoreStore|#StoreLoad": : : "memory")
+
+//--------------------------------------------------
+// Compare and swap
+//--------------------------------------------------
+
+/**
+ * Atomic CAS for 32 bit values, if *ptr==comparand, then *ptr=value, returns *ptr
+ * @param ptr pointer to value in memory to be swapped with value if *ptr==comparand
+ * @param value value to assign *ptr to if *ptr==comparand
+ * @param comparand value to compare with *ptr
+ ( @return value originally in memory at ptr, regardless of success
+*/
+static inline int32_t __TBB_machine_cmpswp4(volatile void *ptr, int32_t value, int32_t comparand ){
+ int32_t result;
+ __asm__ __volatile__(
+ "cas\t[%5],%4,%1"
+ : "=m"(*(int32_t *)ptr), "=r"(result)
+ : "m"(*(int32_t *)ptr), "1"(value), "r"(comparand), "r"(ptr)
+ : "memory");
+ return result;
+}
+
+/**
+ * Atomic CAS for 64 bit values, if *ptr==comparand, then *ptr=value, returns *ptr
+ * @param ptr pointer to value in memory to be swapped with value if *ptr==comparand
+ * @param value value to assign *ptr to if *ptr==comparand
+ * @param comparand value to compare with *ptr
+ ( @return value originally in memory at ptr, regardless of success
+ */
+static inline int64_t __TBB_machine_cmpswp8(volatile void *ptr, int64_t value, int64_t comparand ){
+ int64_t result;
+ __asm__ __volatile__(
+ "casx\t[%5],%4,%1"
+ : "=m"(*(int64_t *)ptr), "=r"(result)
+ : "m"(*(int64_t *)ptr), "1"(value), "r"(comparand), "r"(ptr)
+ : "memory");
+ return result;
+}
+
+//---------------------------------------------------
+// Fetch and add
+//---------------------------------------------------
+
+/**
+ * Atomic fetch and add for 32 bit values, in this case implemented by continuously checking success of atomicity
+ * @param ptr pointer to value to add addend to
+ * @param addened value to add to *ptr
+ * @return value at ptr before addened was added
+ */
+static inline int32_t __TBB_machine_fetchadd4(volatile void *ptr, int32_t addend){
+ int32_t result;
+ __asm__ __volatile__ (
+ "0:\t add\t %3, %4, %0\n" // do addition
+ "\t cas\t [%2], %3, %0\n" // cas to store result in memory
+ "\t cmp\t %3, %0\n" // check if value from memory is original
+ "\t bne,a,pn\t %%icc, 0b\n" // if not try again
+ "\t mov %0, %3\n" // use branch delay slot to move new value in memory to be added
+ : "=&r"(result), "=m"(*(int32_t *)ptr)
+ : "r"(ptr), "r"(*(int32_t *)ptr), "r"(addend), "m"(*(int32_t *)ptr)
+ : "ccr", "memory");
+ return result;
+}
+
+/**
+ * Atomic fetch and add for 64 bit values, in this case implemented by continuously checking success of atomicity
+ * @param ptr pointer to value to add addend to
+ * @param addened value to add to *ptr
+ * @return value at ptr before addened was added
+ */
+static inline int64_t __TBB_machine_fetchadd8(volatile void *ptr, int64_t addend){
+ int64_t result;
+ __asm__ __volatile__ (
+ "0:\t add\t %3, %4, %0\n" // do addition
+ "\t casx\t [%2], %3, %0\n" // cas to store result in memory
+ "\t cmp\t %3, %0\n" // check if value from memory is original
+ "\t bne,a,pn\t %%xcc, 0b\n" // if not try again
+ "\t mov %0, %3\n" // use branch delay slot to move new value in memory to be added
+ : "=&r"(result), "=m"(*(int64_t *)ptr)
+ : "r"(ptr), "r"(*(int64_t *)ptr), "r"(addend), "m"(*(int64_t *)ptr)
+ : "ccr", "memory");
+ return result;
+}
+
+//--------------------------------------------------------
+// Logarithm (base two, integer)
+//--------------------------------------------------------
+
+static inline int64_t __TBB_machine_lg( uint64_t x ) {
+ uint64_t count;
+ // one hot encode
+ x |= (x >> 1);
+ x |= (x >> 2);
+ x |= (x >> 4);
+ x |= (x >> 8);
+ x |= (x >> 16);
+ x |= (x >> 32);
+ // count 1's
+ __asm__ ("popc %1, %0" : "=r"(count) : "r"(x) );
+ return count-1;
+}
+
+//--------------------------------------------------------
+
+static inline void __TBB_machine_or( volatile void *ptr, uint64_t addend ) {
+ __asm__ __volatile__ (
+ "0:\t or\t %2, %3, %%g1\n" // do addition
+ "\t casx\t [%1], %2, %%g1\n" // cas to store result in memory
+ "\t cmp\t %2, %%g1\n" // check if value from memory is original
+ "\t bne,a,pn\t %%xcc, 0b\n" // if not try again
+ "\t mov %%g1, %2\n" // use branch delay slot to move new value in memory to be added
+ : "=m"(*(int64_t *)ptr)
+ : "r"(ptr), "r"(*(int64_t *)ptr), "r"(addend), "m"(*(int64_t *)ptr)
+ : "ccr", "g1", "memory");
+}
+
+static inline void __TBB_machine_and( volatile void *ptr, uint64_t addend ) {
+ __asm__ __volatile__ (
+ "0:\t and\t %2, %3, %%g1\n" // do addition
+ "\t casx\t [%1], %2, %%g1\n" // cas to store result in memory
+ "\t cmp\t %2, %%g1\n" // check if value from memory is original
+ "\t bne,a,pn\t %%xcc, 0b\n" // if not try again
+ "\t mov %%g1, %2\n" // use branch delay slot to move new value in memory to be added
+ : "=m"(*(int64_t *)ptr)
+ : "r"(ptr), "r"(*(int64_t *)ptr), "r"(addend), "m"(*(int64_t *)ptr)
+ : "ccr", "g1", "memory");
+}
+
+
+static inline void __TBB_machine_pause( int32_t delay ) {
+ // do nothing, inlined, doesnt matter
+}
+
+// put 0xff in memory location, return memory value,
+// generic trylockbyte puts 0x01, however this is fine
+// because all that matters is that 0 is unlocked
+static inline bool __TBB_machine_trylockbyte(unsigned char &flag){
+ unsigned char result;
+ __asm__ __volatile__ (
+ "ldstub\t [%2], %0\n"
+ : "=r"(result), "=m"(flag)
+ : "r"(&flag), "m"(flag)
+ : "memory");
+ return result == 0;
+}
+
+#define __TBB_USE_GENERIC_PART_WORD_CAS 1
+#define __TBB_USE_GENERIC_PART_WORD_FETCH_ADD 1
+#define __TBB_USE_GENERIC_FETCH_STORE 1
+#define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1
+#define __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1
+
+#define __TBB_AtomicOR(P,V) __TBB_machine_or(P,V)
+#define __TBB_AtomicAND(P,V) __TBB_machine_and(P,V)
+
+// Definition of other functions
+#define __TBB_Pause(V) __TBB_machine_pause(V)
+#define __TBB_Log2(V) __TBB_machine_lg(V)
+
+#define __TBB_TryLockByte(P) __TBB_machine_trylockbyte(P)
+
+#define __TBB_Yield() sched_yield()
+#define __TBB_CompareAndSwap4(P,V,C) __TBB_machine_cmpswp4(P,V,C)
+#define __TBB_CompareAndSwap8(P,V,C) __TBB_machine_cmpswp8(P,V,C)

View File

@ -1,14 +0,0 @@
$OpenBSD: patch-src_libtexture_texture_pvt_h,v 1.4 2021/01/05 20:53:18 jca Exp $
Index: src/libtexture/texture_pvt.h
--- src/libtexture/texture_pvt.h.orig Tue Dec 1 12:39:14 2020
+++ src/libtexture/texture_pvt.h Thu Dec 3 16:36:05 2020
@@ -6,6 +6,8 @@
/// \file
/// Non-public classes used internally by TextureSystemImpl.
+#undef _P
+
#ifndef OPENIMAGEIO_TEXTURE_PVT_H
#define OPENIMAGEIO_TEXTURE_PVT_H

View File

@ -1,25 +0,0 @@
$OpenBSD: patch-src_libutil_sysutil_cpp,v 1.9 2021/10/23 08:12:43 sthen Exp $
Index: src/libutil/sysutil.cpp
--- src/libutil/sysutil.cpp.orig
+++ src/libutil/sysutil.cpp
@@ -31,6 +31,10 @@
# include <unistd.h>
#endif
+#if defined (__OpenBSD__)
+# include <unistd.h>
+#endif
+
#ifdef __APPLE__
# include <mach-o/dyld.h>
# include <mach/mach_init.h>
@@ -130,7 +134,7 @@ Sysutil::memory_used(bool resident)
else
return 0;
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
// FIXME -- does somebody know a good method for figuring this out for
// FreeBSD?
return 0; // Punt

View File

@ -1,26 +0,0 @@
$OpenBSD: patch-src_libutil_ustring_cpp,v 1.2 2021/05/24 20:04:27 sthen Exp $
error: expected value in expression
# if _LIBCPP_BIG_ENDIAN
Index: src/libutil/ustring.cpp
--- src/libutil/ustring.cpp.orig
+++ src/libutil/ustring.cpp
@@ -308,7 +308,7 @@ struct libcpp_string__long {
std::string::size_type __size_;
std::string::size_type __cap_;
};
-# if _LIBCPP_BIG_ENDIAN
+# ifdef _LIBCPP_BIG_ENDIAN
enum { libcpp_string__long_mask = 0x1ul };
# else // _LIBCPP_BIG_ENDIAN
enum { libcpp_string__long_mask = ~(std::string::size_type(~0) >> 1) };
@@ -319,7 +319,7 @@ struct libcpp_string__long {
std::string::size_type __size_;
std::string::pointer __data_;
};
-# if _LIBCPP_BIG_ENDIAN
+# ifdef _LIBCPP_BIG_ENDIAN
enum { libcpp_string__long_mask = ~(std::string::size_type(~0) >> 1) };
# else // _LIBCPP_BIG_ENDIAN
enum { libcpp_string__long_mask = 0x1ul };

View File

@ -1,26 +0,0 @@
$OpenBSD: patch-src_make_detectplatform_mk,v 1.3 2021/01/05 20:53:18 jca Exp $
--- src/make/detectplatform.mk.orig Tue Dec 1 12:39:14 2020
+++ src/make/detectplatform.mk Sun Jan 3 08:55:34 2021
@@ -26,7 +26,9 @@ ifneq (${hw},x86)
ifneq (${hw},i386)
ifneq (${hw},i686)
ifneq (${hw},aarch64)
- $(error "ERROR: Unknown hardware architecture")
+ ifneq (${hw},amd64)
+ $(error "ERROR: Unknown hardware architecture")
+ endif
endif
endif
endif
@@ -62,6 +64,10 @@ ifeq (${platform},unknown)
# Mac OS X
ifeq (${uname},darwin)
platform := macosx
+ endif
+
+ ifeq (${uname},openbsd)
+ platform := openbsd
endif
# If we haven't been able to determine the platform from uname, use

View File

@ -1,4 +1,3 @@
@comment $OpenBSD: PLIST,v 1.17 2021/10/23 08:12:43 sthen Exp $
@conflict idiff-*
@bin bin/iconvert
@bin bin/idiff