nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 unrar,
7}:
8
9buildPythonPackage rec {
10 pname = "unrardll";
11 version = "0.1.7";
12 format = "setuptools";
13
14 src = fetchPypi {
15 inherit pname version;
16 hash = "sha256-4QZ/4nu03iBO+PNpLyPZPF07QpL3iyksb8fcT3V0n3Y=";
17 };
18
19 buildInputs = [ unrar ];
20
21 env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
22 NIX_CFLAGS_LINK = "-headerpad_max_install_names";
23 };
24
25 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
26 install_name_tool -change libunrar.so ${unrar}/lib/libunrar.so $out/lib/python*/site-packages/unrardll/unrar.*-darwin.so
27 install_name_tool -change libunrar.so ${unrar}/lib/libunrar.so build/lib.*/unrardll/unrar.*-darwin.so
28 '';
29
30 pythonImportsCheck = [ "unrardll" ];
31
32 meta = {
33 description = "Wrap the Unrar DLL to enable unraring of files in python";
34 homepage = "https://github.com/kovidgoyal/unrardll";
35 license = lib.licenses.bsd3;
36 maintainers = with lib.maintainers; [ nyanloutre ];
37 };
38}