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