Skip to content

Commit 1e2b1a2

Browse files
author
bacon
committed
math/py-tables: Hack to fix PLIST issue on macOS
setup.py fails to set the runtime dir properly, leading to the mistaken impression that blosc libraries were not found, even though it correctly identified headers and libs. Added a heavily documented temporary patch to override this error. Upstream is aware of the issue, but I suspect may take a while to get a handle on it. PyTables/PyTables#1219
1 parent 95f46da commit 1e2b1a2

2 files changed

Lines changed: 61 additions & 1 deletion

File tree

math/py-tables/distinfo

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
$NetBSD: distinfo,v 1.9 2024/10/23 22:55:52 wiz Exp $
1+
$NetBSD: distinfo,v 1.10 2024/12/02 13:49:08 bacon Exp $
22

33
BLAKE2s (tables-3.10.1.tar.gz) = 1150b460680ad8bad06e7fbf137cb576e80de0de2d0d5b1d3175df9ec3a7db2b
44
SHA512 (tables-3.10.1.tar.gz) = 7590dccefdd718d170ac288d391173ed540760a911f53fd39e37dd74237dc554f9363c8d9d4d518f067da299d71a1d8cb4a40134b1afaf79daa0a17de248caf5
55
Size (tables-3.10.1.tar.gz) = 4762413 bytes
6+
SHA1 (patch-setup.py) = 4082648fb302669890aae49dcae49ef0630f5d60
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
$NetBSD: patch-setup.py,v 1.1 2024/12/02 13:49:09 bacon Exp $
2+
3+
# Hack to fix PLIST on macOS
4+
5+
--- setup.py.orig 2024-08-17 08:56:33.000000000 +0000
6+
+++ setup.py
7+
@@ -455,6 +455,10 @@ class BasePackage:
8+
9+
hook_dirs = hook() if hook is not None else [None, None, None]
10+
11+
+ print("locations = ", locations)
12+
+ print("hook_dirs = ", hook_dirs)
13+
+ print("pkgconfig_dirs = ", pkgconfig_dirs)
14+
+
15+
directories = [None, None, None] # headers, libraries, runtime
16+
for idx, (name, find_path, default_dirs) in enumerate(dirdata):
17+
use_locations = (
18+
@@ -463,6 +467,7 @@ class BasePackage:
19+
or hook_dirs[idx]
20+
or default_dirs
21+
)
22+
+ print("use_locations = ", use_locations)
23+
# pkgconfig does not list bin/ as the runtime dir
24+
if (
25+
name == "blosc" # blosc
26+
@@ -475,8 +480,12 @@ class BasePackage:
27+
use_locations = list(use_locations)
28+
use_locations[0] = use_locations[0].parent / "bin"
29+
print(f"Patching runtime dir: {str(use_locations[0])}")
30+
+
31+
+ # FIXME: path is coming up empty for blosc rundir on macOS,
32+
+ # while returning True on other platforms.
33+
path = find_path(use_locations)
34+
if path:
35+
+ print("path = ", path)
36+
if path is True:
37+
directories[idx] = True
38+
continue
39+
@@ -496,7 +505,19 @@ class BasePackage:
40+
directories[idx] = Path(path[: path.rfind(name)])
41+
else:
42+
directories[idx] = Path(path).parent
43+
-
44+
+ else:
45+
+ print("path is not set!! This is a problem.")
46+
+ if name == "blosc" or name == "blosc2":
47+
+ print("directories = ", directories)
48+
+ print("rundir (should be 'True') = ", directories[2])
49+
+ # FIXME: tables-3.10.1 hack
50+
+ # Forcing rundir to True for macOS. This is a
51+
+ # hack, but it's the value it should have, since the
52+
+ # headers and libs are found. When rundir is None,
53+
+ # setup.py copyies libblosc into the py-tables
54+
+ # installation, breaking PLIST.
55+
+ if directories[0] and directories[1]:
56+
+ directories[2] = True
57+
return tuple(directories)
58+
59+

0 commit comments

Comments
 (0)