Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / libarchive-c / default.nix
blob73d99afda6745ec886d466da0c80cf4b583d582e
1 { lib, stdenv
2 , buildPythonPackage
3 , fetchPypi
4 , pytest
5 , glibcLocales
6 , libarchive
7 , mock
8 }:
10 buildPythonPackage rec {
11   pname = "libarchive-c";
12   version = "2.9";
14   src = fetchPypi {
15     inherit pname version;
16     sha256 = "9919344cec203f5db6596a29b5bc26b07ba9662925a05e24980b84709232ef60";
17   };
19   checkInputs = [ mock pytest glibcLocales ];
21   LC_ALL="en_US.UTF-8";
23   postPatch = ''
24     substituteInPlace libarchive/ffi.py --replace \
25       "find_library('archive')" "'${libarchive.lib}/lib/libarchive${stdenv.hostPlatform.extensions.sharedLibrary}'"
26   '';
28   checkPhase = ''
29     py.test tests -k 'not test_check_archiveentry_with_unicode_entries_and_name_zip and not test_check_archiveentry_using_python_testtar'
30   '';
32   meta = with lib; {
33     homepage = "https://github.com/Changaco/python-libarchive-c";
34     description = "Python interface to libarchive";
35     license = licenses.cc0;
36   };