2022-10-21 18:38:19 +00:00
|
|
|
{ lib, stdenv, buildPythonPackage, fetchPypi, unrar }:
|
2020-12-09 12:39:15 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "unrardll";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.1.5";
|
2020-12-09 12:39:15 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "8bebb480b96cd49d4290d814914f39cff75cf0fa0514c4790bb32b1757227c78";
|
2020-12-09 12:39:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ unrar ];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2020-12-09 12:39:15 +00:00
|
|
|
pythonImportsCheck = [ "unrardll" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Wrap the Unrar DLL to enable unraring of files in python";
|
|
|
|
homepage = "https://github.com/kovidgoyal/unrardll";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ nyanloutre ];
|
|
|
|
};
|
|
|
|
}
|