git: 9dbff489d9bb - main - graphics/appleseed: try to unbreak and slightly improve the port (+)

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Sun, 28 Jul 2024 05:31:27 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9dbff489d9bb402d2fc5ef3a38a97f36ea7bb9ab

commit 9dbff489d9bb402d2fc5ef3a38a97f36ea7bb9ab
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2024-07-28 05:29:50 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2024-07-28 05:29:50 +0000

    graphics/appleseed: try to unbreak and slightly improve the port (+)
    
    Pull the patch from the Arch/AUR package to unbreak the build against
    OSL version 1.13.7 and later.  While here, cleanup Imath 3.x support:
    drop actually useless patch and fix detection logic in the right file
    instead of polluting global CFLAGS and using naive search heuristics.
    
    Nagged by:      pkg-fallout (after commit cfcb40e24056)
---
 graphics/appleseed/Makefile                              | 12 ++++++------
 graphics/appleseed/distinfo                              |  2 ++
 graphics/appleseed/files/patch-CMakeLists.txt            | 16 +++++++++++++---
 .../patch-sandbox_share_cmake_Modules_FindImath.cmake    | 14 --------------
 4 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/graphics/appleseed/Makefile b/graphics/appleseed/Makefile
index 3c8864ec92f1..bc3fef5bd010 100644
--- a/graphics/appleseed/Makefile
+++ b/graphics/appleseed/Makefile
@@ -3,6 +3,9 @@ DISTVERSION=	2.1.0-beta
 PORTREVISION=	14
 CATEGORIES=	graphics
 
+PATCH_SITES=	http://vault.101011010.xyz/distfiles/ LOCAL/danfe
+PATCHFILES=	OSL-01.13.7.patch:-p1
+
 MAINTAINER=	danfe@FreeBSD.org
 COMMENT=	Modern, physically-based production renderer
 WWW=		https://appleseedhq.net/
@@ -29,9 +32,6 @@ ONLY_FOR_ARCHS_REASON=	not ported to it yet
 USES=		cmake compiler:c++11-lang shebangfix
 SHEBANG_FILES=	scripts/*.py
 
-CFLAGS+=	-I${LOCALBASE}/include/Imath
-CFLAGS+=	-I${LOCALBASE}/include/OpenEXR
-
 CMAKE_ARGS=	-DWITH_PYTHON2_BINDINGS:BOOL=OFF \
 		-DWITH_DOXYGEN:BOOL=OFF \
 		-DINSTALL_HEADERS:BOOL=OFF \
@@ -72,9 +72,9 @@ STUDIO_IMPLIES=	PYTHON
 post-patch:
 	@${RMDIR} ${WRKSRC}/sandbox/docs/api
 	@${RM} ${WRKSRC}/sandbox/share/cmake/Modules/FindOpenImageIO.cmake
-	${REINPLACE_CMD} 's,OpenEXR/Imath,Imath/Imath,' \
-                ${WRKSRC}/sandbox/share/cmake/Modules/FindImath.cmake \
-                ${WRKSRC}/src/appleseed/foundation/meta/tests/test_quaternion.cpp \
+	@${REINPLACE_CMD} -e 's,OpenEXR,Imath, ; /[ {]IMATH_HALF_LIBRARY/d' \
+		${WRKSRC}/cmake/modules/FindImath.cmake
+	@${REINPLACE_CMD} -e 's,OpenEXR/Imath,Imath/Imath,' \
                 ${WRKSRC}/src/appleseed/foundation/meta/tests/test_matrix.cpp \
                 ${WRKSRC}/src/appleseed/foundation/meta/tests/test_quaternion.cpp \
                 ${WRKSRC}/src/appleseed/foundation/meta/tests/test_vector.cpp \
diff --git a/graphics/appleseed/distinfo b/graphics/appleseed/distinfo
index 0cce5a17b714..60408ec4dddb 100644
--- a/graphics/appleseed/distinfo
+++ b/graphics/appleseed/distinfo
@@ -1,3 +1,5 @@
 TIMESTAMP = 1567266541
 SHA256 (appleseedhq-appleseed-2.1.0-beta_GH0.tar.gz) = 5f8599c64a9c1dbdf0d8ee13a4d395b03e9bcba17fec731526109437ab760898
 SIZE (appleseedhq-appleseed-2.1.0-beta_GH0.tar.gz) = 203650426
+SHA256 (OSL-01.13.7.patch) = 1c6f597dfb314f059953a2efba32dd19be07a5a815a0982fa62775081ef0d28d
+SIZE (OSL-01.13.7.patch) = 19461
diff --git a/graphics/appleseed/files/patch-CMakeLists.txt b/graphics/appleseed/files/patch-CMakeLists.txt
index b83bc2c3d408..793cad65f13f 100644
--- a/graphics/appleseed/files/patch-CMakeLists.txt
+++ b/graphics/appleseed/files/patch-CMakeLists.txt
@@ -1,6 +1,16 @@
 --- CMakeLists.txt.orig	2019-08-31 15:49:01 UTC
 +++ CMakeLists.txt
-@@ -681,8 +681,8 @@ if (WITH_PYTHON2_BINDINGS OR WITH_PYTHON3_BINDINGS)
+@@ -356,9 +356,7 @@ endif ()
+ if (USE_FIND_PACKAGE_FOR_EXR)
+     include_directories (
+         ${IMATH_INCLUDE_DIRS}
+-        ${IMATH_INCLUDE_DIRS}/OpenEXR/
+         ${OPENEXR_INCLUDE_DIRS}
+-        ${OPENEXR_INCLUDE_DIRS}/OpenEXR/
+     )
+ else ()
+     include_directories (
+@@ -681,8 +679,8 @@ if (WITH_PYTHON2_BINDINGS OR WITH_PYTHON3_BINDINGS)
  endif ()
  
  if (WITH_STUDIO)
@@ -11,7 +21,7 @@
      endif ()
      add_subdirectory (src/appleseed.studio)
  endif ()
-@@ -732,15 +732,27 @@ install (
+@@ -732,15 +730,27 @@ install (
          sandbox/share
          sandbox/stylesheets
      DESTINATION .
@@ -40,7 +50,7 @@
          ${OSL_COMPILER}
          ${OSL_QUERY_INFO}
          ${OSL_MAKETX}
-@@ -754,11 +766,6 @@ install (
+@@ -754,11 +764,6 @@ install (
          sandbox/schemas/settings.xsd
          sandbox/schemas/project.xsd
      DESTINATION schemas
diff --git a/graphics/appleseed/files/patch-sandbox_share_cmake_Modules_FindImath.cmake b/graphics/appleseed/files/patch-sandbox_share_cmake_Modules_FindImath.cmake
deleted file mode 100644
index e5f8652b64bc..000000000000
--- a/graphics/appleseed/files/patch-sandbox_share_cmake_Modules_FindImath.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
---- sandbox/share/cmake/Modules/FindImath.cmake.orig	2019-08-31 15:49:01 UTC
-+++ sandbox/share/cmake/Modules/FindImath.cmake
-@@ -39,10 +39,8 @@
- 
- include (FindPackageHandleStandardArgs)
- 
--find_path (IMATH_INCLUDE_DIR NAMES OpenEXR/ImathVec.h)
-+find_path (IMATH_INCLUDE_DIR NAMES Imath/ImathVec.h)
- 
--find_library (IMATH_HALF_LIBRARY NAMES Half)
--find_library (IMATH_IEX_LIBRARY NAMES Iex)
- find_library (IMATH_MATH_LIBRARY NAMES Imath)
- 
- # Handle the QUIETLY and REQUIRED arguments and set IMATH_FOUND.