summary refs log tree commit diff
path: root/pkgs/development/python-modules/unrardll/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/unrardll/default.nix')
-rw-r--r--pkgs/development/python-modules/unrardll/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/unrardll/default.nix b/pkgs/development/python-modules/unrardll/default.nix
index 4feb29a0901..f0a0cbbf175 100644
--- a/pkgs/development/python-modules/unrardll/default.nix
+++ b/pkgs/development/python-modules/unrardll/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildPythonPackage, fetchPypi, unrar }:
+{ lib, stdenv, buildPythonPackage, fetchPypi, unrar }:
 
 buildPythonPackage rec {
   pname = "unrardll";
@@ -11,6 +11,13 @@ buildPythonPackage rec {
 
   buildInputs = [ unrar ];
 
+  NIX_CFLAGS_LINK = lib.optionalString stdenv.isDarwin "-headerpad_max_install_names";
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    install_name_tool -change libunrar.so ${unrar}/lib/libunrar.so $out/lib/python*/site-packages/unrardll/unrar.*-darwin.so
+    install_name_tool -change libunrar.so ${unrar}/lib/libunrar.so build/lib.*/unrardll/unrar.*-darwin.so
+  '';
+
   pythonImportsCheck = [ "unrardll" ];
 
   meta = with lib; {