about summary refs log tree commit diff
path: root/pkgs/applications/video/glaxnimate/default.nix
blob: 9e4eda8a0790ac335347823b54b9f0cb9fc5c239 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{ lib
, stdenv
, fetchFromGitLab
, cmake
, zlib
, potrace
, ffmpeg
, libarchive
, python3
, qtbase
, qttools
, wrapQtAppsHook
, testers
, qtsvg
, qtimageformats
  # For the tests
, glaxnimate # Call itself, for the tests
, xvfb-run
}:
let
  # TODO: try to add a python library, see toPythonModule in doc/languages-frameworks/python.section.md
  python3WithLibs = python3.withPackages (ps: with ps; [
    # In data/lib/python-lottie/requirements.txt
    numpy
    pillow
    cairosvg
    fonttools
    grapheme
    opencv4
    pyqt5
    qscintilla
    # Not sure if needed, but appears in some files
    pyyaml
    requests
    pybind11
  ]);
in
stdenv.mkDerivation rec {
  pname = "glaxnimate";
  version = "0.5.4";

  src = fetchFromGitLab {
    owner = "mattbas";
    repo = "${pname}";
    rev = version;
    hash = "sha256-8oHJCQdP2xxSSDM0MDkSrG89WgCtMKm1AKlddnq3gig=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    cmake
    wrapQtAppsHook
    qttools
  ];

  buildInputs = [
    zlib
    potrace
    # Upstream asks for libav dependency, which is fulfilled by ffmpeg
    ffmpeg
    libarchive
    qtbase
    qttools
    qtsvg
    qtimageformats
    python3WithLibs
  ];

  # Translation needs to be separately compiled
  # https://gitlab.com/mattbas/glaxnimate/-/issues/648
  buildFlags = [ "translations" ];

  qtWrapperArgs = [ ''--prefix PATH : ${python3WithLibs}/bin'' ];

  passthru.tests.version = lib.optionalAttrs stdenv.isLinux (testers.testVersion {
    package = glaxnimate;
    command = "${xvfb-run}/bin/xvfb-run glaxnimate --version";
  });

  meta = with lib; {
    homepage = "https://gitlab.com/mattbas/glaxnimate";
    description = "Simple vector animation program";
    license = licenses.gpl3;
    maintainers = with maintainers; [ tobiasBora ];
    mainProgram = "glaxnimate";
  };
}