Files
nixpkgs/pkgs/development/python-modules/kaitaistruct/default.nix
magicquark 2d56b80ce3 python3Packages.kaitaistruct: 0.10 -> 0.11
- Release:
https://github.com/kaitai-io/kaitai_struct_python_runtime/releases/tag/v0.11

- Changes:
https://github.com/kaitai-io/kaitai_struct_python_runtime/compare/0.10...v0.11

- Resolves:
https://github.com/NixOS/nixpkgs/issues/442639

- Notes on `mitmproxy`:
  - 'mitmproxy' locks this package to v0.10.
  - To keep the package working, added 'kaitaistruct' to 'relaxedPythonDeps'.
  - The 'mitmproxy' tests still pass with this change.

- Notes on patches:
  - The `sed` command is brittle as the line number to insert the
    package definition for `kaitai-compress` to can change between
    versions.
  - To make it more robust, a patch file has been added.
2025-09-15 23:53:10 +01:00

56 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,
brotli,
lz4,
setuptools,
}:
let
kaitai_compress = fetchFromGitHub {
owner = "kaitai-io";
repo = "kaitai_compress";
rev = "12f4cffb45d95b17033ee4f6679987656c6719cc";
hash = "sha256-l3rGbblUgxO6Y7grlsMEiT3nRIgUZV1VqTyjIgIDtyA=";
};
in
buildPythonPackage rec {
pname = "kaitaistruct";
version = "0.11";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-BT7nZCiOeLjlOs90jpczJorL1Xm42CpCexgFRTYl10s=";
};
patches = [ ./01-add-kaitai-compress.patch ];
preBuild = ''
ln -s ${kaitai_compress}/python/kaitai kaitai
'';
build-system = [ setuptools ];
propagatedBuildInputs = [
brotli
lz4
];
doCheck = false; # no tests in upstream
pythonImportsCheck = [
"kaitaistruct"
"kaitai.compress"
];
meta = with lib; {
description = "Kaitai Struct: runtime library for Python";
homepage = "https://github.com/kaitai-io/kaitai_struct_python_runtime";
license = licenses.mit;
maintainers = [ ];
};
}