opencolorio: Fix library exports, fix cmake files install location
This commit is contained in:
@@ -31,6 +31,39 @@
|
||||
# SSE instructions are automatically compiled into 64-bit applications so enabling the option is redundant and
|
||||
# actually produces an unknown option warning in Visual Studio.
|
||||
if(NOT CMAKE_CL_64)
|
||||
@@ -604,10 +604,16 @@
|
||||
set(OCIO_STATIC_COMPILE_DEFINITIONS )
|
||||
endif()
|
||||
endif()
|
||||
-install(EXPORT OpenColorIO DESTINATION cmake)
|
||||
+install(EXPORT OpenColorIO DESTINATION lib/cmake/OpenColorIO)
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake"
|
||||
"
|
||||
get_filename_component(OpenColorIO_DIR \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)
|
||||
+ get_filename_component(OpenColorIO_DIR \"\${OpenColorIO_DIR}\" PATH)
|
||||
+ get_filename_component(OpenColorIO_DIR \"\${OpenColorIO_DIR}\" PATH)
|
||||
+ get_filename_component(OpenColorIO_DIR \"\${OpenColorIO_DIR}\" PATH)
|
||||
+ if(OpenColorIO_DIR STREQUAL \"/\")
|
||||
+ set(OpenColorIO_DIR \"\")
|
||||
+ endif()
|
||||
|
||||
## include
|
||||
set(OpenColorIO_INCLUDE_DIR \"\${OpenColorIO_DIR}/include\")
|
||||
@@ -612,7 +618,7 @@
|
||||
|
||||
## targets libraries + associated definitions
|
||||
if(NOT TARGET OpenColorIO)
|
||||
- include(\"\${OpenColorIO_DIR}/cmake/OpenColorIO.cmake\") ## thanks to imported target
|
||||
+ include(\"\${OpenColorIO_DIR}/lib/cmake/OpenColorIO/OpenColorIO.cmake\") ## thanks to imported target
|
||||
if(TARGET OpenColorIO AND NOT OpenColorIO_USE_STATIC)
|
||||
message(STATUS \"shared target OpenColorIO : see OpenColorIO_LIBRARY\")
|
||||
set(OpenColorIO_LIBRARY OpenColorIO)
|
||||
@@ -650,4 +656,4 @@
|
||||
message(STATUS OPENCOLORIO_FOUND=\${OPENCOLORIO_FOUND})
|
||||
"
|
||||
)
|
||||
-install(FILES "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" DESTINATION .)
|
||||
+install(FILES "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" DESTINATION lib/cmake/OpenColorIO)
|
||||
--- opencolorio/src/core/CMakeLists.txt.orig 2017-09-17 22:33:47.446262300 +0300
|
||||
+++ opencolorio/src/core/CMakeLists.txt 2017-09-17 22:34:26.962522500 +0300
|
||||
@@ -18,7 +18,7 @@
|
||||
35
mingw-w64-opencolorio/008-export-attributes.patch
Normal file
35
mingw-w64-opencolorio/008-export-attributes.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
diff -Naur opencolorio-1.1.1-orig/export/OpenColorIO/OpenColorABI.h.in opencolorio-1.1.1/export/OpenColorIO/OpenColorABI.h.in
|
||||
--- opencolorio-1.1.1-orig/export/OpenColorIO/OpenColorABI.h.in 2019-03-28 08:12:57.000000000 +0300
|
||||
+++ opencolorio-1.1.1/export/OpenColorIO/OpenColorABI.h.in 2019-07-31 21:59:45.504868700 +0300
|
||||
@@ -73,15 +73,7 @@
|
||||
|
||||
// If supported, define OCIOEXPORT, OCIOHIDDEN
|
||||
// (used to choose which symbols to export from OpenColorIO)
|
||||
-#if defined __GNUC__
|
||||
- #if __GNUC__ >= 4
|
||||
- #define OCIOEXPORT __attribute__ ((visibility("default")))
|
||||
- #define OCIOHIDDEN __attribute__ ((visibility("hidden")))
|
||||
- #else
|
||||
- #define OCIOEXPORT
|
||||
- #define OCIOHIDDEN
|
||||
- #endif
|
||||
-#elif defined(_WIN32) || defined(_WIN64) || defined(_WINDOWS) || defined(_MSC_VER)
|
||||
+#if defined(_WIN32) || defined(_WIN64) || defined(_WINDOWS) || defined(_MSC_VER)
|
||||
// Windows requires you to export from the main library and then import in any others
|
||||
#ifndef OpenColorIO_STATIC
|
||||
#if defined OpenColorIO_EXPORTS
|
||||
@@ -93,6 +85,14 @@
|
||||
#define OCIOEXPORT
|
||||
#endif
|
||||
#define OCIOHIDDEN
|
||||
+#elif defined __GNUC__
|
||||
+ #if __GNUC__ >= 4
|
||||
+ #define OCIOEXPORT __attribute__ ((visibility("default")))
|
||||
+ #define OCIOHIDDEN __attribute__ ((visibility("hidden")))
|
||||
+ #else
|
||||
+ #define OCIOEXPORT
|
||||
+ #define OCIOHIDDEN
|
||||
+ #endif
|
||||
#else // Others platforms not supported atm
|
||||
#define OCIOEXPORT
|
||||
#define OCIOHIDDEN
|
||||
@@ -6,7 +6,7 @@ pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}-git")
|
||||
replaces=("${MINGW_PACKAGE_PREFIX}-${_realname}-git")
|
||||
pkgver=1.1.1
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="A color management framework for visual effects and animation (mingw-w64)"
|
||||
arch=('any')
|
||||
url="http://opencolorio.org"
|
||||
@@ -27,33 +27,36 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
|
||||
"${MINGW_PACKAGE_PREFIX}-pkg-config"
|
||||
"${MINGW_PACKAGE_PREFIX}-pystring"
|
||||
)
|
||||
options=('strip')
|
||||
options=('strip' '!debug')
|
||||
source=(${_realname}-${pkgver}.tar.gz::https://github.com/imageworks/OpenColorIO/archive/v${pkgver}.tar.gz
|
||||
fix-typo-in-formatregistry.patch
|
||||
mingw-w64.patch
|
||||
fix-redefinitions.patch
|
||||
msvc-flags.patch
|
||||
declspec-typo.patch
|
||||
mingw-no-dupenv_s.patch
|
||||
detect-mingw-python.patch)
|
||||
001-fix-typo-in-formatregistry.patch
|
||||
002-mingw-w64.patch
|
||||
003-fix-redefinitions.patch
|
||||
004-msvc-flags.patch
|
||||
005-declspec-typo.patch
|
||||
006-mingw-no-dupenv_s.patch
|
||||
007-detect-mingw-python.patch
|
||||
008-export-attributes.patch)
|
||||
sha256sums=('c9b5b9def907e1dafb29e37336b702fff22cc6306d445a13b1621b8a754c14c8'
|
||||
'22a8df1dc67ce9da35f2795b4be495ace59620416bc3767fb7dbcbc8b1f2a9e8'
|
||||
'597e193e65c249388ce8eb73b5fe0a19688d3b398bf40e42a79a07650ce1792a'
|
||||
'fa8c45602714eb70c7bbde05a37edf3b1cd1188e3667151af03c971bf11f3fd4'
|
||||
'802b66e1e52c5b4341afbdcc31211917b1223fb2db111c49603bc415c29d4b91'
|
||||
'122a76e1c7b34c79bfc2c5c9585e6ea489a6303cef6443fe15f0d49d53e84c2d'
|
||||
'e05535790881bdd719084b1da131f2c0a7d858ab6a22c2e9e061eaf451383ea1'
|
||||
'3251ea540eae1fb0648248f0c60179765956003a1c4adbf6c88e7476171a8702'
|
||||
'330a81ce83c32bfffe214b3404c5001585b9113a0e58572ea09bb67960a80ced')
|
||||
'330a81ce83c32bfffe214b3404c5001585b9113a0e58572ea09bb67960a80ced'
|
||||
'5df481814e34ea162d5a48582b3055e3411c1ca206601724c2d7220e5b7649cb')
|
||||
|
||||
prepare() {
|
||||
cd ${_realname}-${pkgver}
|
||||
patch -p1 -i ${srcdir}/fix-typo-in-formatregistry.patch
|
||||
patch -p1 -i ${srcdir}/mingw-w64.patch
|
||||
patch -p1 -i ${srcdir}/fix-redefinitions.patch
|
||||
patch -p1 -i ${srcdir}/msvc-flags.patch
|
||||
patch -p1 -i ${srcdir}/declspec-typo.patch
|
||||
patch -p1 -i ${srcdir}/mingw-no-dupenv_s.patch
|
||||
patch -p1 -i ${srcdir}/detect-mingw-python.patch
|
||||
patch -p1 -i ${srcdir}/001-fix-typo-in-formatregistry.patch
|
||||
patch -p1 -i ${srcdir}/002-mingw-w64.patch
|
||||
patch -p1 -i ${srcdir}/003-fix-redefinitions.patch
|
||||
patch -p1 -i ${srcdir}/004-msvc-flags.patch
|
||||
patch -p1 -i ${srcdir}/005-declspec-typo.patch
|
||||
patch -p1 -i ${srcdir}/006-mingw-no-dupenv_s.patch
|
||||
patch -p1 -i ${srcdir}/007-detect-mingw-python.patch
|
||||
patch -p1 -i ${srcdir}/008-export-attributes.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
@@ -72,7 +75,7 @@ build() {
|
||||
[[ -d "build-${MINGW_CHOST}" ]] && rm -rf "build-${MINGW_CHOST}"
|
||||
mkdir -p ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST}
|
||||
|
||||
local _py2ver=$(${MINGW_PREFIX}/bin/python3 -c "import sys;sys.stdout.write('.'.join(map(str, sys.version_info[:2])))")
|
||||
local _py2ver=$(${MINGW_PREFIX}/bin/python2 -c "import sys;sys.stdout.write('.'.join(map(str, sys.version_info[:2])))")
|
||||
|
||||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
||||
${MINGW_PREFIX}/bin/cmake \
|
||||
|
||||
Reference in New Issue
Block a user