about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/rlottie-qml/default.nix
blob: 5154c816624e72d3a47ec69ccf176529f70cc419 (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
{ stdenv
, lib
, fetchFromGitLab
, fetchpatch
, cmake
, qtbase
, qtdeclarative
, qtmultimedia
, quazip
, rlottie
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "rlottie-qml";
  version = "0-unstable-2021-05-03";

  src = fetchFromGitLab {
    owner = "mymike00";
    repo = "rlottie-qml";
    rev = "f9506889a284039888c7a43db37e155bb7b30c40";
    hash = "sha256-e2/4e1GGFfJMwShy6qgnUVVRxjV4WfjQwcqs09RK194=";
  };

  outputs = [
    "out"
    "dev"
  ];

  patches = [
    # Remove when https://gitlab.com/mymike00/rlottie-qml/-/merge_requests/1 merged
    (fetchpatch {
      name = "0001-rlottie-qml-Use-upstream-QuaZip-config-module.patch";
      url = "https://gitlab.com/mymike00/rlottie-qml/-/commit/5656211dd8ae190795e343f47a3393fd3d8d25a4.patch";
      hash = "sha256-t2NlYVU+D8hKd+AvBWPEavAhJKlk7Q3y2iAQSYtks5k=";
    })
  ];

  postPatch = ''
    # Fix QML install path
    substituteInPlace CMakeLists.txt \
      --replace-fail 'QT_IMPORTS_DIR "/lib/''${ARCH_TRIPLET}"' 'QT_IMPORTS_DIR "''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"' \
      --replace-fail "\''${QT_IMPORTS_DIR}/\''${PLUGIN}" "\''${QT_IMPORTS_DIR}" \
  '';

  strictDeps = true;

  nativeBuildInputs = [
    cmake
  ];

  buildInputs = [
    rlottie
    qtbase
    qtdeclarative
    qtmultimedia
  ];

  propagatedBuildInputs = [
    # Config module requires this
    quazip
  ];

  # Only a QML module
  dontWrapQtApps = true;

  meta = with lib; {
    description = "Library for using rlottie via QML";
    homepage = "https://gitlab.com/mymike00/rlottie-qml";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ OPNA2608 ];
    platforms = platforms.all;
  };
})