aboutsummaryrefslogtreecommitdiff
path: root/ports/openexr
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-06-15 10:19:42 -0700
committerGitHub <noreply@github.com>2017-06-15 10:19:42 -0700
commit2da08053d615e1ffc6b7dc16f5ee1876229e0bee (patch)
tree682f2c247f4b627ba7996348e135a9af4f57df77 /ports/openexr
parentd1c32d241f8c06dc7169ea43070032229b2a7eb0 (diff)
parenta051d0cb8aa5a80c06809e8d0839fd7353fab945 (diff)
downloadvcpkg-2da08053d615e1ffc6b7dc16f5ee1876229e0bee.tar.gz
vcpkg-2da08053d615e1ffc6b7dc16f5ee1876229e0bee.zip
Merge pull request #1278 from codicodi/openexr
[openexr] new port
Diffstat (limited to 'ports/openexr')
-rw-r--r--ports/openexr/CONTROL4
-rw-r--r--ports/openexr/add-missing-export.patch13
-rw-r--r--ports/openexr/portfile.cmake54
3 files changed, 71 insertions, 0 deletions
diff --git a/ports/openexr/CONTROL b/ports/openexr/CONTROL
new file mode 100644
index 000000000..1ce905777
--- /dev/null
+++ b/ports/openexr/CONTROL
@@ -0,0 +1,4 @@
+Source: openexr
+Version: 2.2.0
+Description: OpenEXR is a high dynamic-range (HDR) image file format developed by Industrial Light & Magic for use in computer imaging applications
+Build-Depends: zlib, ilmbase
diff --git a/ports/openexr/add-missing-export.patch b/ports/openexr/add-missing-export.patch
new file mode 100644
index 000000000..c78842d18
--- /dev/null
+++ b/ports/openexr/add-missing-export.patch
@@ -0,0 +1,13 @@
+diff --git a/IlmImf/ImfHeader.h b/IlmImf/ImfHeader.h
+index 756a62e..dd71e0e 100644
+--- a/IlmImf/ImfHeader.h
++++ b/IlmImf/ImfHeader.h
+@@ -493,7 +493,7 @@ class Header::ConstIterator
+ //
+ //------------------------------------------------------------------------
+
+-void staticInitialize ();
++IMF_EXPORT void staticInitialize ();
+
+
+ //-----------------
diff --git a/ports/openexr/portfile.cmake b/ports/openexr/portfile.cmake
new file mode 100644
index 000000000..1bcabc458
--- /dev/null
+++ b/ports/openexr/portfile.cmake
@@ -0,0 +1,54 @@
+set(OPENEXR_VERSION 2.2.0)
+set(OPENEXR_HASH 017abbeeb6b814508180721bc8e8940094965c4c55b135a198c6bcb109a04bf7f72e4aee81ee72cb2185fe818a41d892b383e8d2d59f40c673198948cb79279a)
+
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openexr-${OPENEXR_VERSION})
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://download.savannah.nongnu.org/releases/openexr/openexr-${OPENEXR_VERSION}.tar.gz"
+ FILENAME "openexr-${OPENEXR_VERSION}.zip"
+ SHA512 ${OPENEXR_HASH})
+
+vcpkg_extract_source_archive(${ARCHIVE})
+vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH}
+ PATCHES ${CMAKE_CURRENT_LIST_DIR}/add-missing-export.patch)
+
+# Ensure helper executables can run during build
+set(ENV{PATH} "$ENV{PATH};${CURRENT_INSTALLED_DIR}/bin")
+
+# In debug build buildsystem cannot locate IlmBase headers
+set(VCPKG_C_FLAGS_DEBUG "${VCPKG_C_FLAGS_DEBUG}")
+set(VCPKG_CXX_FLAGS_DEBUG "${VCPKG_CXX_FLAGS_DEBUG} -I\"${CURRENT_INSTALLED_DIR}/include/OpenExr\"")
+
+vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS_DEBUG
+ -DILMBASE_PACKAGE_PREFIX=${CURRENT_INSTALLED_DIR}/debug
+ OPTIONS_RELEASE
+ -DILMBASE_PACKAGE_PREFIX=${CURRENT_INSTALLED_DIR})
+
+vcpkg_install_cmake()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share ${CURRENT_PACKAGES_DIR}/debug/share)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ foreach(SUBDIR "" "/debug")
+ file(GLOB DLLS ${CURRENT_PACKAGES_DIR}${SUBDIR}/lib/*.dll)
+ file(COPY ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}${SUBDIR}/bin)
+ file(REMOVE ${DLLS})
+ endforeach()
+endif()
+
+vcpkg_copy_pdbs()
+
+file(READ ${CURRENT_PACKAGES_DIR}/include/OpenEXR/ImfExport.h HEADER_FILE)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ string(REPLACE "defined(OPENEXR_DLL)" "1" HEADER_FILE "${HEADER_FILE}")
+else()
+ string(REPLACE "defined(OPENEXR_DLL)" "0" HEADER_FILE "${HEADER_FILE}")
+endif()
+file(WRITE ${CURRENT_PACKAGES_DIR}/include/OpenEXR/ImfExport.h "${HEADER_FILE}")
+
+file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openexr)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/openexr/LICENSE ${CURRENT_PACKAGES_DIR}/share/openexr/copyright)