2021-09-18 10:52:07 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-09-18 10:52:07 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, libarchive
|
2021-09-18 10:52:07 +00:00
|
|
|
, glibcLocales
|
2020-04-24 23:36:52 +00:00
|
|
|
, mock
|
2021-09-18 10:52:07 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "libarchive-c";
|
2022-01-25 03:21:06 +00:00
|
|
|
version = "4.0";
|
2021-09-18 10:52:07 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Changaco";
|
|
|
|
repo = "python-${pname}";
|
|
|
|
rev = version;
|
2022-01-25 03:21:06 +00:00
|
|
|
sha256 = "1ar7lj1lpisklq2q07d95yhlbfq25g9g61hcj8whj17mq8vrvml1";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
LC_ALL="en_US.UTF-8";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace libarchive/ffi.py --replace \
|
|
|
|
"find_library('archive')" "'${libarchive.lib}/lib/libarchive${stdenv.hostPlatform.extensions.sharedLibrary}'"
|
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"libarchive"
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
glibcLocales
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/Changaco/python-libarchive-c";
|
|
|
|
description = "Python interface to libarchive";
|
|
|
|
license = licenses.cc0;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|