1{ 2 lib, 3 fetchFromGitHub, 4 buildPythonPackage, 5 pythonOlder, 6 setuptools, 7 pymupdf, 8 numpy, 9 ipython, 10 texlive, 11}: 12 13buildPythonPackage { 14 pname = "pytikz-allefeld"; # "pytikz" on pypi is a different module 15 version = "unstable-2022-11-01"; 16 pyproject = true; 17 18 disabled = pythonOlder "3.5"; 19 20 src = fetchFromGitHub { 21 owner = "allefeld"; 22 repo = "pytikz"; 23 rev = "f878ebd6ce5a647b1076228b48181b147a61abc1"; 24 hash = "sha256-G59UUkpjttJKNBN0MB/A9CftO8tO3nv8qlTxt3/fKHk="; 25 }; 26 27 nativeBuildInputs = [ setuptools ]; 28 29 dependencies = [ 30 pymupdf 31 numpy 32 ipython 33 ]; 34 35 pythonImportsCheck = [ "tikz" ]; 36 37 nativeCheckInputs = [ texlive.combined.scheme-small ]; 38 checkPhase = '' 39 runHook preCheck 40 python -c 'if 1: 41 from tikz import * 42 pic = Picture() 43 pic.draw(line([(0, 0), (1, 1)])) 44 print(pic.code()) 45 pic.write_image("test.pdf") 46 ' 47 test -s test.pdf 48 runHook postCheck 49 ''; 50 51 meta = with lib; { 52 homepage = "https://github.com/allefeld/pytikz"; 53 description = "Python interface to TikZ"; 54 license = licenses.gpl3; 55 maintainers = with maintainers; [ pbsds ]; 56 }; 57}