pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-tables: Adjust patch per upstream discussion



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Thu Dec 12 07:03:10 2024 -0600
Changeset:	10adc58ef390a1a68b70da5aca74ae43bb0cf63b

Modified Files:
	py-tables/Makefile
	py-tables/distinfo
	py-tables/patches/patch-setup.py

Log Message:
py-tables: Adjust patch per upstream discussion

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=10adc58ef390a1a68b70da5aca74ae43bb0cf63b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 py-tables/Makefile               |  3 --
 py-tables/distinfo               |  2 +-
 py-tables/patches/patch-setup.py | 82 +++++++++++++++++-----------------------
 3 files changed, 36 insertions(+), 51 deletions(-)

diffs:
diff --git a/py-tables/Makefile b/py-tables/Makefile
index 41c7550650..bfd6365bf2 100644
--- a/py-tables/Makefile
+++ b/py-tables/Makefile
@@ -19,9 +19,6 @@ DEPENDS+=	${PYPKGPREFIX}-typing-extensions>=4.4.0:../../devel/py-typing-extensio
 
 USE_LANGUAGES=	c c++
 
-# This allows libblosc*.dylib to be found by setup.py
-MAKE_ENV+=	DYLD_LIBRARY_PATH=${PREFIX}/lib
-
 post-install:
 	cd ${DESTDIR}${PREFIX}/bin && \
 	${MV} pt2to3 pt2to3-${PYVERSSUFFIX} && \
diff --git a/py-tables/distinfo b/py-tables/distinfo
index 84b67ee2d8..0bd262c56d 100644
--- a/py-tables/distinfo
+++ b/py-tables/distinfo
@@ -3,4 +3,4 @@ $NetBSD: distinfo,v 1.9 2024/10/23 22:55:52 wiz Exp $
 BLAKE2s (tables-3.10.1.tar.gz) = 1150b460680ad8bad06e7fbf137cb576e80de0de2d0d5b1d3175df9ec3a7db2b
 SHA512 (tables-3.10.1.tar.gz) = 7590dccefdd718d170ac288d391173ed540760a911f53fd39e37dd74237dc554f9363c8d9d4d518f067da299d71a1d8cb4a40134b1afaf79daa0a17de248caf5
 Size (tables-3.10.1.tar.gz) = 4762413 bytes
-SHA1 (patch-setup.py) = e8624f1a654ddb899e37478980ed10dd3e475dd7
+SHA1 (patch-setup.py) = 071120bda37b3efa736d10738658b2a0de4bef5c
diff --git a/py-tables/patches/patch-setup.py b/py-tables/patches/patch-setup.py
index 7eaa07d8be..3404389a17 100644
--- a/py-tables/patches/patch-setup.py
+++ b/py-tables/patches/patch-setup.py
@@ -2,65 +2,53 @@ $NetBSD$
 
 --- setup.py.orig	2024-08-17 08:56:33.000000000 +0000
 +++ setup.py
-@@ -363,6 +363,8 @@ class BasePackage:
+@@ -359,17 +359,38 @@ class BasePackage:
+         # (The argument is accepted for compatibility with previous
+         # methods.)
+ 
++        # Try just library name, relying on the OS search path.
++        # This fails on macOS.
+         # dlopen() won't tell us where the file is, just whether
          # success occurred, so this returns True instead of a filename
++        # Try this before the absolute path search below: A Valentino
          for prefix in self._runtime_prefixes:
              for suffix in self._runtime_suffixes:
-+                print("find_runtime_path() trying ",
-+                      f"{prefix}{self.runtime_name}{suffix}")
++                path = f"{prefix}{self.runtime_name}{suffix}"
++                print("find_runtime_path() trying ", path)
++                      
                  try:
-                     ctypes.CDLL(f"{prefix}{self.runtime_name}{suffix}")
+-                    ctypes.CDLL(f"{prefix}{self.runtime_name}{suffix}")
++                    ctypes.CDLL(path)
                  except OSError:
-@@ -455,6 +457,10 @@ class BasePackage:
- 
-         hook_dirs = hook() if hook is not None else [None, None, None]
+                     pass
+                 else:
+                     return True
  
-+        print("locations = ", locations)
-+        print("hook_dirs = ", hook_dirs)
-+        print("pkgconfig_dirs = ", pkgconfig_dirs)
-+
-         directories = [None, None, None]  # headers, libraries, runtime
-         for idx, (name, find_path, default_dirs) in enumerate(dirdata):
-             use_locations = (
-@@ -463,6 +469,7 @@ class BasePackage:
-                 or hook_dirs[idx]
-                 or default_dirs
-             )
-+            print("use_locations = ", use_locations)
-             # pkgconfig does not list bin/ as the runtime dir
-             if (
-                 name == "blosc"  # blosc
-@@ -475,8 +482,12 @@ class BasePackage:
-                 use_locations = list(use_locations)
-                 use_locations[0] = use_locations[0].parent / "bin"
-                 print(f"Patching runtime dir: {str(use_locations[0])}")
++        # If the library was not found by name alone, try absolute pathnames.
++        # In this case, we can return the path, rather than just True.
++        for location in locations:
++            for prefix in self._runtime_prefixes:
++                for suffix in self._runtime_suffixes:
++                    abs_path = f"{location}/{prefix}{self.runtime_name}{suffix}"
++                    print("find_runtime_path() trying ", abs_path)
++                          
++                    try:
++                        ctypes.CDLL(abs_path)
++                    except OSError:
++                        pass
++                    else:
++                        return abs_path
 +
-+            # FIXME: path is coming up empty for blosc rundir on macOS,
-+            # while returning True on other platforms.
-             path = find_path(use_locations)
-             if path:
-+                print("path = ", path)
-                 if path is True:
-                     directories[idx] = True
-                     continue
-@@ -496,7 +507,19 @@ class BasePackage:
+     def _pkg_config(self, flags):
+         try:
+             cmd = [PKG_CONFIG] + flags.split() + [self.library_name]
+@@ -496,7 +517,8 @@ class BasePackage:
                      directories[idx] = Path(path[: path.rfind(name)])
                  else:
                      directories[idx] = Path(path).parent
 -
 +            else:
-+                print("path is not set!!  This is a problem.")
-+                if name == "blosc" or name == "blosc2":
-+                    print("directories = ", directories)
-+                    print("rundir (should be 'True') = ", directories[2])
-+                    # FIXME: tables-3.10.1 hack
-+                    # Forcing rundir to True for macOS.  This is a
-+                    # hack, but it's the value it should have, since the
-+                    # headers and libs are found.  When rundir is None,
-+                    # setup.py copyies libblosc into the py-tables
-+                    # installation, breaking PLIST.
-+                    # if directories[0] and directories[1]:
-+                    #     directories[2] = True
++                print("Error: path is not set.")
          return tuple(directories)
  
  


Home | Main Index | Thread Index | Old Index