Skip to content

Commit d2e5ff9

Browse files
committed
python: bring back LD_LIBRARY_PATH wrapper
1 parent 4d38422 commit d2e5ff9

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

src/modules/languages/python.nix

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,34 @@ in
308308
lib.pipe drv [
309309
(
310310
drv:
311-
drv.overrideAttrs (_: {
312-
buildEnv = pkgs.callPackage ../../python-wrapper.nix {
313-
inherit (drv.pkgs) requiredPythonModules;
314-
python = drv;
315-
extraLibs = libraries;
316-
};
317-
})
311+
drv.overrideAttrs (
312+
prevAttrs:
313+
let
314+
buildEnv = pkgs.callPackage ../../python-wrapper.nix {
315+
inherit (drv.pkgs) requiredPythonModules;
316+
python = drv;
317+
extraLibs = libraries;
318+
makeWrapperArgs = [
319+
"--prefix"
320+
"LD_LIBRARY_PATH"
321+
":"
322+
(lib.makeLibraryPath libraries)
323+
]
324+
++ lib.optionals pkgs.stdenv.isDarwin [
325+
"--prefix"
326+
"DYLD_LIBRARY_PATH"
327+
":"
328+
(lib.makeLibraryPath libraries)
329+
];
330+
};
331+
in
332+
{
333+
inherit buildEnv;
334+
passthru = prevAttrs.passthru // {
335+
inherit buildEnv;
336+
};
337+
}
338+
)
318339
)
319340
appendLibraries
320341
]

0 commit comments

Comments
 (0)