diff options
author | Paul Zander <negril.nx@gmail.com> | 2023-06-28 14:39:38 +0200 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-07-19 21:59:16 +0100 |
commit | 585ca5fdc0b38af79b53f68defb4deb4f735c356 (patch) | |
tree | 1ac33dcbb13491714d291c5e24dd5cc0553abff2 /media-libs/opencolorio | |
parent | www-client/chromium: 115.0.5790.98 slot as stable (diff) | |
download | gentoo-585ca5fdc0b38af79b53f68defb4deb4f735c356.tar.gz gentoo-585ca5fdc0b38af79b53f68defb4deb4f735c356.tar.bz2 gentoo-585ca5fdc0b38af79b53f68defb4deb4f735c356.zip |
media-libs/opencolorio: add 2.2.1
add support for sys-libs/minizip-ng:4
Bug: https://bugs.gentoo.org/895714
Closes: https://bugs.gentoo.org/829604
Closes: https://bugs.gentoo.org/895714
Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/31876
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/opencolorio')
5 files changed, 248 insertions, 1 deletions
diff --git a/media-libs/opencolorio/Manifest b/media-libs/opencolorio/Manifest index 0302db0fdbed..debed58d79d4 100644 --- a/media-libs/opencolorio/Manifest +++ b/media-libs/opencolorio/Manifest @@ -1 +1,2 @@ DIST opencolorio-2.1.3.tar.gz 11024701 BLAKE2B bcd1eb6a74260f451e49ef40e729bfc4c354ab255d96c261fbf865c586f285fe876ed54b05276f3b6b25ece4fd261672fe1dd519041ffad77d7c78efc8cf161d SHA512 b26fcfa3ea12ab6e4b019a13ce79ebcfd215c674acb348f2d9f85f749b2a5beccd395ed1cc9954e4b3cb83a160b24a8d7d81994ac1d9ea8cfe074b81d6b8a061 +DIST opencolorio-2.2.1.tar.gz 11336775 BLAKE2B b463d6a0a7e7fec0a890fa8a0cd06ed269f925c5986dfb82eb53728a09d884c89e6c4dfe112706ce27351d4440909ff9680387028d1dc887e7d866b30c39c54f SHA512 d5f3a4b5bd661af7336c015d07e0feccb286464a08239a3c259a97217001161e7571f5137475fc2f4d1b9af6381bbfa03c0b60f41de282f114307961b8d84fc9 diff --git a/media-libs/opencolorio/files/opencolorio-2.2.1-adjust-python-installation.patch b/media-libs/opencolorio/files/opencolorio-2.2.1-adjust-python-installation.patch new file mode 100644 index 000000000000..6f023310eb8d --- /dev/null +++ b/media-libs/opencolorio/files/opencolorio-2.2.1-adjust-python-installation.patch @@ -0,0 +1,17 @@ +From 5ca483b67404a9ba2230f2f03ff3255eceb3d2bc Mon Sep 17 00:00:00 2001 +From: Bernd Waibel <waebbl-gentoo@posteo.net> +Date: Sun, 19 Feb 2023 23:14:44 +0100 +Subject: [PATCH] [Gentoo-specific] adjust python installation + +Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net> +--- a/src/bindings/python/CMakeLists.txt ++++ b/src/bindings/python/CMakeLists.txt +@@ -230,7 +230,7 @@ target_compile_definitions(PyOpenColorIO + if(WIN32) + set(_Python_VARIANT_PATH "${CMAKE_INSTALL_LIBDIR}/site-packages") + else() +- set(_Python_VARIANT_PATH "${CMAKE_INSTALL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages") ++ set(_Python_VARIANT_PATH "${CMAKE_INSTALL_PREFIX}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages") + endif() + + # Create an internal global variable to access it in another scope but not publicly visible diff --git a/media-libs/opencolorio/files/opencolorio-2.2.1-support-minizip-ng-4.patch b/media-libs/opencolorio/files/opencolorio-2.2.1-support-minizip-ng-4.patch new file mode 100644 index 000000000000..8ee4ceaf9970 --- /dev/null +++ b/media-libs/opencolorio/files/opencolorio-2.2.1-support-minizip-ng-4.patch @@ -0,0 +1,92 @@ +# From https://github.com/AcademySoftwareFoundation/OpenColorIO/pull/1806 +From d15ccddd4d20d66749577d7444de861112f6864c Mon Sep 17 00:00:00 2001 +From: Brad Smith <brad@comstyle.com> +Date: Thu, 29 Jun 2023 09:57:28 -0400 +Subject: [PATCH] Add support for minizip-ng 4 API + +Signed-off-by: Brad Smith <brad@comstyle.com> +--- + src/OpenColorIO/OCIOZArchive.cpp | 22 +++++++++++++++++++++- + src/apps/ocioarchive/main.cpp | 4 ++++ + 2 files changed, 25 insertions(+), 1 deletion(-) + +diff --git a/src/OpenColorIO/OCIOZArchive.cpp b/src/OpenColorIO/OCIOZArchive.cpp +index 85fc7bb76..24d836e95 100644 +--- a/src/OpenColorIO/OCIOZArchive.cpp ++++ b/src/OpenColorIO/OCIOZArchive.cpp +@@ -225,7 +225,11 @@ void archiveConfig(std::ostream & ostream, const Config & config, const char * c + std::string configStr = ss.str(); + + // Write zip to memory stream. ++#if MZ_VERSION_BUILD >= 040000 ++ write_mem_stream = mz_stream_mem_create(); ++#else + mz_stream_mem_create(&write_mem_stream); ++#endif + mz_stream_mem_set_grow_size(write_mem_stream, 128 * 1024); + mz_stream_open(write_mem_stream, NULL, MZ_OPEN_MODE_CREATE); + +@@ -237,7 +241,11 @@ void archiveConfig(std::ostream & ostream, const Config & config, const char * c + options.compress_level = ArchiveCompressionLevels::BEST; + + // Create the writer handle. ++#if MZ_VERSION_BUILD >= 040000 ++ archiver = mz_zip_writer_create(); ++#else + mz_zip_writer_create(&archiver); ++#endif + + // Archive options. + // Compression method +@@ -332,7 +340,11 @@ void ExtractOCIOZArchive(const char * archivePath, const char * destination) + std::string outputDestination = pystring::os::path::normpath(destination); + + // Create zip reader. ++#if MZ_VERSION_BUILD >= 040000 ++ extracter = mz_zip_reader_create(); ++#else + mz_zip_reader_create(&extracter); ++#endif + + MinizipNgHandlerGuard extracterGuard(extracter, false, false); + +@@ -450,7 +462,11 @@ std::vector<uint8_t> getFileStringFromArchiveFile(const std::string & filepath, + std::vector<uint8_t> buffer; + + // Create the reader object. ++#if MZ_VERSION_BUILD >= 040000 ++ reader = mz_zip_reader_create(); ++#else + mz_zip_reader_create(&reader); ++#endif + + MinizipNgHandlerGuard extracterGuard(reader, false, true); + +@@ -510,7 +526,11 @@ void getEntriesMappingFromArchiveFile(const std::string & archivePath, + void *reader = NULL; + + // Create the reader object. ++#if MZ_VERSION_BUILD >= 040000 ++ reader = mz_zip_reader_create(); ++#else + mz_zip_reader_create(&reader); ++#endif + + MinizipNgHandlerGuard extracterGuard(reader, false, false); + +diff --git a/src/apps/ocioarchive/main.cpp b/src/apps/ocioarchive/main.cpp +index 190cadee5..68054a6da 100644 +--- a/src/apps/ocioarchive/main.cpp ++++ b/src/apps/ocioarchive/main.cpp +@@ -235,7 +235,11 @@ int main(int argc, const char **argv) + } + + std::string path = args[0]; ++#if MZ_VERSION_BUILD >= 040000 ++ reader = mz_zip_reader_create(); ++#else + mz_zip_reader_create(&reader); ++#endif + struct tm tmu_date; + + err = mz_zip_reader_open_file(reader, path.c_str()); diff --git a/media-libs/opencolorio/metadata.xml b/media-libs/opencolorio/metadata.xml index 8c99b35a00f1..6485e6974262 100644 --- a/media-libs/opencolorio/metadata.xml +++ b/media-libs/opencolorio/metadata.xml @@ -2,7 +2,14 @@ <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <!-- maintainer-needed --> - <longdescription lang="en">OpenColorIO (OCIO) is a complete color management solution geared towards motion picture production with an emphasis on visual effects and computer animation.</longdescription> + <longdescription lang="en"> + OpenColorIO (OCIO) is a complete color management solution geared + towards motion picture production with an emphasis on visual effects + and computer animation. + </longdescription> + <use> + <flag name="apps">Build the OCIO command line apps</flag> + </use> <upstream> <remote-id type="github">AcademySoftwareFoundation/OpenColorIO</remote-id> </upstream> diff --git a/media-libs/opencolorio/opencolorio-2.2.1.ebuild b/media-libs/opencolorio/opencolorio-2.2.1.ebuild new file mode 100644 index 000000000000..ab405183a85e --- /dev/null +++ b/media-libs/opencolorio/opencolorio-2.2.1.ebuild @@ -0,0 +1,130 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..11} ) + +inherit cmake python-single-r1 virtualx + +DESCRIPTION="A color management framework for visual effects and animation" +HOMEPAGE="https://opencolorio.org https://github.com/AcademySoftwareFoundation/OpenColorIO" +SRC_URI="https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/OpenColorIO-${PV}" + +LICENSE="BSD" +SLOT="0/$(ver_cut 1-2)" +# minizip-ng: ~arm ~arm64 ~ppc64 ~riscv +# osl: ~riscv +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" +IUSE="apps cpu_flags_x86_sse2 doc opengl python static-libs test" +# TODO: drop opengl? It does nothing without building either the apps or the testsuite +REQUIRED_USE=" + apps? ( opengl ) + doc? ( python ) + python? ( ${PYTHON_REQUIRED_USE} ) + test? ( opengl ) +" + +RDEPEND=" + dev-cpp/pystring + >=dev-cpp/yaml-cpp-0.7.0:= + dev-libs/expat + >=dev-libs/imath-3.1.5:= + sys-libs/minizip-ng + sys-libs/zlib + apps? ( + media-libs/lcms:2 + >=media-libs/openexr-3.1.5:= + ) + opengl? ( + media-libs/freeglut + media-libs/glew:= + media-libs/libglvnd + ) + python? ( + ${PYTHON_DEPS} + $(python_gen_cond_dep 'dev-python/pybind11[${PYTHON_USEDEP}]') + ) +" +DEPEND="${RDEPEND}" +# TODO: OSL tests would need OIIO, leading to a circular dependency. If OIIO +# isn't found this test will be skipped (automagic if found?) +BDEPEND=" + virtual/pkgconfig + doc? ( + app-doc/doxygen + $(python_gen_cond_dep ' + dev-python/breathe[${PYTHON_USEDEP}] + dev-python/recommonmark[${PYTHON_USEDEP}] + dev-python/six[${PYTHON_USEDEP}] + dev-python/sphinx[${PYTHON_USEDEP}] + dev-python/sphinx-tabs[${PYTHON_USEDEP}] + dev-python/testresources[${PYTHON_USEDEP}] + ') + ) + opengl? ( + media-libs/freeglut + media-libs/glew:= + media-libs/libglvnd + ) +" +# test? ( +# >=media-libs/openimageio-2.2.14 +# >=media-libs/osl-1.11 +# ) +# " + +# Restricting tests, bugs #439790 and #447908 +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}"/${PN}-2.2.1-adjust-python-installation.patch + "${FILESDIR}"/${PN}-2.2.1-support-minizip-ng-4.patch +) + +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +src_prepare() { + cmake_src_prepare + + # Avoid automagic test dependency on OSL, bug #833933 + # Can cause problems during e.g. OpenEXR unsplitting migration + cmake_run_in tests cmake_comment_add_subdirectory osl +} + +src_configure() { + # Missing features: + # - Truelight and Nuke are not in portage for now, so their support are disabled + # - Java bindings was not tested, so disabled + # Notes: + # - OpenImageIO or OpenEXR (default) is required for building ociodisplay and + # ocioconvert (USE opengl) + # - OpenGL, GLUT and GLEW is required for building ociodisplay (USE opengl) + local mycmakeargs=( + -DBUILD_SHARED_LIBS=$(usex !static-libs) + -DOCIO_BUILD_APPS=$(usex apps) + -DOCIO_BUILD_DOCS=$(usex doc) + -DOCIO_BUILD_FROZEN_DOCS=$(usex doc) + -DOCIO_BUILD_GPU_TESTS=$(usex test) + -DOCIO_BUILD_JAVA=OFF + -DOCIO_BUILD_PYTHON=$(usex python) + -DOCIO_BUILD_TESTS=$(usex test) + -DOCIO_INSTALL_EXT_PACKAGES=NONE + -DOCIO_USE_OIIO_CMAKE_CONFIG=ON + -DOCIO_USE_SSE=$(usex cpu_flags_x86_sse2) + ) + use python && mycmakeargs+=( + -DOCIO_PYTHON_VERSION="${EPYTHON/python/}" + -DPython_EXECUTABLE="${PYTHON}" + -DPYTHON_VARIANT_PATH=$(python_get_sitedir) + ) + + cmake_src_configure +} + +src_test() { + virtx cmake_src_test +} |