2021-08-26 19:38:08 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2018-10-29 15:09:55 +00:00
|
|
|
, buildPythonPackage
|
2021-08-26 19:38:08 +00:00
|
|
|
, fetchFromGitHub
|
2018-11-04 10:35:04 +00:00
|
|
|
, libarchive
|
2021-08-26 19:38:08 +00:00
|
|
|
, glibcLocales
|
2018-11-04 10:35:04 +00:00
|
|
|
, mock
|
2021-08-26 19:38:08 +00:00
|
|
|
, pytestCheckHook
|
2018-10-29 15:09:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "libarchive-c";
|
2022-01-23 19:40:13 +00:00
|
|
|
version = "4.0";
|
2021-08-26 19:38:08 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Changaco";
|
|
|
|
repo = "python-${pname}";
|
|
|
|
rev = version;
|
2022-01-23 19:40:13 +00:00
|
|
|
sha256 = "1ar7lj1lpisklq2q07d95yhlbfq25g9g61hcj8whj17mq8vrvml1";
|
2018-10-29 15:09:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
LC_ALL="en_US.UTF-8";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace libarchive/ffi.py --replace \
|
2018-11-04 10:35:04 +00:00
|
|
|
"find_library('archive')" "'${libarchive.lib}/lib/libarchive${stdenv.hostPlatform.extensions.sharedLibrary}'"
|
2018-10-29 15:09:55 +00:00
|
|
|
'';
|
|
|
|
|
2021-08-26 19:38:08 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"libarchive"
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
glibcLocales
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/Changaco/python-libarchive-c";
|
2018-10-29 15:09:55 +00:00
|
|
|
description = "Python interface to libarchive";
|
|
|
|
license = licenses.cc0;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|