Skip to content

Commit

Permalink
graphics/opencoloriov1: unbreak the port's build in C++17 mode
Browse files Browse the repository at this point in the history
While here, expand COMMENT, drop `localbase:ldflags' from USES,
tight up the `post-install' recipe (trim some useless commands,
wrap overly long lines), pacify stage Q/A report.

Reported by:	pkg-fallout
  • Loading branch information
Alexey Dokuchaev authored and Alexey Dokuchaev committed Dec 1, 2023
1 parent 3dee7e5 commit 7eb506d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
25 changes: 14 additions & 11 deletions graphics/opencoloriov1/Makefile
Expand Up @@ -5,15 +5,15 @@ CATEGORIES= graphics multimedia
PKGNAMESUFFIX= v1

MAINTAINER= danfe@FreeBSD.org
COMMENT= Complete color management solution v1
COMMENT= Complete color management solution (legacy version)
WWW= https://opencolorio.org/

LICENSE= BSD3CLAUSE

LIB_DEPENDS= libtinyxml.so:textproc/tinyxml \
libyaml-cpp.so:devel/yaml-cpp

USES= alias cmake compiler:c++11-lang localbase:ldflags pkgconfig \
USES= alias cmake compiler:c++11-lang pkgconfig \
python:build shebangfix

USE_GITHUB= yes
Expand Down Expand Up @@ -42,16 +42,19 @@ CMAKE_ON+= OCIO_USE_SSE
CMAKE_OFF+= OCIO_USE_SSE
.endif

post-patch:
@${REINPLACE_CMD} -e 's| : std::binary_function.*||' \
${WRKSRC}/src/core/PathUtils.h

post-install:
${RM} -R ${STAGEDIR}/${PREFIX}/share/ocio
# add v1 suffix
${REINPLACE_CMD} -e 's|<OpenColorIO/|<OpenColorIOv1/|g' \
${STAGEDIR}/${PREFIX}/include/OpenColorIOv1/*
${FIND} ${STAGEDIR}${PREFIX}/include/OpenColorIOv1 -name '*.bak' -delete
@(cd ${STAGEDIR}/${PREFIX} && ${MKDIR} lib/cmake/Modules && \
${MV} OpenColorIOv1Config.cmake lib/cmake/Modules/ && \
${MV} cmake/OpenColorIO-release.cmake lib/cmake/Modules/OpenColorIOv1-release.cmake && \
${MV} cmake/OpenColorIO.cmake lib/cmake/Modules/OpenColorIOv1.cmake && \
@${REINPLACE_CMD} -e 's|e <OpenColorIO|&v1|' \
${STAGEDIR}${PREFIX}/include/OpenColorIOv1/*[Os].h
@(cd ${STAGEDIR}${PREFIX} && ${MKDIR} lib/cmake/Modules && \
${MV} OpenColorIOv1Config.cmake lib/cmake/Modules && \
${MV} cmake/OpenColorIO-release.cmake \
lib/cmake/Modules/OpenColorIOv1-release.cmake && \
${MV} cmake/OpenColorIO.cmake \
lib/cmake/Modules/OpenColorIOv1.cmake && \
${RMDIR} cmake)

.include <bsd.port.mk>
9 changes: 9 additions & 0 deletions graphics/opencoloriov1/files/patch-CMakeLists.txt
Expand Up @@ -9,6 +9,15 @@
# Need to also get the boost headers here, as yaml-cpp 0.5.0+ requires them.
# Don't bother doing this step if we are already including the boost headers for shared_ptr
if(NOT OCIO_USE_BOOST_PTR)
@@ -384,7 +384,7 @@ else()
set(OCIO_INLINES_HIDDEN OFF)
endif()

-set(EXTERNAL_COMPILE_FLAGS "-DTIXML_USE_STL ${YAML_CPP_COMPILE_FLAGS} ${GCC_COMPILE_FLAGS}")
+set(EXTERNAL_COMPILE_FLAGS "${YAML_CPP_COMPILE_FLAGS} ${GCC_COMPILE_FLAGS}")

set(EXTERNAL_LINK_FLAGS "")
set(EXTERNAL_LIBRARY_DIRS ${PROJECT_BINARY_DIR}/ext/dist/lib)
@@ -531,8 +531,6 @@ endif()
configure_file(${CMAKE_SOURCE_DIR}/share/ocio/setup_ocio.sh.in
${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh @ONLY)
Expand Down
5 changes: 3 additions & 2 deletions graphics/opencoloriov1/files/patch-src_core_CMakeLists.txt
@@ -1,4 +1,4 @@
--- src/core/CMakeLists.txt.orig 2021-12-07 20:11:03 UTC
--- src/core/CMakeLists.txt.orig 2019-03-28 05:12:57 UTC
+++ src/core/CMakeLists.txt
@@ -56,7 +56,7 @@ if(OCIO_BUILD_SHARED)
endif()
Expand All @@ -22,6 +22,7 @@
configure_file(${CMAKE_SOURCE_DIR}/export/pkgconfig/OpenColorIO.pc.in
- ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc @ONLY)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc
- DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/lib${LIB_SUFFIX}/pkgconfig/)
+ ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIOv1.pc @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIOv1.pc
DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/lib${LIB_SUFFIX}/pkgconfig/)
+ DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/libdata/pkgconfig/)

0 comments on commit 7eb506d

Please sign in to comment.