1{ stdenv
2, buildPythonPackage
3, fetchPypi
4, pytest
5, glibcLocales
6, libarchive
7, mock
8}:
9
10buildPythonPackage rec {
11 pname = "libarchive-c";
12 version = "2.8";
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "06d44d5b9520bdac93048c72b7ed66d11a6626da16d2086f9aad079674d8e061";
17 };
18
19 checkInputs = [ mock pytest glibcLocales ];
20
21 LC_ALL="en_US.UTF-8";
22
23 postPatch = ''
24 substituteInPlace libarchive/ffi.py --replace \
25 "find_library('archive')" "'${libarchive.lib}/lib/libarchive${stdenv.hostPlatform.extensions.sharedLibrary}'"
26 '';
27
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 '';
31
32 meta = with stdenv.lib; {
33 homepage = https://github.com/Changaco/python-libarchive-c;
34 description = "Python interface to libarchive";
35 license = licenses.cc0;
36 };
37
38}