git: 7b0de35cb0c2 - main - graphics/py-mayavi: Fix build on some systems

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Mon, 30 Oct 2023 18:37:18 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7b0de35cb0c207c4dc7a14a0015a89369101753b

commit 7b0de35cb0c207c4dc7a14a0015a89369101753b
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-10-30 18:35:10 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-10-30 18:37:16 +0000

    graphics/py-mayavi: Fix build on some systems
    
    ... by preventing tvtk_classes.zip rebuild.
    
    Such rebuild causes failure, and it is also conditional
    on file time comparison.
    
    Accepting the pre-existing tvtk_classes.zip prevents such
    rebuild, which hopefully would prevent build failured.
    
    Reported by:    fallout
---
 graphics/py-mayavi/files/patch-setup.py | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/graphics/py-mayavi/files/patch-setup.py b/graphics/py-mayavi/files/patch-setup.py
index 310be4df1bed..e005fa7e1a0d 100644
--- a/graphics/py-mayavi/files/patch-setup.py
+++ b/graphics/py-mayavi/files/patch-setup.py
@@ -1,6 +1,21 @@
---- setup.py.orig	2016-08-01 19:02:36 UTC
+- The first patch is to fix build by accepting tvtk_classes.zip,
+- otherwise the build SEGVs on some platforms.
+- Rebuilding tvtk_classes.zip seems to cause SEGVs.
+
+- Misc other patches.
+
+--- setup.py.orig	2022-10-17 14:42:18 UTC
 +++ setup.py
-@@ -403,12 +403,12 @@ def configuration(parent_package=None, t
+@@ -260,7 +260,7 @@ def _tvtk_built_recently(zipfile, delay):
+ def build_tvtk_classes_zip():
+     MY_DIR = os.path.dirname(__file__)
+     zipfile = os.path.join(MY_DIR, 'tvtk', 'tvtk_classes.zip')
+-    if _tvtk_built_recently(zipfile, delay=120):
++    if True or _tvtk_built_recently(zipfile, delay=120):
+         print("Already built tvtk_classes.zip")
+         return
+     else:
+@@ -378,12 +378,12 @@ def configuration(parent_package=None, top_path=None):
      config.add_data_dir('mayavi/core/lut')
      config.add_data_dir('mayavi/tests/data')
      config.add_data_dir('mayavi/tests/csv_files')
@@ -11,7 +26,7 @@
      for pkgdir in ('mayavi', 'tvtk'):
          for root, dirs, files in os.walk(pkgdir):
 -            if split(root)[-1] == 'images':
-+            if (split(root)[-1] == 'images') and files:
++            if split(root)[-1] == 'images' and files:
                  config.add_data_dir(root)
  
      # *.ini files.