wlroots: 0.18.1 -> 0.18.2 (#364488)
[NixPkgs.git] / pkgs / desktops / lomiri / qml / lomiri-action-api / default.nix
blob8493e89f8f1565ce2d14f9aa22c08db007631646
2   stdenv,
3   lib,
4   fetchFromGitLab,
5   gitUpdater,
6   testers,
7   cmake,
8   dbus,
9   dbus-test-runner,
10   doxygen,
11   pkg-config,
12   qtbase,
13   qtdeclarative,
14   qttools,
15   validatePkgConfig,
18 stdenv.mkDerivation (finalAttrs: {
19   pname = "lomiri-action-api";
20   version = "1.1.3";
22   src = fetchFromGitLab {
23     owner = "ubports";
24     repo = "development/core/lomiri-action-api";
25     rev = finalAttrs.version;
26     hash = "sha256-JDcUq7qEp6Z8TjdNspIz4FE/euH+ytGWa4rSxy4voiU=";
27   };
29   outputs = [
30     "out"
31     "dev"
32     "doc"
33   ];
35   postPatch = ''
36     # Queries QMake for broken Qt variable: '/build/qtbase-<commit>/$(out)/$(qtQmlPrefix)'
37     substituteInPlace qml/Lomiri/Action/CMakeLists.txt \
38       --replace-fail 'exec_program(''${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_QML" OUTPUT_VARIABLE QT_IMPORTS_DIR)' 'set(QT_IMPORTS_DIR "''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}")'
40     # Fix section labels
41     substituteInPlace documentation/qml/pages/* \
42       --replace-warn '\part' '\section1'
43   '';
45   strictDeps = true;
47   nativeBuildInputs = [
48     cmake
49     doxygen
50     pkg-config
51     qtdeclarative
52     qttools # qdoc
53     validatePkgConfig
54   ];
56   buildInputs = [
57     qtbase
58     qtdeclarative
59   ];
61   nativeCheckInputs = [
62     dbus
63     dbus-test-runner
64   ];
66   cmakeFlags = [
67     (lib.cmakeBool "ENABLE_TESTING" finalAttrs.finalPackage.doCheck)
68     (lib.cmakeBool "GENERATE_DOCUMENTATION" true)
69     # Use vendored libhud2, TODO package libhud2 separately?
70     (lib.cmakeBool "use_libhud2" false)
71   ];
73   dontWrapQtApps = true;
75   doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
77   preCheck = ''
78     export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
79     export QML2_IMPORT_PATH=${lib.getBin qtdeclarative}/${qtbase.qtQmlPrefix}
80   '';
82   passthru = {
83     tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
84     updateScript = gitUpdater { };
85   };
87   meta = with lib; {
88     description = "Allow applications to export actions in various forms to the Lomiri Shell";
89     homepage = "https://gitlab.com/ubports/development/core/lomiri-action-api";
90     changelog = "https://gitlab.com/ubports/development/core/lomiri-action-api/-/blob/${finalAttrs.version}/ChangeLog";
91     license = licenses.lgpl3Only;
92     maintainers = teams.lomiri.members;
93     platforms = platforms.linux;
94     pkgConfigModules = [ "lomiri-action-qt-1" ];
95   };