diff options
author | bartus | 2021-05-15 16:55:07 +0200 |
---|---|---|
committer | bartus | 2021-05-15 16:55:07 +0200 |
commit | 5797cb65b9a29f9d2691ed3e142241ba95a89055 (patch) | |
tree | 50010ec93034089c964085a610226ea2e364765c | |
parent | ec564177afa8933fcf51b1695302473e5e6393b4 (diff) | |
download | aur-5797cb65b9a29f9d2691ed3e142241ba95a89055.tar.gz |
Fix build against openexr:3
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | openexr3.patch | 361 |
3 files changed, 367 insertions, 2 deletions
@@ -42,10 +42,12 @@ pkgbase = alice-vision-git source = alice-vision-git::git+https://github.com/alicevision/AliceVision.git#branch=develop source = geogram::git+https://github.com/alicevision/geogram.git source = cmake_cxx_std_14.patch + source = openexr3.patch sha256sums = SKIP sha256sums = SKIP sha256sums = SKIP sha256sums = caf2bf06bd7c6a2387f01f312d94b649ef3e4363b18fcdf95986cd71a0d6c275 + sha256sums = e7a89d510788ff0320415d00e9871220e602e046ffc0fb65d60d465d6bed93a7 pkgname = alice-vision-git @@ -55,6 +55,7 @@ makedepends+=('ninja' 'boost' 'eigen' 'freetype2' 'gflags' 'doxygen' 'python-sph source+=("${pkgname}::git+https://github.com/alicevision/AliceVision.git${_fragment}" "geogram::git+https://github.com/alicevision/geogram.git" "cmake_cxx_std_14.patch" + "openexr3.patch" ) sha256sums+=('SKIP' 'SKIP' @@ -75,7 +76,7 @@ prepare() { # git config submodule.src/dependencies/osi_clp.url # fix doc build sed -i '/^ *install.*doc/s/doc/htmlDoc/' src/CMakeLists.txt - git apply -v "${srcdir}"/cmake_cxx_std_14.patch + git apply -v "${srcdir}"/{cmake_cxx_std_14,openexr3}.patch } @@ -126,4 +127,5 @@ package() { sha256sums=('SKIP' 'SKIP' 'SKIP' - 'caf2bf06bd7c6a2387f01f312d94b649ef3e4363b18fcdf95986cd71a0d6c275') + 'caf2bf06bd7c6a2387f01f312d94b649ef3e4363b18fcdf95986cd71a0d6c275' + 'e7a89d510788ff0320415d00e9871220e602e046ffc0fb65d60d465d6bed93a7') diff --git a/openexr3.patch b/openexr3.patch new file mode 100644 index 000000000000..3a5df4efeca2 --- /dev/null +++ b/openexr3.patch @@ -0,0 +1,361 @@ +diff --git a/src/cmake/openexr/FindOpenEXR.cmake b/src/cmake/openexr/FindOpenEXR.cmake +index 9a4958020..a2f7b4c62 100644 +--- a/src/cmake/openexr/FindOpenEXR.cmake ++++ b/src/cmake/openexr/FindOpenEXR.cmake +@@ -1,178 +1,138 @@ +-# Module to find OpenEXR. ++# - Find OpenEXR library ++# Find the native OpenEXR includes and library ++# This module defines ++# OPENEXR_INCLUDE_DIRS, where to find ImfXdr.h, etc. Set when ++# OPENEXR_INCLUDE_DIR is found. ++# OPENEXR_LIBRARIES, libraries to link against to use OpenEXR. ++# OPENEXR_ROOT_DIR, The base directory to search for OpenEXR. ++# This can also be an environment variable. ++# OPENEXR_FOUND, If false, do not try to use OpenEXR. + # +-# This module will set +-# OPENEXR_FOUND true, if found +-# OPENEXR_INCLUDE_DIR directory where headers are found +-# OPENEXR_LIBRARIES libraries for OpenEXR + IlmBase +-# ILMBASE_LIBRARIES libraries just IlmBase +-# OPENEXR_VERSION OpenEXR version (accurate for >= 2.0.0, +-# otherwise will just guess 1.6.1) ++# For individual library access these advanced settings are available ++# OPENEXR_HALF_LIBRARY, Path to Half library ++# OPENEXR_IEX_LIBRARY, Path to Half library ++# OPENEXR_ILMIMF_LIBRARY, Path to Ilmimf library ++# OPENEXR_ILMTHREAD_LIBRARY, Path to IlmThread library ++# OPENEXR_IMATH_LIBRARY, Path to Imath library + # +-# Special inputs: +-# OPENEXR_CUSTOM_INCLUDE_DIR - custom location of headers +-# OPENEXR_CUSTOM_LIB_DIR - custom location of libraries +-# OPENEXR_CUSTOM_LIB_PREFIX - special snowflake library prefix +-# OPENEXR_CUSTOM_LIB_SUFFIX - special snowflake library suffix ++# also defined, but not for general use are ++# OPENEXR_LIBRARY, where to find the OpenEXR library. ++ ++#============================================================================= ++# Copyright 2011 Blender Foundation. + # ++# Distributed under the OSI-approved BSD 3-Clause License, ++# see accompanying file BSD-3-Clause-license.txt for details. ++#============================================================================= ++ ++# If OPENEXR_ROOT_DIR was defined in the environment, use it. ++IF(NOT OPENEXR_ROOT_DIR AND NOT $ENV{OPENEXR_ROOT_DIR} STREQUAL "") ++ SET(OPENEXR_ROOT_DIR $ENV{OPENEXR_ROOT_DIR}) ++ENDIF() ++ ++# Old versions (before 2.0?) do not have any version string, just assuming this should be fine though. ++SET(_openexr_libs_ver_init "2.0") ++ ++SET(_openexr_FIND_COMPONENTS ++ Iex ++ Imath ++ OpenEXR ++ IlmThread ++) + +-# Other standard issue macros +-include (FindPackageHandleStandardArgs) +-include (SelectLibraryConfigurations) +- +-find_package (ZLIB REQUIRED) +- +-# Link with pthreads if required +-find_package (Threads) +-if (CMAKE_USE_PTHREADS_INIT) +- set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT}) +-endif () +- +-# List of likely places to find the headers -- note priority override of +-# OPENEXR_CUSTOM_INCLUDE_DIR and ${OPENEXR_HOME}/include. +-# ILMBASE is needed in case ilmbase an openexr are installed in separate +-# directories, like NixOS does +-set (GENERIC_INCLUDE_PATHS +- ${OPENEXR_CUSTOM_INCLUDE_DIR} +- ${OPENEXR_HOME}/include +- ${ILMBASE_HOME}/include +-# /usr/local/include +-# /usr/include +-# /usr/include/${CMAKE_LIBRARY_ARCHITECTURE} +-# /sw/include +-# /opt/local/include ++SET(_openexr_SEARCH_DIRS ++ ${OPENEXR_ROOT_DIR} ++ /opt/lib/openexr + ) + +-# Find the include file locations. We call find_path twice -- first using +-# only the custom paths, then if that fails, try the default paths only. +-# This seems to be the most robust way I can find to not get confused when +-# both system and custom libraries are present. +-find_path (ILMBASE_INCLUDE_PATH OpenEXR/IlmBaseConfig.h +- PATHS ${GENERIC_INCLUDE_PATHS}) +-#find_path (ILMBASE_INCLUDE_PATH OpenEXR/IlmBaseConfig.h) +-find_path (OPENEXR_INCLUDE_PATH OpenEXR/OpenEXRConfig.h +- PATHS ${GENERIC_INCLUDE_PATHS}) +-#find_path (OPENEXR_INCLUDE_PATH OpenEXR/OpenEXRConfig.h) +- +-# message(WARNING "GENERIC_INCLUDE_PATHS: ${GENERIC_INCLUDE_PATHS}") +-# message(WARNING "Test if file exist: ${OPENEXR_INCLUDE_PATH}/OpenEXR/ImfMultiPartInputFile.h") +- +- +-# Try to figure out version number +-if (EXISTS "${OPENEXR_INCLUDE_PATH}/OpenEXR/ImfMultiPartInputFile.h") +- # message(WARNING "Yes, file exist") +- +- # Must be at least 2.0 +- file(STRINGS "${OPENEXR_INCLUDE_PATH}/OpenEXR/OpenEXRConfig.h" TMP REGEX "^#define OPENEXR_VERSION_STRING .*$") +- string (REGEX MATCHALL "[0-9]+[.0-9]+" OPENEXR_VERSION ${TMP}) +- file(STRINGS "${OPENEXR_INCLUDE_PATH}/OpenEXR/OpenEXRConfig.h" TMP REGEX "^#define OPENEXR_VERSION_MAJOR .*$") +- string (REGEX MATCHALL "[0-9]+" OPENEXR_VERSION_MAJOR ${TMP}) +- file(STRINGS "${OPENEXR_INCLUDE_PATH}/OpenEXR/OpenEXRConfig.h" TMP REGEX "^#define OPENEXR_VERSION_MINOR .*$") +- string (REGEX MATCHALL "[0-9]+" OPENEXR_VERSION_MINOR ${TMP}) +-else () +- message(STATUS "File ${OPENEXR_INCLUDE_PATH}/OpenEXR/ImfMultiPartInputFile.h does not exist. Default to 1.6.1") +- # Assume an old one, predates 2.x that had versions +- set (OPENEXR_VERSION 1.6.1) +- set (OPENEXR_MAJOR 1) +- set (OPENEXR_MINOR 6) +-endif () +- +- +-# List of likely places to find the libraries -- note priority override of +-# OPENEXR_CUSTOM_LIB_DIR and ${OPENEXR_HOME}/lib. +- +-# If there's no OPENEXR_HOME or ILMBASE_HOME, then the path will point to +-# "/lib", which may not always be wanted/expected. +-if (OPENEXR_CUSTOM_LIB_DIR) +- set (GENERIC_LIBRARY_PATHS ${GENERIC_LIBRARY_PATHS} ${OPENEXR_CUSTOM_LIB_DIR}) +-endif() +- +-if (OPENEXR_HOME) +- set (GENERIC_LIBRARY_PATHS ${GENERIC_LIBRARY_PATHS} ${OPENEXR_HOME}) +-endif() +- +-if (ILMBASE_HOME) +- set (GENERIC_LIBRARY_PATHS ${GENERIC_LIBRARY_PATHS} ${ILMBASE_HOME}) +-endif() +- +-set (GENERIC_LIBRARY_PATHS +- ${GENERIC_LIBRARY_PATHS} +- ${OPENEXR_INCLUDE_PATH}/../lib +- ${ILMBASE_INCLUDE_PATH}/../lib +- /usr/local/lib +- /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE} +- /usr/lib +- /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} +- /sw/lib +- /opt/local/lib +- $ENV{PROGRAM_FILES}/OpenEXR/lib/static ) +- +-# Handle request for static libs by altering CMAKE_FIND_LIBRARY_SUFFIXES. +-# We will restore it at the end of this file. +-set (_openexr_orig_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES}) +-if (OpenEXR_USE_STATIC_LIBS) +- if (WIN32) +- set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) +- else () +- set (CMAKE_FIND_LIBRARY_SUFFIXES .a) +- endif () +-endif () +- +-# Look for the libraries themselves, for all the components. Like with the +-# headers, we do two finds -- first for custom locations, then for default. +-# This is complicated because the OpenEXR libraries may or may not be +-# built with version numbers embedded. +-set (_openexr_components IlmThread IlmImf Imath Iex Half) +-foreach (COMPONENT ${_openexr_components}) +- string (TOUPPER ${COMPONENT} UPPERCOMPONENT) +- # First try with the version embedded +- set (FULL_COMPONENT_NAME ${OPENEXR_CUSTOM_LIB_PREFIX}${COMPONENT}-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}${OPENEXR_CUSTOM_LIB_SUFFIX}) +- find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME} +- PATHS ${GENERIC_LIBRARY_PATHS} NO_DEFAULT_PATH) +- # Again, with no directory restrictions +- find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME}) +- # Try again without the version +- set (FULL_COMPONENT_NAME ${OPENEXR_CUSTOM_LIB_PREFIX}${COMPONENT}${OPENEXR_CUSTOM_LIB_SUFFIX}) +- find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME} +- PATHS ${GENERIC_LIBRARY_PATHS} NO_DEFAULT_PATH) +- # One more time, with no restrictions +- find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME}) +-endforeach () +-#Half usually has no suffix +-find_library (OPENEXR_HALF_LIBRARY ${OPENEXR_CUSTOM_LIB_PREFIX}Half +- PATHS ${GENERIC_LIBRARY_PATHS} NO_DEFAULT_PATH) +-find_library (OPENEXR_HALF_LIBRARY ${OPENEXR_CUSTOM_LIB_PREFIX}Half) +- +-# Set the FOUND, INCLUDE_DIR, and LIBRARIES variables. +-if (ILMBASE_INCLUDE_PATH AND OPENEXR_INCLUDE_PATH AND +- OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND +- OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY) +- set (OPENEXR_FOUND TRUE) +- set (ILMBASE_FOUND TRUE) +- set (ILMBASE_INCLUDE_DIR ${ILMBASE_INCLUDE_PATH};${ILMBASE_INCLUDE_PATH}/OpenEXR CACHE STRING "The include paths needed to use IlmBase") +- set (OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_PATH} CACHE STRING "The include paths needed to use OpenEXR") +- set (ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase") +- set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} ${ZLIB_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR") +-endif () +- +-find_package_handle_standard_args (OpenEXR +- REQUIRED_VARS ILMBASE_INCLUDE_PATH OPENEXR_INCLUDE_PATH +- OPENEXR_IMATH_LIBRARY OPENEXR_ILMIMF_LIBRARY +- OPENEXR_IEX_LIBRARY OPENEXR_HALF_LIBRARY +- VERSION_VAR OPENEXR_VERSION ++FIND_PATH(OPENEXR_INCLUDE_DIR ++ NAMES ++ OpenEXR/ImfXdr.h ++ HINTS ++ ${_openexr_SEARCH_DIRS} ++ PATH_SUFFIXES ++ include ++) ++ ++# If the headers were found, get the version from config file, if not already set. ++IF(OPENEXR_INCLUDE_DIR) ++ IF(NOT OPENEXR_VERSION) ++ ++ FIND_FILE(_openexr_CONFIG ++ NAMES ++ OpenEXRConfig.h ++ PATHS ++ "${OPENEXR_INCLUDE_DIR}" ++ "${OPENEXR_INCLUDE_DIR}/OpenEXR" ++ NO_DEFAULT_PATH + ) + +-message(WARNING "ILMBASE_INCLUDE_DIR: ${ILMBASE_INCLUDE_DIR}") ++ IF(_openexr_CONFIG) ++ FILE(STRINGS "${_openexr_CONFIG}" OPENEXR_BUILD_SPECIFICATION ++ REGEX "^[ \t]*#define[ \t]+OPENEXR_VERSION_STRING[ \t]+\"[.0-9]+\".*$") ++ ELSE() ++ MESSAGE(WARNING "Could not find \"OpenEXRConfig.h\" in \"${OPENEXR_INCLUDE_DIR}\"") ++ ENDIF() ++ ++ IF(OPENEXR_BUILD_SPECIFICATION) ++ MESSAGE(STATUS "${OPENEXR_BUILD_SPECIFICATION}") ++ STRING(REGEX REPLACE ".*#define[ \t]+OPENEXR_VERSION_STRING[ \t]+\"([.0-9]+)\".*" ++ "\\1" _openexr_libs_ver_init ${OPENEXR_BUILD_SPECIFICATION}) ++ ELSE() ++ MESSAGE(WARNING "Could not determine ILMBase library version, assuming ${_openexr_libs_ver_init}.") ++ ENDIF() ++ ++ UNSET(_openexr_CONFIG CACHE) ++ ++ ENDIF() ++ENDIF() ++ ++SET("OPENEXR_VERSION" ${_openexr_libs_ver_init} CACHE STRING "Version of OpenEXR lib") ++UNSET(_openexr_libs_ver_init) ++ ++STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _openexr_libs_ver ${OPENEXR_VERSION}) ++ ++SET(_openexr_LIBRARIES) ++FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS}) ++ STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) ++ ++ FIND_LIBRARY(OPENEXR_${UPPERCOMPONENT}_LIBRARY ++ NAMES ++ ${COMPONENT}-${_openexr_libs_ver} ${COMPONENT} ++ NAMES_PER_DIR ++ HINTS ++ ${_openexr_SEARCH_DIRS} ++ PATH_SUFFIXES ++ lib64 lib ++ ) ++ LIST(APPEND _openexr_LIBRARIES "${OPENEXR_${UPPERCOMPONENT}_LIBRARY}") ++ENDFOREACH() ++ ++UNSET(_openexr_libs_ver) ++ ++# handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if ++# all listed variables are TRUE ++INCLUDE(FindPackageHandleStandardArgs) ++FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR DEFAULT_MSG ++ _openexr_LIBRARIES OPENEXR_INCLUDE_DIR) ++ ++IF(OPENEXR_FOUND) ++ SET(OPENEXR_LIBRARIES ${_openexr_LIBRARIES}) ++ # Both include paths are needed because of dummy OSL headers mixing #include <OpenEXR/foo.h> and #include <foo.h> :( ++ SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR}/OpenEXR ${OPENEXR_INCLUDE_DIR}/Imath) ++ENDIF() + + MARK_AS_ADVANCED( +- ILMBASE_INCLUDE_DIR +- OPENEXR_INCLUDE_DIR +- ILMBASE_LIBRARIES +- OPENEXR_LIBRARIES +- OPENEXR_ILMIMF_LIBRARY +- OPENEXR_IMATH_LIBRARY +- OPENEXR_IEX_LIBRARY +- OPENEXR_HALF_LIBRARY +- OPENEXR_VERSION) +- +-# Restore the original CMAKE_FIND_LIBRARY_SUFFIXES +-set (CMAKE_FIND_LIBRARY_SUFFIXES ${_openexr_orig_suffixes}) ++ OPENEXR_INCLUDE_DIR ++ OPENEXR_VERSION ++) ++FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS}) ++ STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) ++ MARK_AS_ADVANCED(OPENEXR_${UPPERCOMPONENT}_LIBRARY) ++ENDFOREACH() ++ ++UNSET(COMPONENT) ++UNSET(UPPERCOMPONENT) ++UNSET(_openexr_FIND_COMPONENTS) ++UNSET(_openexr_LIBRARIES) ++UNSET(_openexr_SEARCH_DIRS) +diff --git a/src/aliceVision/image/io.cpp b/src/aliceVision/image/io.cpp +index ada9acffa..1de343007 100644 +--- a/src/aliceVision/image/io.cpp ++++ b/src/aliceVision/image/io.cpp +@@ -13,7 +13,7 @@ + #include <OpenImageIO/imagebuf.h> + #include <OpenImageIO/imagebufalgo.h> + +-#include <OpenEXR/half.h> ++#include <Imath/half.h> + + #include <boost/filesystem.hpp> + #include <boost/algorithm/string.hpp> +diff --git a/src/aliceVision/panorama/imageOps.hpp b/src/aliceVision/panorama/imageOps.hpp +index 624f027d2..1f61d645a 100644 +--- a/src/aliceVision/panorama/imageOps.hpp ++++ b/src/aliceVision/panorama/imageOps.hpp +@@ -2,7 +2,7 @@ + + #include <aliceVision/image/all.hpp> + #include "cachedImage.hpp" +-#include <OpenEXR/half.h> ++#include <Imath/half.h> + + namespace aliceVision + { +diff --git a/src/aliceVision/panorama/warper.cpp b/src/aliceVision/panorama/warper.cpp +index bd6b775eb..a5ec2297e 100644 +--- a/src/aliceVision/panorama/warper.cpp ++++ b/src/aliceVision/panorama/warper.cpp +@@ -1,5 +1,5 @@ + #include "warper.hpp" +-#include <OpenEXR/half.h> ++#include <Imath/half.h> + + namespace aliceVision + { +diff --git a/src/aliceVision/mvsData/imageIO.cpp b/src/aliceVision/mvsData/imageIO.cpp +index e970617b2..167e2dede 100644 +--- a/src/aliceVision/mvsData/imageIO.cpp ++++ b/src/aliceVision/mvsData/imageIO.cpp +@@ -16,7 +16,7 @@ + #include <OpenImageIO/imagebuf.h> + #include <OpenImageIO/imagebufalgo.h> + +-#include <OpenEXR/half.h> ++#include <Imath/half.h> + + #include <boost/filesystem.hpp> + #include <boost/algorithm/string/case_conv.hpp> |