depot/third_party/nixpkgs/pkgs/development/python-modules/libarchive-c/default.nix
Default email 0eeabdeb66 Project import generated by Copybara.
GitOrigin-RevId: c07b471b52be8fbc49a7dc194e9b37a6e19ee04d
2022-01-24 21:21:06 -06:00

46 lines
891 B
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, libarchive
, glibcLocales
, mock
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "libarchive-c";
version = "4.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "Changaco";
repo = "python-${pname}";
rev = version;
sha256 = "1ar7lj1lpisklq2q07d95yhlbfq25g9g61hcj8whj17mq8vrvml1";
};
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"
];
checkInputs = [
glibcLocales
mock
pytestCheckHook
];
meta = with lib; {
homepage = "https://github.com/Changaco/python-libarchive-c";
description = "Python interface to libarchive";
license = licenses.cc0;
};
}