2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
pymupdf,
|
|
|
|
numpy,
|
|
|
|
ipython,
|
|
|
|
texlive,
|
2024-01-02 11:29:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytikz-allefeld"; # "pytikz" on pypi is a different module
|
|
|
|
version = "unstable-2022-11-01";
|
2024-05-15 15:35:15 +00:00
|
|
|
pyproject = true;
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.5";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "allefeld";
|
|
|
|
repo = "pytikz";
|
|
|
|
rev = "f878ebd6ce5a647b1076228b48181b147a61abc1";
|
|
|
|
hash = "sha256-G59UUkpjttJKNBN0MB/A9CftO8tO3nv8qlTxt3/fKHk=";
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
dependencies = [
|
2024-01-02 11:29:13 +00:00
|
|
|
pymupdf
|
|
|
|
numpy
|
|
|
|
ipython
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "tikz" ];
|
|
|
|
|
|
|
|
nativeCheckInputs = [ texlive.combined.scheme-small ];
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
python -c 'if 1:
|
|
|
|
from tikz import *
|
|
|
|
pic = Picture()
|
|
|
|
pic.draw(line([(0, 0), (1, 1)]))
|
|
|
|
print(pic.code())
|
|
|
|
pic.write_image("test.pdf")
|
|
|
|
'
|
|
|
|
test -s test.pdf
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/allefeld/pytikz";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Python interface to TikZ";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ pbsds ];
|
|
|
|
broken = stdenv.isDarwin;
|
|
|
|
};
|
|
|
|
}
|