depot/third_party/nixpkgs/pkgs/development/python-modules/libarchive-c/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

44 lines
916 B
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
libarchive,
glibcLocales,
mock,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "libarchive-c";
version = "5.1";
format = "setuptools";
src = fetchFromGitHub {
owner = "Changaco";
repo = "python-${pname}";
rev = "refs/tags/${version}";
sha256 = "sha256-CO9llPIbVTuE74AeohrMAu5ICkuT/MorRlYEEFne6Uk=";
};
LC_ALL = "en_US.UTF-8";
postPatch = ''
substituteInPlace libarchive/ffi.py --replace \
"find_library('archive')" "'${libarchive.lib}/lib/libarchive${stdenv.hostPlatform.extensions.sharedLibrary}'"
'';
pythonImportsCheck = [ "libarchive" ];
nativeCheckInputs = [
glibcLocales
mock
pytestCheckHook
];
meta = with lib; {
homepage = "https://github.com/Changaco/python-libarchive-c";
description = "Python interface to libarchive";
license = licenses.cc0;
};
}