about summary refs log tree commit diff
path: root/pkgs/development/libraries/appstream/qt.nix
blob: 1916774b8cfc3eab2e1662778e78b77630f1596b (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
{ lib, stdenv, appstream, qtbase, qttools, nixosTests }:

# TODO: look into using the libraries from the regular appstream derivation as we keep duplicates here

let
  qtSuffix = lib.optionalString (lib.versions.major qtbase.version == "5") "5";
in
stdenv.mkDerivation {
  pname = "appstream-qt";
  inherit (appstream) version src;

  outputs = [ "out" "dev" "installedTests" ];

  buildInputs = appstream.buildInputs ++ [ appstream qtbase ];

  nativeBuildInputs = appstream.nativeBuildInputs ++ [ qttools ];

  mesonFlags = appstream.mesonFlags ++ [
    (lib.mesonBool "qt" true)
    (lib.mesonOption "qt-versions" (lib.versions.major qtbase.version))
  ];

  patches = appstream.patches;

  dontWrapQtApps = true;

  postFixup = ''
    sed -i "$dev/lib/cmake/AppStreamQt${qtSuffix}/AppStreamQt${qtSuffix}Config.cmake" \
      -e "/INTERFACE_INCLUDE_DIRECTORIES/ s@\''${PACKAGE_PREFIX_DIR}@$dev@"
  '';

  passthru = appstream.passthru // {
    tests = {
      installed-tests = nixosTests.installed-tests.appstream-qt;
    };
  };

  meta = appstream.meta // {
    description = "Software metadata handling library - Qt";
 };
}