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";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "5.0";
|
2021-09-18 10:52:07 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Changaco";
|
|
|
|
repo = "python-${pname}";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "sha256-8e3Tnek5q5NJneSVIrbFNTQPjHZ7Ieb14uiKjQwufTE=";
|
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"
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|