at 23.05-pre 29 lines 951 B view raw
1{ lib, stdenv, buildPythonPackage, fetchPypi, unrar }: 2 3buildPythonPackage rec { 4 pname = "unrardll"; 5 version = "0.1.5"; 6 7 src = fetchPypi { 8 inherit pname version; 9 sha256 = "8bebb480b96cd49d4290d814914f39cff75cf0fa0514c4790bb32b1757227c78"; 10 }; 11 12 buildInputs = [ unrar ]; 13 14 NIX_CFLAGS_LINK = lib.optionalString stdenv.isDarwin "-headerpad_max_install_names"; 15 16 postInstall = lib.optionalString stdenv.isDarwin '' 17 install_name_tool -change libunrar.so ${unrar}/lib/libunrar.so $out/lib/python*/site-packages/unrardll/unrar.*-darwin.so 18 install_name_tool -change libunrar.so ${unrar}/lib/libunrar.so build/lib.*/unrardll/unrar.*-darwin.so 19 ''; 20 21 pythonImportsCheck = [ "unrardll" ]; 22 23 meta = with lib; { 24 description = "Wrap the Unrar DLL to enable unraring of files in python"; 25 homepage = "https://github.com/kovidgoyal/unrardll"; 26 license = licenses.bsd3; 27 maintainers = with maintainers; [ nyanloutre ]; 28 }; 29}