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";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "0.1.7";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-12-09 12:39:15 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
sha256 = "sha256-4QZ/4nu03iBO+PNpLyPZPF07QpL3iyksb8fcT3V0n3Y=";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|