summary refs log tree commit diff
path: root/pkgs/development/python-modules/libarchive-c/default.nix
blob: 6bcb7f80484c498758f98768c5e6f185d9777990 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ stdenv
, buildPythonPackage
, fetchPypi
, pytest
, glibcLocales
, libarchive
, mock
}:

buildPythonPackage rec {
  pname = "libarchive-c";
  version = "2.9";

  src = fetchPypi {
    inherit pname version;
    sha256 = "9919344cec203f5db6596a29b5bc26b07ba9662925a05e24980b84709232ef60";
  };

  checkInputs = [ mock pytest glibcLocales ];

  LC_ALL="en_US.UTF-8";

  postPatch = ''
    substituteInPlace libarchive/ffi.py --replace \
      "find_library('archive')" "'${libarchive.lib}/lib/libarchive${stdenv.hostPlatform.extensions.sharedLibrary}'"
  '';

  checkPhase = ''
    py.test tests -k 'not test_check_archiveentry_with_unicode_entries_and_name_zip and not test_check_archiveentry_using_python_testtar'
  '';

  meta = with stdenv.lib; {
    homepage = "https://github.com/Changaco/python-libarchive-c";
    description = "Python interface to libarchive";
    license = licenses.cc0;
  };

}